[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
iswitchb-kill-buffer and uniquify-buffer-name-style
From: |
Óscar Fuentes |
Subject: |
iswitchb-kill-buffer and uniquify-buffer-name-style |
Date: |
Sat, 22 Mar 2008 02:11:57 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (windows-nt) |
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
- iswitchb-kill-buffer and uniquify-buffer-name-style,
Óscar Fuentes <=