diff options
| author | Glenn Morris | 2012-11-06 20:37:07 -0800 |
|---|---|---|
| committer | Glenn Morris | 2012-11-06 20:37:07 -0800 |
| commit | 2ee1d59f5bea4a206595d621dcb63477461b7155 (patch) | |
| tree | 11e77e75f9dd809295149af72e46b8044675b899 | |
| parent | b715ed4447b025d713fc68a7af3728c2d463974b (diff) | |
| download | emacs-2ee1d59f5bea4a206595d621dcb63477461b7155.tar.gz emacs-2ee1d59f5bea4a206595d621dcb63477461b7155.zip | |
Small doc updates for generalized variables
* 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.
| -rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/variables.texi | 9 | ||||
| -rw-r--r-- | doc/misc/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/misc/cl.texi | 10 | ||||
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/gv.el | 8 |
6 files changed, 33 insertions, 9 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index c588e81dd1f..6e7a0b7a648 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-11-07 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * variables.texi (Adding Generalized Variables): | ||
| 4 | Update description of FIX-RETURN expansion. | ||
| 5 | |||
| 1 | 2012-11-06 Glenn Morris <rgm@gnu.org> | 6 | 2012-11-06 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * variables.texi (Setting Generalized Variables): | 8 | * variables.texi (Setting Generalized Variables): |
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index a7134af20bd..fb98b3cd035 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi | |||
| @@ -2089,8 +2089,13 @@ no problem with, e.g., @code{car} and @code{setcar}, because | |||
| 2089 | @code{setcar} returns the value that it set. If your @var{setter} | 2089 | @code{setcar} returns the value that it set. If your @var{setter} |
| 2090 | function does not return @var{value}, use a non-@code{nil} value for | 2090 | function does not return @var{value}, use a non-@code{nil} value for |
| 2091 | the @var{fix-return} argument of @code{gv-define-simple-setter}. This | 2091 | the @var{fix-return} argument of @code{gv-define-simple-setter}. This |
| 2092 | wraps the @code{setf} expansion in @code{(prog1 @var{value} @dots{})} | 2092 | expands into something equivalent to |
| 2093 | so that it returns the correct result. | 2093 | @example |
| 2094 | (let ((temp @var{value})) | ||
| 2095 | (@var{setter} @var{args}@dots{} temp) | ||
| 2096 | temp) | ||
| 2097 | @end example | ||
| 2098 | so ensuring that it returns the correct result. | ||
| 2094 | @end defmac | 2099 | @end defmac |
| 2095 | 2100 | ||
| 2096 | 2101 | ||
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index bd815e3df9f..49f86ef093b 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-11-07 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * cl.texi (Obsolete Setf Customization): | ||
| 4 | Revert defsetf example to the more correct let rather than prog1. | ||
| 5 | |||
| 1 | 2012-11-06 Glenn Morris <rgm@gnu.org> | 6 | 2012-11-06 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * cl.texi (Overview): Mention EIEIO here, as well as the appendix. | 8 | * cl.texi (Overview): Mention EIEIO here, as well as the appendix. |
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index a5a696b6b16..e39186c1222 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi | |||
| @@ -4950,9 +4950,8 @@ is completely irregular. | |||
| 4950 | @end defmac | 4950 | @end defmac |
| 4951 | 4951 | ||
| 4952 | @defmac defsetf access-fn update-fn | 4952 | @defmac defsetf access-fn update-fn |
| 4953 | This is the simpler of two @code{defsetf} forms, and is entirely | 4953 | This is the simpler of two @code{defsetf} forms, and is |
| 4954 | obsolete, being replaced by @code{gv-define-simple-setter} in Emacs | 4954 | replaced by @code{gv-define-simple-setter} in Emacs 24.3. |
| 4955 | 24.3. | ||
| 4956 | @xref{Adding Generalized Variables,,,elisp,GNU Emacs Lisp Reference Manual}. | 4955 | @xref{Adding Generalized Variables,,,elisp,GNU Emacs Lisp Reference Manual}. |
| 4957 | 4956 | ||
| 4958 | Where @var{access-fn} is the name of a function that accesses a place, | 4957 | 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 | |||
| 4983 | something more like | 4982 | something more like |
| 4984 | 4983 | ||
| 4985 | @example | 4984 | @example |
| 4986 | (prog1 @var{value} | 4985 | (let ((temp @var{value})) |
| 4987 | (@var{update-fn} @var{arg1} @var{arg2} @var{arg3} @var{value})) | 4986 | (@var{update-fn} @var{arg1} @var{arg2} @var{arg3} temp) |
| 4987 | temp) | ||
| 4988 | @end example | 4988 | @end example |
| 4989 | 4989 | ||
| 4990 | Some examples are: | 4990 | Some examples are: |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 187ff2d7e1d..cfd79fc57ef 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-11-07 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/gv.el (gv-letplace): Fix doc typo. | ||
| 4 | (gv-define-simple-setter): Update doc of `fix-return'. | ||
| 5 | |||
| 1 | 2012-11-07 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2012-11-07 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * emacs-lisp/gv.el (gv-define-simple-setter): Don't evaluate `val' | 8 | * emacs-lisp/gv.el (gv-define-simple-setter): Don't evaluate `val' |
diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index a0c412a9504..145c48c670e 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el | |||
| @@ -111,7 +111,7 @@ DO must return an Elisp expression." | |||
| 111 | GETTER will be bound to a copyable expression that returns the value | 111 | GETTER will be bound to a copyable expression that returns the value |
| 112 | of PLACE. | 112 | of PLACE. |
| 113 | SETTER will be bound to a function that takes an expression V and returns | 113 | SETTER will be bound to a function that takes an expression V and returns |
| 114 | and new expression that sets PLACE to V. | 114 | a new expression that sets PLACE to V. |
| 115 | BODY should return some Elisp expression E manipulating PLACE via GETTER | 115 | BODY should return some Elisp expression E manipulating PLACE via GETTER |
| 116 | and SETTER. | 116 | and SETTER. |
| 117 | The returned value will then be an Elisp expression that first evaluates | 117 | The returned value will then be an Elisp expression that first evaluates |
| @@ -209,8 +209,12 @@ to be pure and copyable. Example use: | |||
| 209 | This macro is an easy-to-use substitute for `gv-define-expander' that works | 209 | This macro is an easy-to-use substitute for `gv-define-expander' that works |
| 210 | well for simple place forms. Assignments of VAL to (NAME ARGS...) are | 210 | well for simple place forms. Assignments of VAL to (NAME ARGS...) are |
| 211 | turned into calls of the form (SETTER ARGS... VAL). | 211 | turned into calls of the form (SETTER ARGS... VAL). |
| 212 | |||
| 212 | If FIX-RETURN is non-nil, then SETTER is not assumed to return VAL and | 213 | If FIX-RETURN is non-nil, then SETTER is not assumed to return VAL and |
| 213 | instead the assignment is turned into (prog1 VAL (SETTER ARGS... VAL)) | 214 | instead the assignment is turned into something equivalent to |
| 215 | \(let ((temp VAL)) | ||
| 216 | (SETTER ARGS... temp) | ||
| 217 | temp) | ||
| 214 | so as to preserve the semantics of `setf'." | 218 | so as to preserve the semantics of `setf'." |
| 215 | (declare (debug (sexp (&or symbolp lambda-expr) &optional sexp))) | 219 | (declare (debug (sexp (&or symbolp lambda-expr) &optional sexp))) |
| 216 | `(gv-define-setter ,name (val &rest args) | 220 | `(gv-define-setter ,name (val &rest args) |