From: Stefan Monnier Date: Mon, 16 Dec 2013 19:12:21 +0000 (-0500) Subject: * lisp/emacs-lisp/gv.el (gv-ref): Mention lexbind restriction. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~383 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=39cb42c6213248c07f298be04c79b606be7d431d;p=emacs.git * lisp/emacs-lisp/gv.el (gv-ref): Mention lexbind restriction. Fixes: debbugs:16153 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9ccc510ce1a..6b0b8fc67d8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2013-12-16 Stefan Monnier + + * emacs-lisp/gv.el (gv-ref): Mention lexbind restriction (bug#16153). + 2013-12-16 Teodor Zlatanov * progmodes/cfengine.el (cfengine3--current-word): Remove. @@ -9,8 +13,8 @@ 2013-12-16 Martin Rudalics - * window.el (display-buffer-below-selected): Bind - split-height-threshold to 0 as suggested by Juri Linkov. + * window.el (display-buffer-below-selected): + Bind split-height-threshold to 0 as suggested by Juri Linkov. 2013-12-16 Leo Liu diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 1a3800597a6..47ab36c0531 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -454,7 +454,10 @@ The return value is the last VAL in the list. ;;;###autoload (defmacro gv-ref (place) "Return a reference to PLACE. -This is like the `&' operator of the C language." +This is like the `&' operator of the C language. +Note: this only works reliably with lexical binding mode, except for very +simple PLACEs such as (function-symbol 'foo) which will also work in dynamic +binding mode." (gv-letplace (getter setter) place `(cons (lambda () ,getter) (lambda (gv--val) ,(funcall setter 'gv--val)))))