]> git.eshelyaron.com Git - emacs.git/commitdiff
(which-function): Use
authorThien-Thi Nguyen <ttn@gnuvola.org>
Sun, 5 Dec 2004 16:58:13 +0000 (16:58 +0000)
committerThien-Thi Nguyen <ttn@gnuvola.org>
Sun, 5 Dec 2004 16:58:13 +0000 (16:58 +0000)
`run-hook-with-args-until-success' instead of a custom loop.
Fixes bug with local hooks.

lisp/ChangeLog
lisp/progmodes/which-func.el

index 6afd04befda97094defb5fe0da163f84b8c62c14..3742818bd53a97282c3192cc04e9536ffee1579b 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-05  Paul Pogonyshev  <pogonyshev@gmx.net>
+
+       * progmodes/which-func.el (which-function): Use
+       `run-hook-with-args-until-success' instead of a custom loop.
+       Fixes bug with local hooks.
+
 2004-12-05  Roland Winkler  <Roland.Winkler@physik.uni-erlangen.de>
 
        * textmodes/bibtex.el (bibtex-font-lock-url-regexp):
index 845c995371d09a56a934234116435811e3efcc61..dae5722d430e14e411910522d713692052067f8f 100644 (file)
@@ -243,15 +243,9 @@ It calls them sequentially, and if any returns non-nil,
 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)