]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/byte-run.el (defun-declarations-alist): Fix compiler-macro
authorStefan Monnier <monnier@iro.umontreal.ca>
Mon, 3 Nov 2014 22:48:30 +0000 (17:48 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Mon, 3 Nov 2014 22:48:30 +0000 (17:48 -0500)
autoloading when specified as a lambda.
* lisp/emacs-lisp/edebug.el (edebug-safe-prin1-to-string): Assume that
edebug-prin1-to-string already handles circularity.

lisp/ChangeLog
lisp/emacs-lisp/byte-run.el
lisp/emacs-lisp/edebug.el

index e6d74f48b786253ad209449c9e7311a82d9ef2cc..445cef9c8c9e204c6a44e9f552779191eb9eedc9 100644 (file)
@@ -1,5 +1,11 @@
 2014-11-03  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * emacs-lisp/edebug.el (edebug-safe-prin1-to-string): Assume that
+       edebug-prin1-to-string already handles circularity.
+
+       * emacs-lisp/byte-run.el (defun-declarations-alist): Fix compiler-macro
+       autoloading when specified as a lambda.
+
        * simple.el (execute-extended-command--last-typed): New var.
        (read-extended-command): Set it.
        Don't complete obsolete commands.
index 0edcf6197b4e72613b3ae8333deaa36d59edbc53..97768fa7e1a9f2723cff819e01024f9e24970a63 100644 (file)
@@ -112,12 +112,21 @@ This may shift errors from run-time to compile-time.")
 If `error-free', drop calls even if `byte-compile-delete-errors' is nil.")
    (list 'compiler-macro
          #'(lambda (f args compiler-function)
-             `(eval-and-compile
-                (function-put ',f 'compiler-macro
-                              ,(if (eq (car-safe compiler-function) 'lambda)
-                                   `(lambda ,(append (cadr compiler-function) args)
-                                      ,@(cddr compiler-function))
-                                 `#',compiler-function)))))
+             (if (not (eq (car-safe compiler-function) 'lambda))
+                 `(eval-and-compile
+                    (function-put ',f 'compiler-macro #',compiler-function))
+               (let ((cfname (intern (concat (symbol-name f)
+                                             "--anon-compiler-macro"))))
+                 `(progn
+                    (eval-and-compile
+                      (function-put ',f 'compiler-macro #',cfname))
+                    ;; Don't autoload the compiler-macro itself, since the
+                    ;; macroexpander will find this file via `f's autoload,
+                    ;; if needed.
+                    :autoload-end
+                    (eval-and-compile
+                      (defun ,cfname (,@(cadr compiler-function) ,@args)
+                        ,@(cddr compiler-function))))))))
    (list 'doc-string
          #'(lambda (f _args pos)
              (list 'function-put (list 'quote f)
index 785050896b87f520bebe24b28b6eaab36be4e067..473edb4bc61e3bdfaec5f03e15a6cc7ed9323641 100644 (file)
@@ -3373,9 +3373,7 @@ Return the result of the last expression."
        (print-level (or edebug-print-level print-level))
        (print-circle (or edebug-print-circle print-circle))
        (print-readably nil)) ; lemacs uses this.
-    (condition-case nil
-       (edebug-prin1-to-string value)
-      (error "#Apparently circular structure#"))))
+    (edebug-prin1-to-string value)))
 
 (defun edebug-compute-previous-result (previous-value)
   (if edebug-unwrap-results