emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110737: Doc and manual updates for c


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110737: Doc and manual updates for cl-letf and letf
Date: Tue, 30 Oct 2012 00:34:37 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110737
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Tue 2012-10-30 00:34:37 -0700
message:
  Doc and manual updates for cl-letf and letf
  Fixes: debbugs:12760
  
  * doc/misc/cl.texi (Modify Macros): Update for cl-letf changes.
  (Obsolete Lexical Macros): Say a little more about letf/cl-letf.
  
  * lisp/emacs-lisp/cl.el (letf): Doc fix. 
  
  * etc/NEWS: Related edit.
modified:
  doc/misc/ChangeLog
  doc/misc/cl.texi
  etc/NEWS
  lisp/ChangeLog
  lisp/emacs-lisp/cl.el
=== modified file 'doc/misc/ChangeLog'
--- a/doc/misc/ChangeLog        2012-10-29 01:36:29 +0000
+++ b/doc/misc/ChangeLog        2012-10-30 07:34:37 +0000
@@ -1,3 +1,8 @@
+2012-10-30  Glenn Morris  <address@hidden>
+
+       * cl.texi (Modify Macros): Update for cl-letf changes.
+       (Obsolete Lexical Macros): Say a little more about letf/cl-letf.
+
 2012-10-29  Glenn Morris  <address@hidden>
 
        * cl.texi (Organization): More details on cl-lib.el versus cl.el.

=== modified file 'doc/misc/cl.texi'
--- a/doc/misc/cl.texi  2012-10-29 01:36:29 +0000
+++ b/doc/misc/cl.texi  2012-10-30 07:34:37 +0000
@@ -882,7 +882,7 @@
 
 @menu
 * Setf Extensions::    Additional @code{setf} places.
-* Modify Macros::      @code{cl-incf}, @code{cl-rotatef}, @code{letf}, 
@code{cl-callf}, etc.
+* Modify Macros::      @code{cl-incf}, @code{cl-rotatef}, @code{cl-letf}, 
@code{cl-callf}, etc.
 @end menu
 
 @node Setf Extensions
@@ -1127,7 +1127,7 @@
 The following macros were invented for this package; they have no
 analogues in Common Lisp.
 
address@hidden letf (address@hidden) address@hidden
address@hidden cl-letf (address@hidden) address@hidden
 This macro is analogous to @code{let}, but for generalized variables
 rather than just symbols.  Each @var{binding} should be of the form
 @code{(@var{place} @var{value})}; the original contents of the
@@ -1140,47 +1140,59 @@
 For example,
 
 @example
-(letf (((point) (point-min))
-       (a 17))
-  ...)
+(cl-letf (((point) (point-min))
+          (a 17))
+     ...)
 @end example
 
 @noindent
-moves ``point'' in the current buffer to the beginning of the buffer,
+moves point in the current buffer to the beginning of the buffer,
 and also binds @code{a} to 17 (as if by a normal @code{let}, since
 @code{a} is just a regular variable).  After the body exits, @code{a}
 is set back to its original value and point is moved back to its
 original position.
 
-Note that @code{letf} on @code{(point)} is not quite like a
+Note that @code{cl-letf} on @code{(point)} is not quite like a
 @code{save-excursion}, as the latter effectively saves a marker
 which tracks insertions and deletions in the buffer.  Actually,
-a @code{letf} of @code{(point-marker)} is much closer to this
+a @code{cl-letf} of @code{(point-marker)} is much closer to this
 behavior.  (@code{point} and @code{point-marker} are equivalent
 as @code{setf} places; each will accept either an integer or a
 marker as the stored value.)
 
 Since generalized variables look like lists, @code{let}'s shorthand
 of using @samp{foo} for @samp{(foo nil)} as a @var{binding} would
-be ambiguous in @code{letf} and is not allowed.
+be ambiguous in @code{cl-letf} and is not allowed.
 
 However, a @var{binding} specifier may be a one-element list
 @samp{(@var{place})}, which is similar to @samp{(@var{place}
 @var{place})}.  In other words, the @var{place} is not disturbed
