From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Robert J. Chassell" Newsgroups: gmane.emacs.devel Subject: Re: BUG: which-func-mode Date: Sun, 16 Mar 2003 12:48:57 +0000 (UTC) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <200303101828.h2AISIrs027316@rum.cs.yale.edu> <200303111907.h2BJ7ZHv012258@rum.cs.yale.edu> <200303142346.h2ENkKWm025313@rum.cs.yale.edu> <200303160802.h2G827JU003097@rum.cs.yale.edu> Reply-To: bob@rattlesnake.com NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1047819151 24032 80.91.224.249 (16 Mar 2003 12:52:31 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 16 Mar 2003 12:52:31 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Mar 16 13:52:30 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18uXcY-0006F1-00 for ; Sun, 16 Mar 2003 13:52:10 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18uY1i-0003P5-00 for ; Sun, 16 Mar 2003 14:18:11 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18uXar-0005x1-00 for emacs-devel@quimby.gnus.org; Sun, 16 Mar 2003 07:50:25 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18uXa2-0005jW-00 for emacs-devel@gnu.org; Sun, 16 Mar 2003 07:49:34 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18uXZk-0005E7-00 for emacs-devel@gnu.org; Sun, 16 Mar 2003 07:49:17 -0500 Original-Received: from megalith.rattlesnake.com ([140.186.114.245] helo=rattlesnake.com) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18uXZT-0004pr-00 for emacs-devel@gnu.org; Sun, 16 Mar 2003 07:49:00 -0500 Original-Received: by rattlesnake.com via sendmail from stdin id (Debian Smail3.2.0.114) Sun, 16 Mar 2003 12:48:57 +0000 (UTC) Original-To: emacs-devel@gnu.org In-reply-to: <200303160802.h2G827JU003097@rum.cs.yale.edu> (monnier+gnu/emacs@rum.cs.yale.edu) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:12388 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:12388 > 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