From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sergei Organov Newsgroups: gmane.emacs.help Subject: Re: Elusive buffer(s). Date: Thu, 29 Dec 2011 20:28:54 +0400 Message-ID: References: <4EFC8469.2090509@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1325176183 32183 80.91.229.12 (29 Dec 2011 16:29:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 29 Dec 2011 16:29:43 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 29 17:29:39 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 1RgIrC-0001KP-Vo for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Dec 2011 17:29:31 +0100 Original-Received: from localhost ([::1]:43445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgIr9-00024F-If for geh-help-gnu-emacs@m.gmane.org; Thu, 29 Dec 2011 11:29:27 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:39004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgIqy-00020x-Dj for help-gnu-emacs@gnu.org; Thu, 29 Dec 2011 11:29:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgIqs-0000nC-8k for help-gnu-emacs@gnu.org; Thu, 29 Dec 2011 11:29:16 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:52692) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgIqr-0000n7-V9 for help-gnu-emacs@gnu.org; Thu, 29 Dec 2011 11:29:10 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RgIqq-0000z7-Kc for help-gnu-emacs@gnu.org; Thu, 29 Dec 2011 17:29:08 +0100 Original-Received: from 89.175.180.246 ([89.175.180.246]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Dec 2011 17:29:08 +0100 Original-Received: from osv by 89.175.180.246 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 29 Dec 2011 17:29:08 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 68 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 89.175.180.246 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:83269 Archived-At: martin rudalics writes: [...] > 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. That's clear, thanks, but then for the bug report I've mentioned below the question remains. How pcl-cvs managed to create and _select_ the *cvs* buffer without it appearing in the frame-local buffer list? Is it still a bug? Emacs or pcl-cvs one? [...] >> 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. Thanks a lot for clarification. >> 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. I don't have Emacs 24 yet, but even if I had I can't see right now how I can use those functions to make a function that switches between two recent buffers. As I wrote in those bug-report, the function that I use (and bind to a key) looks like: (defun switch-to-previous-buffer () "Switch to the previous buffer." (interactive) (switch-to-buffer (other-buffer (current-buffer)))) I also noticed that I never able to select *Info* buffer with this function. Why? BTW, an extended function that cycles between recent N buffers would be even more cool. FYI, it all started when I switched from XEmacs to Emacs. XEmacs has this function built-in and it's very convenient once one gets used to it. It's not a very big deal, but my attempt to emulate it in Emacs is still only semi-successful. -- Sergei.