* Redundant left-over buffer after rename-buffer
@ 2013-02-23 11:55 Thorsten Jolitz
2013-02-23 12:24 ` Thorsten Jolitz
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Jolitz @ 2013-02-23 11:55 UTC (permalink / raw)
To: help-gnu-emacs
Hi List,
I want to rename *Occur* buffers following the advice given in
`occur-rename-buffer' from `replace.el', with slightly modified and
renamed code:
,-------------------------------------------------------------------------------
| ;; slightly modified `occur-rename-buffer' from `replace.el'
| (defun navi-rename-buffer (&optional unique-p)
| "Rename the current *Occur* buffer to *Navi: original-buffer-name*.
| Here `original-buffer-name' is the buffer name where Occur was
| originally run. When given the prefix argument, the renaming will
| not clobber the existing buffer(s) of that name, but use
| `generate-new-buffer-name' instead. You can add this to
| `occur-hook' if you always want a separate *Occur* buffer for
| each buffer where you invoke `occur'."
| (with-current-buffer
| (if (eq major-mode 'occur-mode) (current-buffer) (get-buffer "*Occur*"))
| (rename-buffer (concat "*Navi: "
| (mapconcat #'buffer-name
| (car (cddr occur-revert-arguments)) "/")
| "*")
| unique-p)))
|
| (add-to-list 'occur-hook 'navi-rename-buffer)
`-------------------------------------------------------------------------------
However, while the renaming works and the search results from occur are
presented in a buffer called *Navi: original-buffer-name*, an empty
*Occur* buffer in fundamental mood remains as a (redundant) left-over.
,-------------------------------------
| (kill-buffer (get-buffer "*Occur*"))
`-------------------------------------
If I try to add the above function call as last statement into the
defun, I'm told that I'm trying to kill a non-existing buffer.
How can I avoid (or get rid of) the left-over *Occur* buffer in
fundamental mode after the renaming operation?
--
cheers,
Thorsten
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Redundant left-over buffer after rename-buffer
2013-02-23 11:55 Redundant left-over buffer after rename-buffer Thorsten Jolitz
@ 2013-02-23 12:24 ` Thorsten Jolitz
0 siblings, 0 replies; 2+ messages in thread
From: Thorsten Jolitz @ 2013-02-23 12:24 UTC (permalink / raw)
To: help-gnu-emacs
Thorsten Jolitz <tjolitz@gmail.com> writes:
> However, while the renaming works and the search results from occur are
> presented in a buffer called *Navi: original-buffer-name*, an empty
> *Occur* buffer in fundamental mood remains as a (redundant) left-over.
The error/cause was in another part of my own code, so this problem is
solved, sorry for the noise.
--
cheers,
Thorsten
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-02-23 12:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-23 11:55 Redundant left-over buffer after rename-buffer Thorsten Jolitz
2013-02-23 12:24 ` Thorsten Jolitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).