Subject: bug#8799: 23.3; iswitchb

From: Deniz Dogan <[email-masked]>
Date: Sat, 04 Jun 2011 17:14:14 +0200

On 2011-06-04 11:42, Stephen Eglen wrote:
> The following bug report was sent to me by Trevor Spiteri (thank you!).
>
> ----------------------------------------------------------------------
> The documentation for iswitchb-window-buffer-p states that it should
> return nil if BUFFER is visible in the current frame. Sometimes this
> does not happen.
>
> Suppose I am in a frame with two windows, one for buffer1 and the other
> for buffer2, and I am currently in the window for buffer1. If I type:
> C-x b b u f f e r 2<return>
> this works correctly, iswitchb-window-buffer-p returns nil, and
> consequently both windows will show buffer2.
>
> If instead of<return>  I use C-j, that is, I am in the window for
> buffer1 and buffer2 is in the other window, and I type:
> C-x b b u f f e r 2 C-j
> iswitchb-window-buffer-p does not return nil, and consequently not both
> windows will show buffer2, but the window for buffer2 becomes the
> current window.
>
> To fix this, in the defun for iswitchb-window-buffer-p, the line
>
>       (if (memq buffer blist)
>
> should be changed to:
>
>       (if (member buffer blist)
>
> What I guess is happening is that using<return>, buffer is a string
> obtained from the list of buffers, so it is eq to the corresponding
> element in blist. When C-j is used, buffer is taken from user input, and
> is thus not eq to the corresponding element in blist. Although it is not
> eq, it is still equal, so changing memq to member fixes the issue.
> ----------------------------------------------------------------------
>
>
>

I have pushed a fix for this to emacs-trunk, but I afterwards realized I 
should have pushed it to emacs-23.  Could someone knowledgeable fix this 
for me?

Thanks