* src/eval.c (Fdefvar): Record specialness before computing initial value.
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 27 Dec 2010 17:55:38 +0000 (12:55 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 27 Dec 2010 17:55:38 +0000 (12:55 -0500)
* lisp/emacs-lisp/bytecomp.el (byte-compile-track-mouse): Don't use #'.

lisp/ChangeLog
lisp/emacs-lisp/bytecomp.el
src/ChangeLog
src/eval.c

index 87794ce..7e3982a 100644 (file)
@@ -1,3 +1,7 @@
+2010-12-27  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/bytecomp.el (byte-compile-track-mouse): Don't use #'.
+
 2010-12-15  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/edebug.el (edebug-eval-defun, edebug-eval):
index 0f7018b..82b5ed3 100644 (file)
@@ -441,6 +441,7 @@ specify different fields to sort on."
 
 ;(defvar byte-compile-debug nil)
 (defvar byte-compile-debug t)
+(setq debug-on-error t)
 
 ;; (defvar byte-compile-overwrite-file t
 ;;   "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)."
 
 (defun byte-compile-track-mouse (form)
   (byte-compile-form
-   `(funcall #'(lambda nil
-                 (track-mouse ,@(byte-compile-top-level-body (cdr form)))))))
+   ;; Use quote rather that #' here, because we don't want to go
+   ;; through the body again, which would lead to an infinite recursion:
+   ;; "byte-compile-track-mouse" (0xbffc98e4)
+   ;; "byte-compile-form" (0xbffc9c54)
+   ;; "byte-compile-top-level" (0xbffc9fd4)
+   ;; "byte-compile-lambda" (0xbffca364)
+   ;; "byte-compile-closure" (0xbffca6d4)
+   ;; "byte-compile-function-form" (0xbffcaa44)
+   ;; "byte-compile-form" (0xbffcadc0)
+   ;; "mapc" (0xbffcaf74)
+   ;; "byte-compile-funcall" (0xbffcb2e4)
+   ;; "byte-compile-form" (0xbffcb654)
+   ;; "byte-compile-track-mouse" (0xbffcb9d4)
+   `(funcall '(lambda nil
+               (track-mouse ,@(byte-compile-top-level-body (cdr form)))))))
 
 (defun byte-compile-condition-case (form)
   (let* ((var (nth 1 form))
index 2de6a5e..f7a3fcc 100644 (file)
@@ -1,3 +1,7 @@
+2010-12-27  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * eval.c (Fdefvar): Record specialness before computing initial value.
+
 2010-12-15  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * eval.c (Feval): Add `lexical' argument.  Adjust callers.
index 7104a8a..36acca0 100644 (file)
@@ -855,6 +855,10 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING)  */)
   tem = Fdefault_boundp (sym);
   if (!NILP (tail))
     {
+      if (SYMBOLP (sym))
+       /* Do it before evaluating the initial value, for self-references.  */
+       XSYMBOL (sym)->declared_special = 1;
+
       if (SYMBOL_CONSTANT_P (sym))
        {
          /* For upward compatibility, allow (defvar :foo (quote :foo)).  */
@@ -893,9 +897,6 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING)  */)
          Fput (sym, Qvariable_documentation, tem);
        }
       LOADHIST_ATTACH (sym);
-
-      if (SYMBOLP (sym))
-       XSYMBOL (sym)->declared_special = 1;
     }
   else if (!NILP (Vinternal_interpreter_environment)
           && !XSYMBOL (sym)->declared_special)