-on entry to the body, and the only effect of the @code{letf} is
-to restore the original value of @var{place} afterwards.  (The
-redundant access-and-store suggested by the @code{(@var{place}
+on entry to the body, and the only effect of the @code{cl-letf} is
+to restore the original value of @var{place} afterwards.
address@hidden I suspect this may no longer be true; either way it's
address@hidden implementation detail and so not essential to document.
address@hidden
+(The redundant access-and-store suggested by the @code{(@var{place}
 @var{place})} example does not actually occur.)
address@hidden ignore
 
-In most cases, the @var{place} must have a well-defined value on
-entry to the @code{letf} form.  The only exceptions are plain
-variables and calls to @code{symbol-value} and @code{symbol-function}.
-If the symbol is not bound on entry, it is simply made unbound by
address@hidden or @code{fmakunbound} on exit.
+Note that in this case, and in fact almost every case, @var{place}
+must have a well-defined value outside the @code{cl-letf} body.
+There is essentially only one exception to this, which is @var{place}
+a plain variable with a specified @var{value} (such as @code{(a 17)}
+in the above example).
address@hidden See http://debbugs.gnu.org/12758
address@hidden Some or all of this was true for cl.el, but not for cl-lib.el.
address@hidden
+The only exceptions are plain variables and calls to
address@hidden and @code{symbol-function}.  If the symbol is not
+bound on entry, it is simply made unbound by @code{makunbound} or
address@hidden on exit.
address@hidden ignore
 @end defmac
 
 @defmac cl-letf* (address@hidden) address@hidden
-This macro is to @code{letf} what @code{let*} is to @code{let}:
+This macro is to @code{cl-letf} what @code{let*} is to @code{let}:
 It does the bindings in sequential rather than parallel order.
 @end defmac
 
@@ -1210,7 +1222,7 @@
 
 The @code{cl-callf} and @code{cl-callf2} macros serve as building
 blocks for other macros like @code{cl-incf}, and @code{cl-pushnew}.
-The @code{letf} and @code{cl-letf*} macros are used in the processing
+The @code{cl-letf} and @code{cl-letf*} macros are used in the processing
 of symbol macros; @pxref{Macro Bindings}.
 
 
@@ -1221,7 +1233,7 @@
 These Lisp forms make bindings to variables and function names,
 analogous to Lisp's built-in @code{let} form.
 
address@hidden Macros}, for the @code{letf} and @code{cl-letf*} forms which
address@hidden Macros}, for the @code{cl-letf} and @code{cl-letf*} forms which
 are also related to variable bindings.
 
 @menu
@@ -1370,7 +1382,7 @@
 @code{(setf foo 4)}, which in turn expands to @code{(setf (car bar) 4)}.
 
 Likewise, a @code{let} or @code{let*} binding a symbol macro is
-treated like a @code{letf} or @code{cl-letf*}.  This differs from true
+treated like a @code{cl-letf} or @code{cl-letf*}.  This differs from true
 @c FIXME does it work like this in Emacs with lexical-binding = t?
 Common Lisp, where the rules of lexical scoping cause a @code{let}
 binding to shadow a @code{cl-symbol-macrolet} binding.  In this package,
@@ -4870,7 +4882,10 @@
 @end defmac
 
 @defmac letf (address@hidden) address@hidden
-Replaced by @code{cl-letf} (@pxref{Modify Macros}).
+This macro is almost exactly the same as @code{cl-letf}, which
+replaces it (@pxref{Modify Macros}).  The only difference is in
+details that relate to some deprecated usage of @code{symbol-function}
+in place forms.
 @end defmac
 
 @node Obsolete Setf Customization

=== modified file 'etc/NEWS'
--- a/etc/NEWS  2012-10-30 00:29:37 +0000
+++ b/etc/NEWS  2012-10-30 07:34:37 +0000
@@ -323,7 +323,10 @@
 to the `lexical-let' machinery used previously) to capture definitions in
 closures, so such closures will only work if `lexical-binding' is in use.
 
++++
 *** `cl-letf' is not exactly like `letf'.
+The only difference is in details that relate to some deprecated usage
+of `symbol-function' in place forms.
 
 +++
 *** `progv' was rewritten to use the `let' machinery.

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-10-29 23:20:24 +0000
+++ b/lisp/ChangeLog    2012-10-30 07:34:37 +0000
@@ -1,3 +1,7 @@
+2012-10-30  Glenn Morris  <address@hidden>
+
+       * emacs-lisp/cl.el (letf): Doc fix.  (Bug#12760)
+
 2012-10-29  Chong Yidong  <address@hidden>
 
        * isearch.el (isearch-other-meta-char): Ensure that a reprocessed

=== modified file 'lisp/emacs-lisp/cl.el'
--- a/lisp/emacs-lisp/cl.el     2012-10-29 13:50:05 +0000
+++ b/lisp/emacs-lisp/cl.el     2012-10-30 07:34:37 +0000
@@ -511,7 +511,9 @@
 
 (defmacro letf (bindings &rest body)
   "Dynamically scoped let-style bindings for places.
-Like `cl-letf', but with some extra backward compatibility."
+For more details, see `cl-letf'.  This macro behaves like that one
+in almost every respect (apart from details that relate to some
+deprecated usage of `symbol-function' in place forms)."  ; bug#12760
   (declare (indent 1) (debug cl-letf))
   ;; Like cl-letf, but with special handling of symbol-function.
   `(cl-letf ,(mapcar (lambda (x) (if (eq (car-safe (car x)) 'symbol-function)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]