all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Robert J. Chassell" <bob@rattlesnake.com>
Subject: Re: BUG: which-func-mode
Date: Sun, 16 Mar 2003 12:48:57 +0000 (UTC)	[thread overview]
Message-ID: <m18uXZR-000IeGC@rattlesnake.com> (raw)
In-Reply-To: <200303160802.h2G827JU003097@rum.cs.yale.edu> (monnier+gnu/emacs@rum.cs.yale.edu)

   >     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
    running).

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                             bob@rattlesnake.com

  reply	other threads:[~2003-03-16 12:48 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-05  0:36 BUG: which-func-mode Le Wang
2003-03-10 18:28 ` Stefan Monnier
2003-03-11 18:36   ` Richard Stallman
2003-03-11 19:07     ` Stefan Monnier
2003-03-13  7:48       ` Richard Stallman
2003-03-14 23:46         ` Stefan Monnier
2003-03-16  7:47           ` Richard Stallman
2003-03-16  8:02             ` Stefan Monnier
2003-03-16 12:48               ` Robert J. Chassell [this message]
2003-03-16 22:37                 ` Stefan Monnier
2003-03-17 12:51                   ` Robert J. Chassell
2003-03-18 13:22                     ` Richard Stallman
2003-03-17  4:51               ` Richard Stallman
2003-03-17 15:30                 ` Stefan Monnier
2003-03-17 23:24                   ` Richard Stallman
2003-03-18  0:53                     ` Stefan Monnier
2003-03-19  8:49                       ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m18uXZR-000IeGC@rattlesnake.com \
    --to=bob@rattlesnake.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.