From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: (save-excursion (other-window 1)) leaves me in the other window Date: Mon, 08 Mar 2010 18:24:11 +0100 Organization: Organization?!? Message-ID: <873a0aybes.fsf@lola.goethe.zz> References: <87y6i4sjsn.fsf@rapttech.com.au> <87mxyjs28x.fsf@rapttech.com.au> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1272990985 8514 80.91.229.12 (4 May 2010 16:36:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 4 May 2010 16:36:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 04 18:36:24 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O9L6d-0004Il-Oc for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 18:36:24 +0200 Original-Received: from localhost ([127.0.0.1]:44123 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9L6d-0007d4-46 for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 12:36:23 -0400 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux) Cancel-Lock: sha1:J1lSUOCz/dOD2Dvn7yFRpciCtL0= Original-Lines: 27 Original-NNTP-Posting-Date: 08 Mar 2010 18:24:11 CET Original-NNTP-Posting-Host: 178454de.newsspool3.arcor-online.net Original-X-Trace: DXC=U=RXMX:4gfd^Y=RbYBPl4`McF=Q^Z^V3h4Fo<]lROoRa8kF5MOK` List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:72936 Archived-At: Sean McAfee writes: > Sean McAfee writes: >> If the current buffer is restored, then I would expect this expression: >> >> (eq (current-buffer) (save-excursion arbitrary-forms (current-buffer))) >> >> ...to always evaluate to t regardless of what arbitrary-forms is, but it >> returns nil if I replace arbitrary-forms with (other-window 1). > > Argh. Of course the expression I meant to write was: > > (eq (current-buffer) (progn (save-excursion arbitrary-forms) (current-buffer))) > > This actually does return t in the presence of multiple windows even if > arbitrary-forms is (other-window 1), and yet the cursor still ends up in > a different window than the one it was in before evaluating the > expression. I still don't get it. I guess maybe other-window doesn't > switch windows immediately, but defers the switch until after the > expression has been fully evaluated? other-window changes the current window, not the current buffer. When Emacs returns to the command loop, the current buffer is set to the window-buffer of the current window. -- David Kastrup