From 3c98c9629581c4bfcaaa5e3bb21ec543286751a7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 13 Aug 2012 17:23:09 -0400 Subject: [PATCH] * lisp/subr.el (function-get): Refine `autoload' arg so it can also autoload functions for gv.el. * lisp/emacs-lisp/edebug.el (get-edebug-spec): Adjust so it only autoloads macros. Fixes: debbugs:12191 --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/edebug.el | 2 +- lisp/subr.el | 10 +++++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2cbf94c0ee7..6ccbb69a919 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2012-08-13 Stefan Monnier + * subr.el (function-get): Refine `autoload' arg so it can also + autoload functions for gv.el (bug#12191). + * emacs-lisp/edebug.el (get-edebug-spec): Adjust so it only + autoloads macros. + * color.el (color-xyz-to-lab, color-lab-to-xyz, color-cie-de2000): Prefer pcase-let over destructuring-bind. * vc/diff-mode.el (diff-remove-trailing-whitespace): Same. diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index bbf0757c3bc..910d9403753 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -248,7 +248,7 @@ If the result is non-nil, then break. Errors are ignored." (progn (and (symbolp indirect) (setq indirect - (function-get indirect 'edebug-form-spec 'autoload)))) + (function-get indirect 'edebug-form-spec 'macro)))) ;; (edebug-trace "indirection: %s" edebug-form-spec) (setq edebug-form-spec indirect)) edebug-form-spec diff --git a/lisp/subr.el b/lisp/subr.el index 6b64bbc2f4d..212632ff779 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2785,15 +2785,19 @@ form." (defun function-get (f prop &optional autoload) "Return the value of property PROP of function F. -If AUTOLOAD is non-nil and F is an autoloaded macro, try to autoload -the macro in the hope that it will set PROP." +If AUTOLOAD is non-nil and F is autoloaded, try to autoload it +in the hope that it will set PROP. If AUTOLOAD is `macro', only do it +if it's an autoloaded macro." (let ((val nil)) (while (and (symbolp f) (null (setq val (get f prop))) (fboundp f)) (let ((fundef (symbol-function f))) (if (and autoload (autoloadp fundef) - (not (equal fundef (autoload-do-load fundef f 'macro)))) + (not (equal fundef + (autoload-do-load fundef f + (if (eq autoload 'macro) + 'macro))))) nil ;Re-try `get' on the same `f'. (setq f fundef)))) val)) -- 2.39.2