Subject: bug#22583: 25.1.50; find-function-search-for-symbol don't call find-function-after-hook

From: Tino Calancha <[email-masked]>
Date: Mon, 8 Feb 2016 21:50:04 +0900 (JST)

>find-function-search-for-symbol is a querying function. It can be used by different consumers, e.g. xref-location-marker.
>I'm not sure the user would want find-function-after-hook to run in every such case.
Right: the hook may be unnecessary called many times. Not good.

>Maybe help-variable-def's button definition's help-function should run the hook explicitly instead.
Thanks for the tip. This way looks more sensible.

diff --git a/help-mode.el b/help-mode.el
index 22e5386..9c512bd 100644
--- a/help-mode.el
+++ b/help-mode.el
@@ -202,6 +202,7 @@ The format is (FUNCTION ARGS...).")
 		   (let ((location
 			  (find-function-search-for-symbol fun type file)))
 		     (pop-to-buffer (car location))
+			 (run-hooks 'find-function-after-hook)
 		     (if (cdr location)
 			 (goto-char (cdr location))
 		       (message "Unable to find location in file"))))
@@ -231,6 +232,7 @@ The format is (FUNCTION ARGS...).")
 		     (setq file (help-C-file-name var 'var)))
 		   (let ((location (find-variable-noselect var file)))
 		     (pop-to-buffer (car location))
+		     (run-hooks 'find-function-after-hook)
 		     (if (cdr location)
 		       (goto-char (cdr location))
 		       (message "Unable to find location in file"))))