help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (save-excursion (other-window 1)) leaves me in the other window


From: Sean McAfee
Subject: Re: (save-excursion (other-window 1)) leaves me in the other window
Date: Tue, 04 May 2010 15:41:55 -0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]