From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bill Wohler Newsgroups: gmane.emacs.devel Subject: Re: 23.1: Is delete-windows-on supposed to change the current buffer? Date: Fri, 31 Jul 2009 13:17:44 -0700 Organization: Newt Software Message-ID: <87my6k1uaf.fsf@olgas.newt.com> References: <30354.1248991980@schlepp.honig.net> <4A72B471.5030701@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1249071499 27603 80.91.229.12 (31 Jul 2009 20:18:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Jul 2009 20:18:19 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 31 22:18:12 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MWyYN-0001SI-N2 for ged-emacs-devel@m.gmane.org; Fri, 31 Jul 2009 22:18:12 +0200 Original-Received: from localhost ([127.0.0.1]:50585 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWyYM-0006sc-Vs for ged-emacs-devel@m.gmane.org; Fri, 31 Jul 2009 16:18:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWyYI-0006sX-J5 for emacs-devel@gnu.org; Fri, 31 Jul 2009 16:18:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWyYD-0006sJ-5r for emacs-devel@gnu.org; Fri, 31 Jul 2009 16:18:05 -0400 Original-Received: from [199.232.76.173] (port=44076 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWyYD-0006sG-0f for emacs-devel@gnu.org; Fri, 31 Jul 2009 16:18:01 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:44955 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MWyYC-00016j-Gc for emacs-devel@gnu.org; Fri, 31 Jul 2009 16:18:00 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MWyY3-0001td-T1 for emacs-devel@gnu.org; Fri, 31 Jul 2009 20:17:51 +0000 Original-Received: from adsl-76-233-235-99.dsl.pltn13.sbcglobal.net ([76.233.235.99]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 31 Jul 2009 20:17:51 +0000 Original-Received: from wohler by adsl-76-233-235-99.dsl.pltn13.sbcglobal.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 31 Jul 2009 20:17:51 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 29 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: adsl-76-233-235-99.dsl.pltn13.sbcglobal.net User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:vOP7tGPWEd7amVfR2B/BHZFWViw= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:113480 Archived-At: Stefan Monnier writes: >> `delete-windows-on' deletes all windows showing `mh-show-buffer'. If, >> for example, `mh-show-buffer' is shown in the selected window and that >> window is the only window on its frame, and that frame is the only >> frame, another buffer is shown in that window and becomes the current >> buffer. window_loop handles this as > >> if (EQ (window, selected_window)) >> Fset_buffer (w->buffer); > >> unchanged since the past release. > > My guess is that the switch from Fdisplay_buffer to the Elisp version of > code, causes the windows to be created slightly differently, and this in > turn causes delete-windows-on in this particular case to cycle through > the windows in a different order. > In any case, the answer is that delete-windows-on should be expected to > change the current-buffer, so if you want it to stay unchanged, you need > save-excursion. Thanks, Stefan. Another solution would be to save the content of current-buffer first, and then use set-buffer or with-current-buffer to access it. Are one or the other of these two functions preferred? -- Bill Wohler http://www.newt.com/wohler/ GnuPG ID:610BD9AD