Commit dc1e0ac7 authored by Tino Calancha's avatar Tino Calancha Committed by Eli Zaretskii
Browse files

Run find-function-after-hook after finding a symbol

* lisp/emacs-lisp/find-func.el (find-library):
* lisp/help-mode.el (help-function-def, help-variable-def):
Run `find-function-after-hook' inside the help-function of the
buttons (bug#22583).
* etc/NEWS: Mention the change.

This is a backport from master.
(cherry picked from commit f069d854)
parent 0ae9a816
...@@ -17,7 +17,10 @@ with a prefix argument or by typing C-u C-h C-n. ...@@ -17,7 +17,10 @@ with a prefix argument or by typing C-u C-h C-n.
* Changes in Emacs 25.2 * Changes in Emacs 25.2
This is a bug-fix release with no new features. This is a bug-fix release with (almost) no new features.
** `find-library', `help-function-def' and `help-variable-def' now run
`find-function-after-hook'.
* Installation Changes in Emacs 25.1 * Installation Changes in Emacs 25.1
......
...@@ -283,7 +283,11 @@ LIBRARY should be a string (the name of the library)." ...@@ -283,7 +283,11 @@ LIBRARY should be a string (the name of the library)."
"Library name: ") "Library name: ")
table nil nil nil nil def)))) table nil nil nil nil def))))
(let ((buf (find-file-noselect (find-library-name library)))) (let ((buf (find-file-noselect (find-library-name library))))
(condition-case nil (switch-to-buffer buf) (error (pop-to-buffer buf))))) (condition-case nil
(prog1
(switch-to-buffer buf)
(run-hooks 'find-function-after-hook))
(error (pop-to-buffer buf)))))
;;;###autoload ;;;###autoload
(defun find-function-search-for-symbol (symbol type library) (defun find-function-search-for-symbol (symbol type library)
......
...@@ -202,6 +202,7 @@ The format is (FUNCTION ARGS...).") ...@@ -202,6 +202,7 @@ The format is (FUNCTION ARGS...).")
(let ((location (let ((location
(find-function-search-for-symbol fun type file))) (find-function-search-for-symbol fun type file)))
(pop-to-buffer (car location)) (pop-to-buffer (car location))
(run-hooks 'find-function-after-hook)
(if (cdr location) (if (cdr location)
(goto-char (cdr location)) (goto-char (cdr location))
(message "Unable to find location in file")))) (message "Unable to find location in file"))))
...@@ -231,6 +232,7 @@ The format is (FUNCTION ARGS...).") ...@@ -231,6 +232,7 @@ The format is (FUNCTION ARGS...).")
(setq file (help-C-file-name var 'var))) (setq file (help-C-file-name var 'var)))
(let ((location (find-variable-noselect var file))) (let ((location (find-variable-noselect var file)))
(pop-to-buffer (car location)) (pop-to-buffer (car location))
(run-hooks 'find-function-after-hook)
(if (cdr location) (if (cdr location)
(goto-char (cdr location)) (goto-char (cdr location))
(message "Unable to find location in file")))) (message "Unable to find location in file"))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment