From 5046ef67ca8b5a2eab769b4a6e486ae060b5df13 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sat, 13 Oct 2012 21:39:56 -0400 Subject: [PATCH] * lisp/emacs-lisp/gv.el (if): Don't use closures in non-lexical-binding code. --- lisp/ChangeLog | 4 ++++ lisp/emacs-lisp/gv.el | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d58eb0bfbbf..6c9fe7c4b47 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-10-14 Stefan Monnier + + * emacs-lisp/gv.el (if): Don't use closures in non-lexical-binding code. + 2012-10-13 Chong Yidong * textmodes/ispell.el (ispell-pdict-save): If flyspell-mode is diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 7858c183e4b..1a30d67fbbc 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -358,7 +358,8 @@ The return value is the last VAL in the list. (put 'if 'gv-expander (lambda (do test then &rest else) - (if (macroexp-small-p (funcall do 'dummy (lambda (_) 'dummy))) + (if (or (not lexical-binding) ;The other code requires lexical-binding. + (macroexp-small-p (funcall do 'dummy (lambda (_) 'dummy)))) ;; This duplicates the `do' code, which is a problem if that ;; code is large, but otherwise results in more efficient code. `(if ,test ,(gv-get then do) -- 2.39.2