diff options
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/emacs-lisp/find-func.el | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/nadvice.el | 5 | ||||
| -rw-r--r-- | lisp/help-fns.el | 14 |
4 files changed, 20 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 11952ba98ee..6471005cf8d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2014-02-02 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * help-fns.el (help-C-file-name): Handle advised functions (bug#16478). | ||
| 4 | * emacs-lisp/find-func.el (find-function-C-source): Idem. | ||
| 5 | * emacs-lisp/nadvice.el (advice--cd*r): New function. | ||
| 6 | * help-fns.el (describe-function-1): Use it. | ||
| 7 | |||
| 1 | 2014-02-02 Glenn Morris <rgm@gnu.org> | 8 | 2014-02-02 Glenn Morris <rgm@gnu.org> |
| 2 | 9 | ||
| 3 | * register.el (register-preview-default): New function, | 10 | * register.el (register-preview-default): New function, |
| @@ -35,8 +42,8 @@ | |||
| 35 | (ruby-smie-grammar): Make "." right-associative. Make its priority | 42 | (ruby-smie-grammar): Make "." right-associative. Make its priority |
| 36 | lower than the ternary and all binary operators. | 43 | lower than the ternary and all binary operators. |
| 37 | (ruby-smie-rules): Indent "(" relative to the first non-"." | 44 | (ruby-smie-rules): Indent "(" relative to the first non-"." |
| 38 | parent, or the first "." parent at indentation. Use | 45 | parent, or the first "." parent at indentation. |
| 39 | `ruby-align-chained-calls' for indentation of "." tokens. | 46 | Use `ruby-align-chained-calls' for indentation of "." tokens. |
| 40 | (Bug#16593) | 47 | (Bug#16593) |
| 41 | 48 | ||
| 42 | 2014-01-31 Juri Linkov <juri@jurta.org> | 49 | 2014-01-31 Juri Linkov <juri@jurta.org> |
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 31e9be81034..5c404ce0468 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el | |||
| @@ -219,7 +219,7 @@ TYPE should be nil to find a function, or `defvar' to find a variable." | |||
| 219 | (regexp-quote (symbol-name fun-or-var)) | 219 | (regexp-quote (symbol-name fun-or-var)) |
| 220 | "\"") | 220 | "\"") |
| 221 | (concat "DEFUN[ \t\n]*([ \t\n]*\"" | 221 | (concat "DEFUN[ \t\n]*([ \t\n]*\"" |
| 222 | (regexp-quote (subr-name fun-or-var)) | 222 | (regexp-quote (subr-name (advice--cd*r fun-or-var))) |
| 223 | "\"")) | 223 | "\"")) |
| 224 | nil t) | 224 | nil t) |
| 225 | (error "Can't find source for %s" fun-or-var)) | 225 | (error "Can't find source for %s" fun-or-var)) |
diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el index 3dfeb04a9b3..8dc1f19784c 100644 --- a/lisp/emacs-lisp/nadvice.el +++ b/lisp/emacs-lisp/nadvice.el | |||
| @@ -67,6 +67,11 @@ Each element has the form (WHERE BYTECODE STACK) where: | |||
| 67 | (defsubst advice--cdr (f) (aref (aref f 2) 2)) | 67 | (defsubst advice--cdr (f) (aref (aref f 2) 2)) |
| 68 | (defsubst advice--props (f) (aref (aref f 2) 3)) | 68 | (defsubst advice--props (f) (aref (aref f 2) 3)) |
| 69 | 69 | ||
| 70 | (defun advice--cd*r (f) | ||
| 71 | (while (advice--p f) | ||
| 72 | (setq f (advice--cdr f))) | ||
| 73 | f) | ||
| 74 | |||
| 70 | (defun advice--make-docstring (function) | 75 | (defun advice--make-docstring (function) |
| 71 | "Build the raw docstring for FUNCTION, presumably advised." | 76 | "Build the raw docstring for FUNCTION, presumably advised." |
| 72 | (let ((flist (indirect-function function)) | 77 | (let ((flist (indirect-function function)) |
diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 2252c700fea..5e38de88f72 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el | |||
| @@ -187,7 +187,7 @@ KIND should be `var' for a variable or `subr' for a subroutine." | |||
| 187 | (let ((docbuf (get-buffer-create " *DOC*")) | 187 | (let ((docbuf (get-buffer-create " *DOC*")) |
| 188 | (name (if (eq 'var kind) | 188 | (name (if (eq 'var kind) |
| 189 | (concat "V" (symbol-name subr-or-var)) | 189 | (concat "V" (symbol-name subr-or-var)) |
| 190 | (concat "F" (subr-name subr-or-var))))) | 190 | (concat "F" (subr-name (advice--cd*r subr-or-var)))))) |
| 191 | (with-current-buffer docbuf | 191 | (with-current-buffer docbuf |
| 192 | (goto-char (point-min)) | 192 | (goto-char (point-min)) |
| 193 | (if (eobp) | 193 | (if (eobp) |
| @@ -542,11 +542,7 @@ FILE is the file where FUNCTION was probably defined." | |||
| 542 | ;; real definition, if that symbol is already set up. | 542 | ;; real definition, if that symbol is already set up. |
| 543 | (real-function | 543 | (real-function |
| 544 | (or (and advised | 544 | (or (and advised |
| 545 | (let* ((advised-fn (advice--cdr | 545 | (advice--cd*r (advice--symbol-function function))) |
| 546 | (advice--symbol-function function)))) | ||
| 547 | (while (advice--p advised-fn) | ||
| 548 | (setq advised-fn (advice--cdr advised-fn))) | ||
| 549 | advised-fn)) | ||
| 550 | function)) | 546 | function)) |
| 551 | ;; Get the real definition. | 547 | ;; Get the real definition. |
| 552 | (def (if (symbolp real-function) | 548 | (def (if (symbolp real-function) |
| @@ -660,9 +656,9 @@ FILE is the file where FUNCTION was probably defined." | |||
| 660 | (or doc "Not documented."))))))) | 656 | (or doc "Not documented."))))))) |
| 661 | 657 | ||
| 662 | ;; Add defaults to `help-fns-describe-function-functions'. | 658 | ;; Add defaults to `help-fns-describe-function-functions'. |
| 663 | (add-hook 'help-fns-describe-function-functions 'help-fns--obsolete) | 659 | (add-hook 'help-fns-describe-function-functions #'help-fns--obsolete) |
| 664 | (add-hook 'help-fns-describe-function-functions 'help-fns--parent-mode) | 660 | (add-hook 'help-fns-describe-function-functions #'help-fns--parent-mode) |
| 665 | (add-hook 'help-fns-describe-function-functions 'help-fns--compiler-macro) | 661 | (add-hook 'help-fns-describe-function-functions #'help-fns--compiler-macro) |
| 666 | 662 | ||
| 667 | 663 | ||
| 668 | ;; Variables | 664 | ;; Variables |