]> git.eshelyaron.com Git - emacs.git/commitdiff
Small doc updates for generalized variables
authorGlenn Morris <rgm@gnu.org>
Wed, 7 Nov 2012 04:37:07 +0000 (20:37 -0800)
committerGlenn Morris <rgm@gnu.org>
Wed, 7 Nov 2012 04:37:07 +0000 (20:37 -0800)
* lisp/emacs-lisp/gv.el (gv-letplace): Fix doc typo.
(gv-define-simple-setter): Update doc of `fix-return'.

* doc/lispref/variables.texi (Adding Generalized Variables):
Update description of FIX-RETURN expansion.

* doc/misc/cl.texi (Obsolete Setf Customization):
Revert defsetf example to the more correct let rather than prog1.

doc/lispref/ChangeLog
doc/lispref/variables.texi
doc/misc/ChangeLog
doc/misc/cl.texi
lisp/ChangeLog
lisp/emacs-lisp/gv.el

index c588e81dd1fdd5d386e8d028a02a87f698c39b78..6e7a0b7a648781be2360220c9ccf96cd4626d706 100644 (file)
@@ -1,3 +1,8 @@
+2012-11-07  Glenn Morris  <rgm@gnu.org>
+
+       * variables.texi (Adding Generalized Variables):
+       Update description of FIX-RETURN expansion.
+
 2012-11-06  Glenn Morris  <rgm@gnu.org>
 
        * variables.texi (Setting Generalized Variables):
index a7134af20bd68bc64cb4c8c725fa64a88e9a3fdd..fb98b3cd035c1bab5b6fc57b126eec38adb71e4e 100644 (file)
@@ -2089,8 +2089,13 @@ no problem with, e.g., @code{car} and @code{setcar}, because
 @code{setcar} returns the value that it set.  If your @var{setter}
 function does not return @var{value}, use a non-@code{nil} value for
 the @var{fix-return} argument of @code{gv-define-simple-setter}.  This
-wraps the @code{setf} expansion in @code{(prog1 @var{value} @dots{})}
-so that it returns the correct result.
+expands into something equivalent to
+@example
+(let ((temp @var{value}))
+  (@var{setter} @var{args}@dots{} temp)
+  temp)
+@end example
+so ensuring that it returns the correct result.
 @end defmac
 
 
index bd815e3df9f8c128fd1e8c5c1553a34a62795f78..49f86ef093b800ee59324c986e761aa45149e43e 100644 (file)
@@ -1,3 +1,8 @@
+2012-11-07  Glenn Morris  <rgm@gnu.org>
+
+       * cl.texi (Obsolete Setf Customization):
+       Revert defsetf example to the more correct let rather than prog1.
+
 2012-11-06  Glenn Morris  <rgm@gnu.org>
 
        * cl.texi (Overview): Mention EIEIO here, as well as the appendix.
index a5a696b6b16f6cd596b457efb3acbb89e8b884aa..e39186c12229f787fef6543d9443a14f07cd5359 100644 (file)
@@ -4950,9 +4950,8 @@ is completely irregular.
 @end defmac
 
 @defmac defsetf access-fn update-fn
-This is the simpler of two @code{defsetf} forms, and is entirely
-obsolete, being replaced by @code{gv-define-simple-setter} in Emacs
-24.3.
+This is the simpler of two @code{defsetf} forms, and is
+replaced by @code{gv-define-simple-setter} in Emacs 24.3.
 @xref{Adding Generalized Variables,,,elisp,GNU Emacs Lisp Reference Manual}.
 
 Where @var{access-fn} is the name of a function that accesses a place,
@@ -4983,8 +4982,9 @@ not suitable, so that the above @code{setf} should be expanded to
 something more like
 
 @example
-(prog1 @var{value}
-  (@var{update-fn} @var{arg1} @var{arg2} @var{arg3} @var{value}))
+(let ((temp @var{value}))
+  (@var{update-fn} @var{arg1} @var{arg2} @var{arg3} temp)
+  temp)
 @end example
 
 Some examples are:
index 187ff2d7e1da080767672412dbcab3f1506c87d2..cfd79fc57ef8b4d188b336175b2f74b2b2daca9c 100644 (file)
@@ -1,3 +1,8 @@
+2012-11-07  Glenn Morris  <rgm@gnu.org>
+
+       * emacs-lisp/gv.el (gv-letplace): Fix doc typo.
+       (gv-define-simple-setter): Update doc of `fix-return'.
+
 2012-11-07  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/gv.el (gv-define-simple-setter): Don't evaluate `val'
index a0c412a95043c4497fe21cf09cb670a5e862ab24..145c48c670e09618ba02f7c4abc1acfde4f03b38 100644 (file)
@@ -111,7 +111,7 @@ DO must return an Elisp expression."
 GETTER will be bound to a copyable expression that returns the value
 of PLACE.
 SETTER will be bound to a function that takes an expression V and returns
-and new expression that sets PLACE to V.
+a new expression that sets PLACE to V.
 BODY should return some Elisp expression E manipulating PLACE via GETTER
 and SETTER.
 The returned value will then be an Elisp expression that first evaluates
@@ -209,8 +209,12 @@ to be pure and copyable.  Example use:
 This macro is an easy-to-use substitute for `gv-define-expander' that works
 well for simple place forms.  Assignments of VAL to (NAME ARGS...) are
 turned into calls of the form (SETTER ARGS... VAL).
+
 If FIX-RETURN is non-nil, then SETTER is not assumed to return VAL and
-instead the assignment is turned into (prog1 VAL (SETTER ARGS... VAL))
+instead the assignment is turned into something equivalent to
+  \(let ((temp VAL))
+    (SETTER ARGS... temp)
+    temp)
 so as to preserve the semantics of `setf'."
   (declare (debug (sexp (&or symbolp lambda-expr) &optional sexp)))
   `(gv-define-setter ,name (val &rest args)