From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.help Subject: Re: Elusive buffer(s). Date: Thu, 29 Dec 2011 16:16:57 +0100 Message-ID: <4EFC8469.2090509@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1325171842 2060 80.91.229.12 (29 Dec 2011 15:17:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 29 Dec 2011 15:17:22 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: osv@javad.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 29 16:17:17 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RgHjI-0002zO-DB for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Dec 2011 16:17:16 +0100 Original-Received: from localhost ([::1]:41474 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgHjH-0001qs-Sl for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Dec 2011 10:17:15 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:49098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgHjA-0001qn-2y for help-gnu-emacs@gnu.org; Thu, 29 Dec 2011 10:17:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgHj8-0004f8-Tv for help-gnu-emacs@gnu.org; Thu, 29 Dec 2011 10:17:08 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:48464) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RgHj8-0004ex-HO for help-gnu-emacs@gnu.org; Thu, 29 Dec 2011 10:17:06 -0500 Original-Received: (qmail invoked by alias); 29 Dec 2011 15:17:03 -0000 Original-Received: from 62-47-44-99.adsl.highway.telekom.at (EHLO [62.47.44.99]) [62.47.44.99] by mail.gmx.net (mp072) with SMTP; 29 Dec 2011 16:17:03 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18CX4VrWk4CG+ODZRRabo17gap+bKDbL1odWxUCko RIiS5CAxHITtCJ User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) Original-References: jdhmje$1ih$1@dough.gmane.org X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.165.64.22 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83268 Archived-At: > I see that not all the displayed buffers are there in the `buffer-list' > frame parameter. Yes. > $ emacs -Q > > M-x compile C-a C-k > > ... *compilation* window should appear below the *scratch* window. > > (frame-parameter nil 'buffer-list) C-j > (# #) > > Where is *compilation* that I do see on the screen? Is it bug or > feature? Since the *compilation* buffer is only displayed, its window is not selected. If you select the window, you will see the buffer in that frame's buffer list. I'm not sure whether this should qualify as a feature - let's call it "traditional behavior". > Reading the manual only adds to my confusion. On one hand: > > File: elisp, Node: Buffer Parameters: > > `buffer-list' > A list of buffers that have been selected in this frame, ordered > most-recently-selected first. > > Suggests that only ever _selected_ buffers should appear in the list > (that matches observed behavior), If you want to look at the C code of Emacs, you will find out that the function responsible for managing this behavior is record_buffer (in buffer.c) and you will find out that this function is called once only - in select_window (in window.c). So unless you select a buffer's window, that buffer is not recorded. [Emacs 23 called record_buffer also from `switch-to-buffer' but these calls have been removed in Emacs 24. In any case, `switch-to-buffer' does also select the window so this fits the behavior described above.] If we assume that the manual has to describe what the code does, the manual entry above is valid. > but on the other hand: > > File: elisp, Node: The Buffer List: > > In addition to the fundamental buffer list just described, Emacs > maintains a local buffer list for each frame, in which the buffers that > have been displayed (or had their windows selected) in that frame come > first. > > Seems to suggest that displayed buffers should also be there in the > frame-local buffer list? Yes. This text is misleading. You should file a bug report. > BTW, the question relates to the issue I've reported 2 years ago here: > > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5185 > > but in that case *cvs* buffer was also current buffer in the original > frame, so that report is definitely a bug that I'm still able to > reproduce. Emacs 24 has two functions `switch-to-prev-buffer' and `switch-to-next-buffer' which respectively switch to the buffer previously shown in a window and undo that. You should try them because they do not depend on whether a buffer's window was previously selected or not. martin