From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sean McAfee Newsgroups: gmane.emacs.help Subject: Re: (save-excursion (other-window 1)) leaves me in the other window Date: Mon, 08 Mar 2010 09:02:59 -0800 Message-ID: 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 1273053210 16623 80.91.229.12 (5 May 2010 09:53:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 May 2010 09:53:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed May 05 11:53:29 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 1O9bIF-0007tn-Vz for geh-help-gnu-emacs@m.gmane.org; Wed, 05 May 2010 11:53:28 +0200 Original-Received: from localhost ([127.0.0.1]:49576 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9bIF-0005HI-Ef for geh-help-gnu-emacs@m.gmane.org; Wed, 05 May 2010 05:53:27 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Mon, 08 Mar 2010 11:05:37 -0600 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) Cancel-Lock: sha1:uScUgOI6+FgfvsKt6ukEmJfYhI8= Original-Lines: 18 Original-X-Trace: sv3-6GO85CMBEPE+tt/JPcfFL22jo9hfMakhreRjkOXhOmQdv+TrEsYpAaGYpRRGdWRYrnDuCD+lTPuGohw!9W6UoKU2/YF+uobtlKWnJHXDVNV4Ahi4YIp0vtQ/Sl6dBo+ZK9szTzef5D0g92DrZlQ= Original-X-Complaints-To: www.supernews.com/docs/abuse.html X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Original-Xref: usenet.stanford.edu gnu.emacs.help:177407 X-Mailman-Approved-At: Tue, 04 May 2010 16:45:22 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor 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:73334 Archived-At: 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?