------------------------------------------------------------ revno: 117138 committer: Leo Liu branch nick: trunk timestamp: Thu 2014-05-22 12:30:48 +0800 message: * sequences.texi (Sequence Functions): Don't mention when and how SEQ to nreverse is mutated. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-05-21 03:49:58 +0000 +++ doc/lispref/ChangeLog 2014-05-22 04:30:48 +0000 @@ -1,3 +1,8 @@ +2014-05-22 Leo Liu + + * sequences.texi (Sequence Functions): Don't mention when and how + SEQ to nreverse is mutated. + 2014-05-21 Leo Liu * sequences.texi (Sequence Functions): Update nreverse. === modified file 'doc/lispref/sequences.texi' --- doc/lispref/sequences.texi 2014-05-21 03:49:58 +0000 +++ doc/lispref/sequences.texi 2014-05-22 04:30:48 +0000 @@ -265,12 +265,7 @@ @cindex reversing a list @cindex reversing a vector This function reverses the order of the elements of @var{seq}. -If @var{seq} is a list, @code{nreverse} alters it by reversing the @sc{cdr}s -in the cons cells. The cons cell that used to be the last one in @var{seq} -becomes the first cons cell of the value. If @var{seq} is a vector or -bool vector, its items are placed in the same vector in a reversed -order. If @var{seq} is a string, it works like @code{reverse} i.e., no -destructive modifcation in preference to treat strings as immutable. +Unlike @code{reverse} the original @var{seq} may be modified. For example: ------------------------------------------------------------ revno: 117137 committer: Glenn Morris branch nick: trunk timestamp: Wed 2014-05-21 19:33:07 -0700 message: Tweak previous bytecomp-tests.el change * test/automated/bytecomp-tests.el (test-byte-comp-compile-and-load): Fix handling of temporary elc files. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2014-05-22 01:16:37 +0000 +++ test/ChangeLog 2014-05-22 02:33:07 +0000 @@ -1,7 +1,7 @@ 2014-05-22 Glenn Morris * automated/bytecomp-tests.el (test-byte-comp-compile-and-load): - Avoid leaving empty .elc tempfiles behind. + Fix handling of temporary elc files. * automated/fns-tests.el (fns-tests-nreverse): Update for changed string behavior. === modified file 'test/automated/bytecomp-tests.el' --- test/automated/bytecomp-tests.el 2014-05-22 01:16:37 +0000 +++ test/automated/bytecomp-tests.el 2014-05-22 02:33:07 +0000 @@ -312,13 +312,14 @@ (progn (setf elfile (make-temp-file "test-bytecomp" nil ".el")) (when compile - (setf elcfile (concat elfile "c"))) + (setf elcfile (make-temp-file "test-bytecomp" nil ".elc"))) (with-temp-buffer (dolist (form forms) (print form (current-buffer))) (write-region (point-min) (point-max) elfile)) (if compile - (let ((byte-compile-dest-file elcfile)) + (let ((byte-compile-dest-file-function + (lambda (e) elcfile))) (byte-compile-file elfile t)) (load elfile))) (when elfile (delete-file elfile)) ------------------------------------------------------------ revno: 117136 committer: Glenn Morris branch nick: trunk timestamp: Wed 2014-05-21 21:16:37 -0400 message: Remove some stray test tempfiles * test/automated/bytecomp-tests.el (test-byte-comp-compile-and-load): Avoid leaving empty .elc tempfiles behind. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2014-05-22 01:09:51 +0000 +++ test/ChangeLog 2014-05-22 01:16:37 +0000 @@ -1,5 +1,8 @@ 2014-05-22 Glenn Morris + * automated/bytecomp-tests.el (test-byte-comp-compile-and-load): + Avoid leaving empty .elc tempfiles behind. + * automated/fns-tests.el (fns-tests-nreverse): Update for changed string behavior. === modified file 'test/automated/bytecomp-tests.el' --- test/automated/bytecomp-tests.el 2014-04-22 07:04:34 +0000 +++ test/automated/bytecomp-tests.el 2014-05-22 01:16:37 +0000 @@ -312,7 +312,7 @@ (progn (setf elfile (make-temp-file "test-bytecomp" nil ".el")) (when compile - (setf elcfile (make-temp-file "test-bytecomp" nil ".elc"))) + (setf elcfile (concat elfile "c"))) (with-temp-buffer (dolist (form forms) (print form (current-buffer))) ------------------------------------------------------------ revno: 117135 committer: Glenn Morris branch nick: trunk timestamp: Wed 2014-05-21 21:09:51 -0400 message: * fns-tests.el (fns-tests-nreverse): Update for changed string behavior. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2014-05-15 14:59:02 +0000 +++ test/ChangeLog 2014-05-22 01:09:51 +0000 @@ -1,3 +1,8 @@ +2014-05-22 Glenn Morris + + * automated/fns-tests.el (fns-tests-nreverse): + Update for changed string behavior. + 2014-05-15 Dmitry Antipov * automated/fns-tests.el: New file. === modified file 'test/automated/fns-tests.el' --- test/automated/fns-tests.el 2014-05-15 14:59:02 +0000 +++ test/automated/fns-tests.el 2014-05-22 01:09:51 +0000 @@ -39,7 +39,7 @@ (should-error (nreverse)) (should-error (nreverse 1)) (should-error (nreverse (make-char-table 'foo))) - (should-error (nreverse "xyzzy")) + (should (equal (nreverse "xyzzy") "yzzyx")) (let ((A [])) (nreverse A) (should (equal A []))) ------------------------------------------------------------ revno: 117134 fixes bug: http://debbugs.gnu.org/17519 committer: Paul Eggert branch nick: trunk timestamp: Wed 2014-05-21 12:51:58 -0700 message: Don't assume that ImageMagick uses a 16-bit quantum. * image.c (imagemagick_load_image): Port to hosts that do not use a 16-bit quantum, i.e., QuantumRange does not equal 65535. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-21 03:49:58 +0000 +++ src/ChangeLog 2014-05-21 19:51:58 +0000 @@ -1,3 +1,9 @@ +2014-05-21 Paul Eggert + + Don't assume that ImageMagick uses a 16-bit quantum (Bug#17519). + * image.c (imagemagick_load_image): Port to hosts that do not use + a 16-bit quantum, i.e., QuantumRange does not equal 65535. + 2014-05-21 Leo Liu * fns.c (Fnreverse): Accept strings for SEQ and update doc-string. === modified file 'src/image.c' --- src/image.c 2014-05-07 18:20:18 +0000 +++ src/image.c 2014-05-21 19:51:58 +0000 @@ -8368,6 +8368,7 @@ #endif /* HAVE_MAGICKEXPORTIMAGEPIXELS */ { size_t image_height; + double color_scale = 65535.0 / QuantumRange; /* Try to create a x pixmap to hold the imagemagick pixmap. */ if (!image_create_x_image_and_pixmap (f, img, width, height, 0, @@ -8408,9 +8409,9 @@ PixelGetMagickColor (pixels[x], &pixel); XPutPixel (ximg, x, y, lookup_rgb_color (f, - pixel.red, - pixel.green, - pixel.blue)); + color_scale * pixel.red, + color_scale * pixel.green, + color_scale * pixel.blue)); } } DestroyPixelIterator (iterator); ------------------------------------------------------------ revno: 117133 committer: Leo Liu branch nick: trunk timestamp: Wed 2014-05-21 11:49:58 +0800 message: * doc/lispref/sequences.texi (Sequence Functions): Update nreverse. * src/fns.c (Fnreverse): Accept strings for SEQ and update doc-string. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-05-19 19:19:05 +0000 +++ doc/lispref/ChangeLog 2014-05-21 03:49:58 +0000 @@ -1,3 +1,7 @@ +2014-05-21 Leo Liu + + * sequences.texi (Sequence Functions): Update nreverse. + 2014-05-19 Paul Eggert Allow any non-nil value to count as true in bool-vector. === modified file 'doc/lispref/sequences.texi' --- doc/lispref/sequences.texi 2014-05-19 19:19:05 +0000 +++ doc/lispref/sequences.texi 2014-05-21 03:49:58 +0000 @@ -261,13 +261,16 @@ @end defun @defun nreverse seq +@cindex reversing a string @cindex reversing a list @cindex reversing a vector This function reverses the order of the elements of @var{seq}. -If @var{seq} is a list, @code{nreverse} alters its by reversing the @sc{cdr}s +If @var{seq} is a list, @code{nreverse} alters it by reversing the @sc{cdr}s in the cons cells. The cons cell that used to be the last one in @var{seq} becomes the first cons cell of the value. If @var{seq} is a vector or -bool vector, its items are placed in the same vector in a reversed order. +bool vector, its items are placed in the same vector in a reversed +order. If @var{seq} is a string, it works like @code{reverse} i.e., no +destructive modifcation in preference to treat strings as immutable. For example: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-05-20 08:25:18 +0000 +++ src/ChangeLog 2014-05-21 03:49:58 +0000 @@ -1,3 +1,7 @@ +2014-05-21 Leo Liu + + * fns.c (Fnreverse): Accept strings for SEQ and update doc-string. + 2014-05-20 Michael Albinus * dbusbind.c (xd_signature): Revert last 2 patches. === modified file 'src/fns.c' --- src/fns.c 2014-05-15 14:59:02 +0000 +++ src/fns.c 2014-05-21 03:49:58 +0000 @@ -1697,16 +1697,15 @@ } DEFUN ("nreverse", Fnreverse, Snreverse, 1, 1, 0, - doc: /* Reverse order of items in a list or vector SEQ. -If SEQ is a list, it should be nil-terminated, and reversed -by modifying cdr pointers. Return the reversed SEQ. - -Note that unlike `reverse', this function doesn't work with strings. -It is strongly encouraged to treat them as immutable. */) + doc: /* Reverse order of items in a list, vector or string SEQ. +If SEQ is a list, it should be nil-terminated. +This function may destructively modify SEQ to produce the value. */) (Lisp_Object seq) { if (NILP (seq)) return seq; + else if (STRINGP (seq)) + return Freverse (seq); else if (CONSP (seq)) { Lisp_Object prev, tail, next;