diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-07-25 21:27:33 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-07-25 21:27:33 -0400 |
commit | 7abaf5ccc9f11e657b6671e7a6d5a7533bba5f31 (patch) | |
tree | 26a250aef4c762d2128fb99c7442d01cedbd208b /lisp/emacs-lisp/macroexp.el | |
parent | b1364986cb927ca113b0447a66a5274221ad9100 (diff) | |
download | emacs-7abaf5ccc9f11e657b6671e7a6d5a7533bba5f31.tar.gz |
Autoload more carefully from Lisp. Follow aliases for function properties.
* lisp/subr.el (autoloadp): New function.
(symbol-file): Use it.
(function-get): New function.
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Use function-get and
autoload-do-load.
* lisp/emacs-lisp/lisp-mode.el (lisp-font-lock-syntactic-face-function)
(lisp-indent-function):
* lisp/emacs-lisp/gv.el (gv-get):
* lisp/emacs-lisp/edebug.el (get-edebug-spec, edebug-basic-spec):
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form):
* lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-warn):
* lisp/emacs-lisp/autoload.el (make-autoload, autoload-print-form):
Use function-get.
* lisp/emacs-lisp/cl.el: Don't propagate function properties any more.
* src/eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
add argument, tune behavior, and adjust all callers.
* lisp/speedbar.el (speedbar-add-localized-speedbar-support):
* lisp/emacs-lisp/disass.el (disassemble-internal):
* lisp/desktop.el (desktop-load-file):
* lisp/help-fns.el (help-function-arglist, find-lisp-object-file-name)
(describe-function-1):
* lisp/emacs-lisp/find-func.el (find-function-noselect):
* lisp/emacs-lisp/elp.el (elp-instrument-function):
* lisp/emacs-lisp/advice.el (ad-has-proper-definition):
* lisp/apropos.el (apropos-safe-documentation, apropos-macrop):
* lisp/emacs-lisp/debug.el (debug-on-entry):
* lisp/emacs-lisp/cl-macs.el (cl-compiler-macroexpand):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand):
* lisp/calc/calc.el (name): Use autoloadp & autoload-do-load.
Diffstat (limited to 'lisp/emacs-lisp/macroexp.el')
-rw-r--r-- | lisp/emacs-lisp/macroexp.el | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 65a72aa5312..70eab149837 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -185,12 +185,7 @@ Assumes the caller has bound `macroexpand-all-environment'." ;; Macro expand compiler macros. This cannot be delayed to ;; byte-optimize-form because the output of the compiler-macro can ;; use macros. - (let ((handler nil)) - (while (and (symbolp func) - (not (setq handler (get func 'compiler-macro))) - (fboundp func)) - ;; Follow the sequence of aliases. - (setq func (symbol-function func))) + (let ((handler (function-get func 'compiler-macro))) (if (null handler) ;; No compiler macro. We just expand each argument (for ;; setq/setq-default this works alright because the variable names @@ -198,12 +193,9 @@ Assumes the caller has bound `macroexpand-all-environment'." (macroexp--all-forms form 1) ;; If the handler is not loaded yet, try (auto)loading the ;; function itself, which may in turn load the handler. - (when (and (not (functionp handler)) - (fboundp func) (eq (car-safe (symbol-function func)) - 'autoload)) + (unless (functionp handler) (ignore-errors - (load (nth 1 (symbol-function func)) - 'noerror 'nomsg))) + (autoload-do-load (indirect-function func) func))) (let ((newform (macroexp--compiler-macro handler form))) (if (eq form newform) ;; The compiler macro did not find anything to do. |