* 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
+2014-02-02 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * help-fns.el (help-C-file-name): Handle advised functions (bug#16478).
+ * emacs-lisp/find-func.el (find-function-C-source): Idem.
+ * emacs-lisp/nadvice.el (advice--cd*r): New function.
+ * help-fns.el (describe-function-1): Use it.
+
2014-02-02 Glenn Morris <rgm@gnu.org>
* register.el (register-preview-default): New function,
(ruby-smie-grammar): Make "." right-associative. Make its priority
lower than the ternary and all binary operators.
(ruby-smie-rules): Indent "(" relative to the first non-"."
- parent, or the first "." parent at indentation. Use
- `ruby-align-chained-calls' for indentation of "." tokens.
+ parent, or the first "." parent at indentation.
+ Use `ruby-align-chained-calls' for indentation of "." tokens.
(Bug#16593)
2014-01-31 Juri Linkov <juri@jurta.org>
(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))
(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))
(let ((docbuf (get-buffer-create " *DOC*"))
(name (if (eq 'var kind)
(concat "V" (symbol-name subr-or-var))
- (concat "F" (subr-name subr-or-var)))))
+ (concat "F" (subr-name (advice--cd*r subr-or-var))))))
(with-current-buffer docbuf
(goto-char (point-min))
(if (eobp)
;; real definition, if that symbol is already set up.
(real-function
(or (and advised
- (let* ((advised-fn (advice--cdr
- (advice--symbol-function function))))
- (while (advice--p advised-fn)
- (setq advised-fn (advice--cdr advised-fn)))
- advised-fn))
+ (advice--cd*r (advice--symbol-function function)))
function))
;; Get the real definition.
(def (if (symbolp real-function)
(or doc "Not documented.")))))))
;; Add defaults to `help-fns-describe-function-functions'.
-(add-hook 'help-fns-describe-function-functions 'help-fns--obsolete)
-(add-hook 'help-fns-describe-function-functions 'help-fns--parent-mode)
-(add-hook 'help-fns-describe-function-functions 'help-fns--compiler-macro)
+(add-hook 'help-fns-describe-function-functions #'help-fns--obsolete)
+(add-hook 'help-fns-describe-function-functions #'help-fns--parent-mode)
+(add-hook 'help-fns-describe-function-functions #'help-fns--compiler-macro)
\f
;; Variables