emacs-devel
[Top][All Lists]
Advanced

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

Re: 23.1: Is delete-windows-on supposed to change the current buffer?


From: Bill Wohler
Subject: Re: 23.1: Is delete-windows-on supposed to change the current buffer?
Date: Fri, 31 Jul 2009 13:17:44 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> `delete-windows-on' deletes all windows showing `mh-show-buffer'.  If,
>> for example, `mh-show-buffer' is shown in the selected window and that
>> window is the only window on its frame, and that frame is the only
>> frame, another buffer is shown in that window and becomes the current
>> buffer.  window_loop handles this as
>
>>                  if (EQ (window, selected_window))
>>                    Fset_buffer (w->buffer);
>
>> unchanged since the past release.
>
> My guess is that the switch from Fdisplay_buffer to the Elisp version of
> code, causes the windows to be created slightly differently, and this in
> turn causes delete-windows-on in this particular case to cycle through
> the windows in a different order.
> In any case, the answer is that delete-windows-on should be expected to
> change the current-buffer, so if you want it to stay unchanged, you need
> save-excursion.

Thanks, Stefan.

Another solution would be to save the content of current-buffer first,
and then use set-buffer or with-current-buffer to access it. Are one
or the other of these two functions preferred?

-- 
Bill Wohler <address@hidden>  http://www.newt.com/wohler/  GnuPG ID:610BD9AD





reply via email to

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