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:54 -0000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

Tim X <timx@nospam.dev.null> writes:
> Sean McAfee <eefacm@gmail.com> writes:
>> Although the documentation for save-excursion says that it saves and
>> restores the current buffer, it doesn't in this case.

> Note that the docs as you noted say that they restore the buffer, not
> the window. This was part of the point I was tyring to make. Buffers and
> windows are not the same thing. 

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).


reply via email to

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