aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2010-12-27 12:55:38 -0500
committerStefan Monnier2010-12-27 12:55:38 -0500
commit590130fb19e1f433965c421d98fedeb2d7c33310 (patch)
treeed68c41e9255c9b6bda9e4a9f777e6af759d736c
parenta0ee6f2751acba71df443d4d795bb350eb6421dd (diff)
downloademacs-590130fb19e1f433965c421d98fedeb2d7c33310.tar.gz
emacs-590130fb19e1f433965c421d98fedeb2d7c33310.zip
* src/eval.c (Fdefvar): Record specialness before computing initial value.
* lisp/emacs-lisp/bytecomp.el (byte-compile-track-mouse): Don't use #'.
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/emacs-lisp/bytecomp.el18
-rw-r--r--src/ChangeLog4
-rw-r--r--src/eval.c7
4 files changed, 28 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 87794ceb5d2..7e3982a5a70 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12010-12-27 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * emacs-lisp/bytecomp.el (byte-compile-track-mouse): Don't use #'.
4
12010-12-15 Stefan Monnier <monnier@iro.umontreal.ca> 52010-12-15 Stefan Monnier <monnier@iro.umontreal.ca>
2 6
3 * emacs-lisp/edebug.el (edebug-eval-defun, edebug-eval): 7 * emacs-lisp/edebug.el (edebug-eval-defun, edebug-eval):
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 0f7018b9b64..82b5ed3367d 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -441,6 +441,7 @@ specify different fields to sort on."
441 441
442;(defvar byte-compile-debug nil) 442;(defvar byte-compile-debug nil)
443(defvar byte-compile-debug t) 443(defvar byte-compile-debug t)
444(setq debug-on-error t)
444 445
445;; (defvar byte-compile-overwrite-file t 446;; (defvar byte-compile-overwrite-file t
446;; "If nil, old .elc files are deleted before the new is saved, and .elc 447;; "If nil, old .elc files are deleted before the new is saved, and .elc
@@ -4084,8 +4085,21 @@ if LFORMINFO is nil (meaning all bindings are dynamic)."
4084 4085
4085(defun byte-compile-track-mouse (form) 4086(defun byte-compile-track-mouse (form)
4086 (byte-compile-form 4087 (byte-compile-form
4087 `(funcall #'(lambda nil 4088 ;; Use quote rather that #' here, because we don't want to go
4088 (track-mouse ,@(byte-compile-top-level-body (cdr form))))))) 4089 ;; through the body again, which would lead to an infinite recursion:
4090 ;; "byte-compile-track-mouse" (0xbffc98e4)
4091 ;; "byte-compile-form" (0xbffc9c54)
4092 ;; "byte-compile-top-level" (0xbffc9fd4)
4093 ;; "byte-compile-lambda" (0xbffca364)
4094 ;; "byte-compile-closure" (0xbffca6d4)
4095 ;; "byte-compile-function-form" (0xbffcaa44)
4096 ;; "byte-compile-form" (0xbffcadc0)
4097 ;; "mapc" (0xbffcaf74)
4098 ;; "byte-compile-funcall" (0xbffcb2e4)
4099 ;; "byte-compile-form" (0xbffcb654)
4100 ;; "byte-compile-track-mouse" (0xbffcb9d4)
4101 `(funcall '(lambda nil
4102 (track-mouse ,@(byte-compile-top-level-body (cdr form)))))))
4089 4103
4090(defun byte-compile-condition-case (form) 4104(defun byte-compile-condition-case (form)
4091 (let* ((var (nth 1 form)) 4105 (let* ((var (nth 1 form))
diff --git a/src/ChangeLog b/src/ChangeLog
index 2de6a5ed66c..f7a3fcc8b1b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12010-12-27 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * eval.c (Fdefvar): Record specialness before computing initial value.
4
12010-12-15 Stefan Monnier <monnier@iro.umontreal.ca> 52010-12-15 Stefan Monnier <monnier@iro.umontreal.ca>
2 6
3 * eval.c (Feval): Add `lexical' argument. Adjust callers. 7 * eval.c (Feval): Add `lexical' argument. Adjust callers.
diff --git a/src/eval.c b/src/eval.c
index 7104a8a8396..36acca01c8b 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -855,6 +855,10 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
855 tem = Fdefault_boundp (sym); 855 tem = Fdefault_boundp (sym);
856 if (!NILP (tail)) 856 if (!NILP (tail))
857 { 857 {
858 if (SYMBOLP (sym))
859 /* Do it before evaluating the initial value, for self-references. */
860 XSYMBOL (sym)->declared_special = 1;
861
858 if (SYMBOL_CONSTANT_P (sym)) 862 if (SYMBOL_CONSTANT_P (sym))
859 { 863 {
860 /* For upward compatibility, allow (defvar :foo (quote :foo)). */ 864 /* For upward compatibility, allow (defvar :foo (quote :foo)). */
@@ -893,9 +897,6 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING) */)
893 Fput (sym, Qvariable_documentation, tem); 897 Fput (sym, Qvariable_documentation, tem);
894 } 898 }
895 LOADHIST_ATTACH (sym); 899 LOADHIST_ATTACH (sym);
896
897 if (SYMBOLP (sym))
898 XSYMBOL (sym)->declared_special = 1;
899 } 900 }
900 else if (!NILP (Vinternal_interpreter_environment) 901 else if (!NILP (Vinternal_interpreter_environment)
901 && !XSYMBOL (sym)->declared_special) 902 && !XSYMBOL (sym)->declared_special)