diff options
| author | Thien-Thi Nguyen | 2004-12-05 16:58:13 +0000 |
|---|---|---|
| committer | Thien-Thi Nguyen | 2004-12-05 16:58:13 +0000 |
| commit | 911aa04913aeaafe5341c91364fa045db37f3d35 (patch) | |
| tree | 05de2743a3d1a17715e8c6d48538af31cd315e21 | |
| parent | d10e87a203579f74df86fcf839148993603c7346 (diff) | |
| download | emacs-911aa04913aeaafe5341c91364fa045db37f3d35.tar.gz 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/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/progmodes/which-func.el | 12 |
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 @@ | |||
| 1 | 2004-12-05 Paul Pogonyshev <pogonyshev@gmx.net> | ||
| 2 | |||
| 3 | * progmodes/which-func.el (which-function): Use | ||
| 4 | `run-hook-with-args-until-success' instead of a custom loop. | ||
| 5 | Fixes bug with local hooks. | ||
| 6 | |||
| 1 | 2004-12-05 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> | 7 | 2004-12-05 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> |
| 2 | 8 | ||
| 3 | * textmodes/bibtex.el (bibtex-font-lock-url-regexp): | 9 | * 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, | |||
| 243 | Uses `which-function-functions', `imenu--index-alist' | 243 | Uses `which-function-functions', `imenu--index-alist' |
| 244 | or `add-log-current-defun-function'. | 244 | or `add-log-current-defun-function'. |
| 245 | If no function name is found, return nil." | 245 | If no function name is found, return nil." |
| 246 | (let (name) | 246 | (let ((name |
| 247 | ;; Try the which-function-functions functions first. | 247 | ;; Try the `which-function-functions' functions first. |
| 248 | (let ((hooks which-func-functions)) | 248 | (run-hook-with-args-until-success 'which-func-functions))) |
| 249 | (while hooks | ||
| 250 | (let ((value (funcall (car hooks)))) | ||
| 251 | (when value | ||
| 252 | (setq name value | ||
| 253 | hooks nil))) | ||
| 254 | (setq hooks (cdr hooks)))) | ||
| 255 | 249 | ||
| 256 | ;; If Imenu is loaded, try to make an index alist with it. | 250 | ;; If Imenu is loaded, try to make an index alist with it. |
| 257 | (when (and (null name) | 251 | (when (and (null name) |