* lisp/help-fns.el (help-C-file-name): Handle advised functions.

* lisp/emacs-lisp/find-func.el (find-function-C-source): Idem.
* lisp/emacs-lisp/nadvice.el (advice--cd*r): New function.
* help-fns.el (describe-function-1): Use it.

Fixes: debbugs:16478
This commit is contained in:
Stefan Monnier 2014-02-01 21:25:05 -05:00
parent 65bc4bb587
commit 70e5a261ac
4 changed files with 20 additions and 12 deletions

View file

@ -219,7 +219,7 @@ TYPE should be nil to find a function, or `defvar' to find a variable."
(regexp-quote (symbol-name fun-or-var))
"\"")
(concat "DEFUN[ \t\n]*([ \t\n]*\""
(regexp-quote (subr-name fun-or-var))
(regexp-quote (subr-name (advice--cd*r fun-or-var)))
"\""))
nil t)
(error "Can't find source for %s" fun-or-var))

View file

@ -67,6 +67,11 @@ Each element has the form (WHERE BYTECODE STACK) where:
(defsubst advice--cdr (f) (aref (aref f 2) 2))
(defsubst advice--props (f) (aref (aref f 2) 3))
(defun advice--cd*r (f)
(while (advice--p f)
(setq f (advice--cdr f)))
f)
(defun advice--make-docstring (function)
"Build the raw docstring for FUNCTION, presumably advised."
(let ((flist (indirect-function function))