* A bug fix for `which-func.el'
@ 2004-12-03 19:33 Paul Pogonyshev
2004-12-05 15:37 ` Paul Pogonyshev
0 siblings, 1 reply; 3+ messages in thread
From: Paul Pogonyshev @ 2004-12-03 19:33 UTC (permalink / raw)
This one is a certain improvement.
2004-12-03 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.
--- which-func.el 17 Aug 2004 01:46:26 +0300 1.6
+++ which-func.el 03 Dec 2004 21:31:04 +0200
@@ -243,15 +243,9 @@ It calls them sequentially, and if any r
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)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: A bug fix for `which-func.el'
2004-12-03 19:33 A bug fix for `which-func.el' Paul Pogonyshev
@ 2004-12-05 15:37 ` Paul Pogonyshev
2004-12-05 17:22 ` Thien-Thi Nguyen
0 siblings, 1 reply; 3+ messages in thread
From: Paul Pogonyshev @ 2004-12-05 15:37 UTC (permalink / raw)
I wrote:
> This one is a certain improvement.
Maybe I didn't make it clear.
Turn on Which Function mode and evaluate
(add-hook 'which-func-functions 'ignore)
Fine, the mode keeps working. Now add this dummy hook as local in
some buffer:
(add-hook 'which-func-functions 'ignore nil t)
The mode dies out, because the loop cannot handle local hooks. My
patch replaces the custom loop with a call to standard function,
which is bug-free and is generally better to use.
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.
--- which-func.el 17 Aug 2004 01:46:26 +0300 1.6
+++ which-func.el 03 Dec 2004 21:31:04 +0200
@@ -243,15 +243,9 @@ It calls them sequentially, and if any r
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)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: A bug fix for `which-func.el'
2004-12-05 15:37 ` Paul Pogonyshev
@ 2004-12-05 17:22 ` Thien-Thi Nguyen
0 siblings, 0 replies; 3+ messages in thread
From: Thien-Thi Nguyen @ 2004-12-05 17:22 UTC (permalink / raw)
Cc: emacs-devel
thanks, installed.
thi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-12-05 17:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-03 19:33 A bug fix for `which-func.el' Paul Pogonyshev
2004-12-05 15:37 ` Paul Pogonyshev
2004-12-05 17:22 ` Thien-Thi Nguyen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.