>> 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
http://www.jurta.org/emacs/



_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to