aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTino Calancha2016-04-25 19:27:06 +0200
committerEli Zaretskii2016-09-23 16:36:24 +0300
commitdc1e0ac761725931f23de13df4ef5020372a52a0 (patch)
tree7d43fe38a26118834a6d54ba836b9fe3519895f1
parent0ae9a816b9f68bd3f50fc287a342237c8b4fe78d (diff)
downloademacs-dc1e0ac761725931f23de13df4ef5020372a52a0.tar.gz
emacs-dc1e0ac761725931f23de13df4ef5020372a52a0.zip
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 f069d854508946bcc03e4c77ceb430748e3ab6d7)
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/emacs-lisp/find-func.el6
-rw-r--r--lisp/help-mode.el2
3 files changed, 11 insertions, 2 deletions
diff --git a/etc/NEWS b/etc/NEWS
index e86aec26d26..a61370bfee0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -17,7 +17,10 @@ with a prefix argument or by typing C-u C-h C-n.
17 17
18 18
19* Changes in Emacs 25.2 19* Changes in Emacs 25.2
20This is a bug-fix release with no new features. 20This is a bug-fix release with (almost) no new features.
21
22** `find-library', `help-function-def' and `help-variable-def' now run
23`find-function-after-hook'.
21 24
22 25
23* Installation Changes in Emacs 25.1 26* Installation Changes in Emacs 25.1
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index 43bcb420c36..6f224ed92d3 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -283,7 +283,11 @@ LIBRARY should be a string (the name of the library)."
283 "Library name: ") 283 "Library name: ")
284 table nil nil nil nil def)))) 284 table nil nil nil nil def))))
285 (let ((buf (find-file-noselect (find-library-name library)))) 285 (let ((buf (find-file-noselect (find-library-name library))))
286 (condition-case nil (switch-to-buffer buf) (error (pop-to-buffer buf))))) 286 (condition-case nil
287 (prog1
288 (switch-to-buffer buf)
289 (run-hooks 'find-function-after-hook))
290 (error (pop-to-buffer buf)))))
287 291
288;;;###autoload 292;;;###autoload
289(defun find-function-search-for-symbol (symbol type library) 293(defun find-function-search-for-symbol (symbol type library)
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 7b95e5fb04e..e008698618c 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -202,6 +202,7 @@ The format is (FUNCTION ARGS...).")
202 (let ((location 202 (let ((location
203 (find-function-search-for-symbol fun type file))) 203 (find-function-search-for-symbol fun type file)))
204 (pop-to-buffer (car location)) 204 (pop-to-buffer (car location))
205 (run-hooks 'find-function-after-hook)
205 (if (cdr location) 206 (if (cdr location)
206 (goto-char (cdr location)) 207 (goto-char (cdr location))
207 (message "Unable to find location in file")))) 208 (message "Unable to find location in file"))))
@@ -231,6 +232,7 @@ The format is (FUNCTION ARGS...).")
231 (setq file (help-C-file-name var 'var))) 232 (setq file (help-C-file-name var 'var)))
232 (let ((location (find-variable-noselect var file))) 233 (let ((location (find-variable-noselect var file)))
233 (pop-to-buffer (car location)) 234 (pop-to-buffer (car location))
235 (run-hooks 'find-function-after-hook)
234 (if (cdr location) 236 (if (cdr location)
235 (goto-char (cdr location)) 237 (goto-char (cdr location))
236 (message "Unable to find location in file")))) 238 (message "Unable to find location in file"))))