aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2012-08-13 17:23:09 -0400
committerStefan Monnier2012-08-13 17:23:09 -0400
commit3c98c9629581c4bfcaaa5e3bb21ec543286751a7 (patch)
treec5b0be468d7b8901d0045e89e7f5b43f399d3a6b
parentca06f160f428224a98cbd6e3ea0dac89b99119ef (diff)
downloademacs-3c98c9629581c4bfcaaa5e3bb21ec543286751a7.tar.gz
emacs-3c98c9629581c4bfcaaa5e3bb21ec543286751a7.zip
* 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
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/emacs-lisp/edebug.el2
-rw-r--r--lisp/subr.el10
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 @@
12012-08-13 Stefan Monnier <monnier@iro.umontreal.ca> 12012-08-13 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * subr.el (function-get): Refine `autoload' arg so it can also
4 autoload functions for gv.el (bug#12191).
5 * emacs-lisp/edebug.el (get-edebug-spec): Adjust so it only
6 autoloads macros.
7
3 * color.el (color-xyz-to-lab, color-lab-to-xyz, color-cie-de2000): 8 * color.el (color-xyz-to-lab, color-lab-to-xyz, color-cie-de2000):
4 Prefer pcase-let over destructuring-bind. 9 Prefer pcase-let over destructuring-bind.
5 * vc/diff-mode.el (diff-remove-trailing-whitespace): Same. 10 * 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."
248 (progn 248 (progn
249 (and (symbolp indirect) 249 (and (symbolp indirect)
250 (setq indirect 250 (setq indirect
251 (function-get indirect 'edebug-form-spec 'autoload)))) 251 (function-get indirect 'edebug-form-spec 'macro))))
252 ;; (edebug-trace "indirection: %s" edebug-form-spec) 252 ;; (edebug-trace "indirection: %s" edebug-form-spec)
253 (setq edebug-form-spec indirect)) 253 (setq edebug-form-spec indirect))
254 edebug-form-spec 254 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."
2785 2785
2786(defun function-get (f prop &optional autoload) 2786(defun function-get (f prop &optional autoload)
2787 "Return the value of property PROP of function F. 2787 "Return the value of property PROP of function F.
2788If AUTOLOAD is non-nil and F is an autoloaded macro, try to autoload 2788If AUTOLOAD is non-nil and F is autoloaded, try to autoload it
2789the macro in the hope that it will set PROP." 2789in the hope that it will set PROP. If AUTOLOAD is `macro', only do it
2790if it's an autoloaded macro."
2790 (let ((val nil)) 2791 (let ((val nil))
2791 (while (and (symbolp f) 2792 (while (and (symbolp f)
2792 (null (setq val (get f prop))) 2793 (null (setq val (get f prop)))
2793 (fboundp f)) 2794 (fboundp f))
2794 (let ((fundef (symbol-function f))) 2795 (let ((fundef (symbol-function f)))
2795 (if (and autoload (autoloadp fundef) 2796 (if (and autoload (autoloadp fundef)
2796 (not (equal fundef (autoload-do-load fundef f 'macro)))) 2797 (not (equal fundef
2798 (autoload-do-load fundef f
2799 (if (eq autoload 'macro)
2800 'macro)))))
2797 nil ;Re-try `get' on the same `f'. 2801 nil ;Re-try `get' on the same `f'.
2798 (setq f fundef)))) 2802 (setq f fundef))))
2799 val)) 2803 val))