summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThien-Thi Nguyen <ttn@gnuvola.org>2004-12-05 16:58:13 +0000
committerThien-Thi Nguyen <ttn@gnuvola.org>2004-12-05 16:58:13 +0000
commit911aa04913aeaafe5341c91364fa045db37f3d35 (patch)
tree05de2743a3d1a17715e8c6d48538af31cd315e21
parentd10e87a203579f74df86fcf839148993603c7346 (diff)
downloademacs-911aa04913aeaafe5341c91364fa045db37f3d35.tar.gz
emacs-911aa04913aeaafe5341c91364fa045db37f3d35.tar.bz2
emacs-911aa04913aeaafe5341c91364fa045db37f3d35.zip
(which-function): Use
`run-hook-with-args-until-success' instead of a custom loop. Fixes bug with local hooks.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/progmodes/which-func.el12
2 files changed, 9 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6afd04befda..3742818bd53 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -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):
diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
index 845c995371d..dae5722d430 100644
--- a/lisp/progmodes/which-func.el
+++ b/lisp/progmodes/which-func.el
@@ -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)