changeset 58774:212ad195d26f

(which-function): Use `run-hook-with-args-until-success' instead of a custom loop. Fixes bug with local hooks.
author Thien-Thi Nguyen <ttn@gnuvola.org>
date Sun, 05 Dec 2004 16:56:29 +0000
parents 12756b0ec526
children 1af34a57a7b2
files lisp/progmodes/which-func.el
diffstat 1 files changed, 3 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/which-func.el	Sun Dec 05 16:07:39 2004 +0000
+++ b/lisp/progmodes/which-func.el	Sun Dec 05 16:56:29 2004 +0000
@@ -243,15 +243,9 @@
 Uses `which-function-functions', `imenu--index-alist'
 or `add-log-current-defun-function'.
 If no function name is found, return nil."
-  (let (name)
-    ;; Try the which-function-functions functions first.
-    (let ((hooks which-func-functions))
-      (while hooks
-	(let ((value (funcall (car hooks))))
-	  (when value
-	    (setq name value
-		  hooks nil)))
-	(setq hooks (cdr hooks))))
+  (let ((name
+	 ;; Try the `which-function-functions' functions first.
+	 (run-hook-with-args-until-success 'which-func-functions)))
 
     ;; If Imenu is loaded, try to make an index alist with it.
     (when (and (null name)