* src/eval.c (Fquote): Document its non-consing behavior.
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 16 Sep 2011 14:14:48 +0000 (10:14 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 16 Sep 2011 14:14:48 +0000 (10:14 -0400)
Fixes: debbugs:9482

src/ChangeLog
src/eval.c

index cf75c28..9ce2629 100644 (file)
@@ -1,3 +1,7 @@
+2011-09-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * eval.c (Fquote): Document its non-consing behavior (bug#9482).
+
 2011-09-16  Eli Zaretskii  <eliz@gnu.org>
 
        * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
index 57a273c..32b9d36 100644 (file)
@@ -475,6 +475,14 @@ usage: (setq [SYM VAL]...)  */)
 
 DEFUN ("quote", Fquote, Squote, 1, UNEVALLED, 0,
        doc: /* Return the argument, without evaluating it.  `(quote x)' yields `x'.
+Warning: `quote' does not construct its return value, but just returns
+the value that was pre-constructed by the Lisp reader (see info node
+`(elisp)Printed Representation').
+This means that '(a . b) is not identical to (cons 'a 'b): the former
+does not cons.  Quoting should be reserved for constants that will
+never be modified by side-effects, unless you like self-modifying code.
+See the common pitfall in info node `(elisp)Rearrangement' for an example
+of unexpected results when a quoted object is modified.
 usage: (quote ARG)  */)
   (Lisp_Object args)
 {