diff options
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/emacs-lisp/gv.el | 17 | ||||
| -rw-r--r-- | lisp/progmodes/gud.el | 2 |
3 files changed, 23 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 63071734cf8..0cfe8eed02a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2015-03-03 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * progmodes/gud.el: Use lexical-binding (bug#19966). | ||
| 4 | |||
| 5 | * emacs-lisp/gv.el (gv-ref): Warn about likely problematic cases. | ||
| 6 | |||
| 1 | 2015-03-03 Daniel Colascione <dancol@dancol.org> | 7 | 2015-03-03 Daniel Colascione <dancol@dancol.org> |
| 2 | 8 | ||
| 3 | * emacs-lisp/generator.el: Make globals conform to elisp | 9 | * emacs-lisp/generator.el: Make globals conform to elisp |
| @@ -6,8 +12,8 @@ | |||
| 6 | `cps-disable-atomic-optimization'. | 12 | `cps-disable-atomic-optimization'. |
| 7 | (cps--gensym): New macro; replaces `cl-gensym' throughout. | 13 | (cps--gensym): New macro; replaces `cl-gensym' throughout. |
| 8 | (cps-generate-evaluator): Move the `iter-yield' local macro | 14 | (cps-generate-evaluator): Move the `iter-yield' local macro |
| 9 | definition here | 15 | definition here... |
| 10 | (iter-defun, iter-lambda): from here. | 16 | (iter-defun, iter-lambda): ...from here. |
| 11 | 17 | ||
| 12 | 2015-03-03 Artur Malabarba <bruce.connor.am@gmail.com> | 18 | 2015-03-03 Artur Malabarba <bruce.connor.am@gmail.com> |
| 13 | 19 | ||
diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 5d6e6e1b372..fae3bcb86f6 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el | |||
| @@ -493,9 +493,20 @@ This is like the `&' operator of the C language. | |||
| 493 | Note: this only works reliably with lexical binding mode, except for very | 493 | Note: this only works reliably with lexical binding mode, except for very |
| 494 | simple PLACEs such as (function-symbol 'foo) which will also work in dynamic | 494 | simple PLACEs such as (function-symbol 'foo) which will also work in dynamic |
| 495 | binding mode." | 495 | binding mode." |
| 496 | (gv-letplace (getter setter) place | 496 | (let ((code |
| 497 | `(cons (lambda () ,getter) | 497 | (gv-letplace (getter setter) place |
| 498 | (lambda (gv--val) ,(funcall setter 'gv--val))))) | 498 | `(cons (lambda () ,getter) |
| 499 | (lambda (gv--val) ,(funcall setter 'gv--val)))))) | ||
| 500 | (if (or lexical-binding | ||
| 501 | ;; If `code' still starts with `cons' then presumably gv-letplace | ||
| 502 | ;; did not add any new let-bindings, so the `lambda's don't capture | ||
| 503 | ;; any new variables. As a consequence, the code probably works in | ||
| 504 | ;; dynamic binding mode as well. | ||
| 505 | (eq (car-safe code) 'cons)) | ||
| 506 | code | ||
| 507 | (macroexp--warn-and-return | ||
| 508 | "Use of gv-ref probably requires lexical-binding" | ||
| 509 | code)))) | ||
| 499 | 510 | ||
| 500 | (defsubst gv-deref (ref) | 511 | (defsubst gv-deref (ref) |
| 501 | "Dereference REF, returning the referenced value. | 512 | "Dereference REF, returning the referenced value. |
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 42c5b20a7b8..29a6dc63a68 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; gud.el --- Grand Unified Debugger mode for running GDB and other debuggers | 1 | ;;; gud.el --- Grand Unified Debugger mode for running GDB and other debuggers -*- lexical-binding:t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1992-1996, 1998, 2000-2015 Free Software Foundation, | 3 | ;; Copyright (C) 1992-1996, 1998, 2000-2015 Free Software Foundation, |
| 4 | ;; Inc. | 4 | ;; Inc. |