all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sean McAfee <smcafee@palantirtech.com>
To: help-gnu-emacs@gnu.org
Subject: Re: (save-excursion (other-window 1)) leaves me in the other window
Date: Mon, 08 Mar 2010 09:02:59 -0800	[thread overview]
Message-ID: <m3hboqvj98.fsf@palantirtech.com> (raw)
In-Reply-To: m3mxyivjma.fsf@palantirtech.com

Sean McAfee <eefacm@gmail.com> 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?


  reply	other threads:[~2010-03-08 17:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-05 20:33 (save-excursion (other-window 1)) leaves me in the other window Sean McAfee
2010-03-05 22:21 ` Joe Fineman
2010-03-07  6:55 ` Tim X
2010-03-08  3:09   ` Sean McAfee
2010-03-08  7:26     ` Tim X
2010-03-08 16:55       ` Sean McAfee
2010-03-08 17:02         ` Sean McAfee [this message]
2010-03-08 17:24           ` David Kastrup
2010-03-09  6:45         ` Tim X

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3hboqvj98.fsf@palantirtech.com \
    --to=smcafee@palantirtech.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.