Mercurial > emacs
diff lisp/progmodes/which-func.el @ 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 | f54e121491eb |
children | dc55bf752d7c f2ebccfa87d4 |
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)