all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* iswitchb-kill-buffer and uniquify-buffer-name-style
@ 2008-03-22  1:11 Óscar Fuentes
  2008-03-22 16:39 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Óscar Fuentes @ 2008-03-22  1:11 UTC (permalink / raw)
  To: emacs-devel


If uniquify-buffer-name-style is not nil and you open /foo/Makefile and
/bar/Makefile, your buffers are named foo/Makefile and bar/Makefile or
similar.

If you use iswitchb for switching buffers and kill foo/Makefile from the
iswitchb prompt (C-k), bar/Makefile is automagically renamed to
Makefile, but iswitchb does not notice this, and keeps showing
bar/Makefile, which is wrong. If you select it iswitchb will ask if you
want to create a new buffer named bar/Makefile.

Non-offuscated description:

M-x set-variable uniquify-buffer-name-style forward
M-x iswitchb-mode
C-x C-f /foo/Makefile
C-x C-f /bar/Makefile
C-x b M a k e C-k

Let's suppose we killed bar/Makefile. Then, foo/Makefile was renamed by
uniquify.el to simply Makefile, but foo/Makefile still is in the list of
buffers.

I'm trying to fix this and I'm confused. The definition of
iswitchb-kill-buffer ends with this:

	  (if (get-buffer buf)
	      ;; buffer couldn't be killed.
	      (setq iswitchb-rescan t)
	    ;; else buffer was killed so remove name from list.
	    (setq iswitchb-buflist  (delq buf iswitchb-buflist)))

My first attempt was to (setq iswitchb-rescan t) unconditionally, but
this does not work (the buffer list is left unmodified, including the
killed buffer). Then I replaced the above code with
(iswitchb-make-buflist nil). This fixes the problem, but the new list
does not remember which buffer was at the front of the list.

Is there a bug on the way iswitchb-rescan is managed or a more deeper
issue within iswitchb?

-- 
Oscar





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-22 16:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-22  1:11 iswitchb-kill-buffer and uniquify-buffer-name-style Óscar Fuentes
2008-03-22 16:39 ` Stefan Monnier

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.