* lisp/emacs-lisp/byte-run.el (defun-declarations-alist): Fix compiler-macro

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.
This commit is contained in:
Stefan Monnier 2014-11-03 17:48:30 -05:00
parent 772a965c5f
commit 50deba142a
3 changed files with 22 additions and 9 deletions

View 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)