diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-06-14 23:18:14 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-06-14 23:18:14 -0400 |
commit | f38ea36d3d9415aeaf895ea7b439c41ee441c500 (patch) | |
tree | 3dfb3b74fea3209bc021999edf7f75dbfa1ae3d0 /lisp/emacs-lisp/macroexp.el | |
parent | 2d7b84eab6a10752713af889f291c046eed33677 (diff) | |
download | emacs-f38ea36d3d9415aeaf895ea7b439c41ee441c500.tar.gz |
* lisp/emacs-lisp/cl-lib.el (cl--defsubst-expand): Autoload inliner.
* lisp/emacs-lisp/macroexp.el (macroexp--compiler-macro): New function.
(macroexp--expand-all): Use it.
Fixes: debbugs:11649
Diffstat (limited to 'lisp/emacs-lisp/macroexp.el')
-rw-r--r-- | lisp/emacs-lisp/macroexp.el | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 8effb3c8e31..85e9b073158 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -94,6 +94,12 @@ each clause." (macroexp--all-forms clause skip) clause))) +(defun macroexp--compiler-macro (handler form) + (condition-case err + (apply handler form (cdr form)) + (error (message "Compiler-macro error for %S: %S" (car form) err) + form)))) + (defun macroexp--expand-all (form) "Expand all macros in FORM. This is an internal version of `macroexpand-all'. @@ -198,20 +204,14 @@ Assumes the caller has bound `macroexpand-all-environment'." (ignore-errors (load (nth 1 (symbol-function func)) 'noerror 'nomsg))) - (let ((newform (condition-case err - (apply handler form (cdr form)) - (error (message "Compiler-macro error: %S" err) - form)))) + (let ((newform (macroexp--compiler-macro handler form))) (if (eq form newform) ;; The compiler macro did not find anything to do. (if (equal form (setq newform (macroexp--all-forms form 1))) form ;; Maybe after processing the args, some new opportunities ;; appeared, so let's try the compiler macro again. - (setq form (condition-case err - (apply handler newform (cdr newform)) - (error (message "Compiler-macro error: %S" err) - newform))) + (setq form (macroexp--compiler-macro handler newform)) (if (eq newform form) newform (macroexp--expand-all newform))) |