[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BUG: which-func-mode

From: Stefan Monnier
Subject: Re: BUG: which-func-mode
Date: Sun, 16 Mar 2003 17:37:42 -0500

>    >     I think that it would be better if select-window did not
>    >     change the buffer-list.  Why does it do it in the first place?
>    > 
>    > Because it changes the selected buffer.
>    I don't understand why one should imply the other.
>    After all, `set-buffer' also changes the selected buffer but it
>    doesn't modify the buffer-list.
> `set-buffer' works differently than `switch-to-buffer' or
> `select-window'.  As its documentation says, `set-buffer'
>     ... does not display the buffer, so its effect ends
>     when the current command terminates.
> This is in contrast with `switch-to-buffer' or `select-window'.

select-window does not "display the buffer" either.

> Moreover, as said in
>     (elisp)The Buffer List 
>     The "buffer list" is a list of all live buffers.  Creating a
>     buffer adds it to this list, and killing a buffer excises it.  The
>     order of the buffers in the list is based primarily on how
>     recently each buffer has been displayed in the selected window.
>     Buffers move to the front of the list when they are selected and
>     to the end when they are buried (see `bury-buffer', below).
>     Several functions, notably `other-buffer', use this ordering.  A
>     buffer list displayed for the user also follows this order.

This only talks about events where the buffer displayed in a window
is changed rather than events where the selected window is changed.

Furthermore, select-window is not a command and in the case at hand, it
is used to *temporarily* switch to some other window.

> I did not deal with `select-window', but in my "Introduction to
> Programming in Emacs Lisp", I did explain the difference between
> `switch-to-buffer' and `set-buffer' like this:

I'm not comparing switch-to-buffer to set-buffer:
I'm comparing select-window to set-buffer.
I of course agree 100% with the current behavior which does not change
the buffer-list in set-buffer but changes it in switch-to-buffer.
OTOH, I still haven't heard any good reason why select-window should
fiddle with the buffer-list.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]