[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing occur-hook to occur-functions

From: Juri Linkov
Subject: Re: Changing occur-hook to occur-functions
Date: Tue, 05 Jul 2005 08:27:35 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

>> Why do you think it is a mistake?  It doesn't work with `occur-mode-hook'.
> Neither does with `occur-hook'. You have to add
>  (lambda () (occur-rename-buffer t))

That's exactly what I tried.  With the latest CVS state

(add-hook 'occur-hook (lambda () (occur-rename-buffer t)))

renames the *Occur* buffer to `*Occur: original-buffer-name*', but

(add-hook 'occur-mode-hook (lambda () (occur-rename-buffer t)))

produces a name with empty original-buffer-name (i.e. just `*Occur: *'),
because `occur-1' sets the value of `occur-revert-arguments'
after running `occur-mode-hook', but before `occur-hook'.

> to `occur-mode-hook' for it to work.  That's why I proposed to add a
> new parameter INTERACTIVE-P to `occur-rename-buffer' so it can be just
> dropped onto the hook.

This would be good, but without adding original-buffer-name to the
buffer name, to produce a unique buffer name, the user can simply put

(add-hook 'occur-mode-hook 'rename-uniquely)

Juri Linkov

reply via email to

[Prev in Thread] Current Thread [Next in Thread]