emacs-devel
[Top][All Lists]
Advanced

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

Re: fix for bug#29935 copyright-update inserts year at random places


From: Stefan Monnier
Subject: Re: fix for bug#29935 copyright-update inserts year at random places
Date: Wed, 03 Jan 2018 20:01:55 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>> Why does this need to use save-window-excursion?
> 'switch-to-buffer' can pop up a new frame, or use a different window,
> depending on various settings, so save-window-excursion is needed. 

Indeed, but note that if it pops up a new frame, save-window-excursion
will be of no help to "undo" this effect (which really can't be undone
in general, since to pop up that frame, the user may have had to place
the new frame).

Also switch-to-buffer is kind of ambiguous: do you really want to only
affect the currently selected window, or do you really want to display
the specified buffer (sometimes switch-to-buffer has to choose between
those two options and it doesn't know what the caller wanted).  I think
here we care more about displaying the specified buffer than about only
affecting the selected window, so we should probably use
`pop-to-buffer(-same-window)` instead.


        Stefan




reply via email to

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