[Top][All Lists]

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

Re: BUG: which-func-mode

From: Robert J. Chassell
Subject: Re: BUG: which-func-mode
Date: Sun, 16 Mar 2003 12:48:57 +0000 (UTC)

   >     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'.

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.

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:

    (eintr)Switching Buffers

    `switch-to-buffer' is designed for humans and does two different
    things: it switches the buffer to which Emacs' attention is
    directed; and it switches the buffer displayed in the window to
    the new buffer.  `set-buffer', on the other hand, does only one
    thing: it switches the attention of the computer program to a
    different buffer.  The buffer on the screen remains unchanged (of
    course, normally nothing happens there until the command finishes

Thus `set-buffer' should *not* effect the buffer list, which is
intended to list buffers displayed for humans in the selected window.

Perhaps the Emacs manual or Emacs Lisp Reference Manuals are not
sufficiently explicit about the difference among different kinds of
`set', `switch-to', and `select' functions; I don't see the problem,
but maybe the documentation should be improved.

    Robert J. Chassell                         Rattlesnake Enterprises
    http://www.rattlesnake.com                  GnuPG Key ID: 004B4AC8
    http://www.teak.cc                             address@hidden

reply via email to

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