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: martin rudalics
Subject: Re: fix for bug#29935 copyright-update inserts year at random places
Date: Mon, 08 Jan 2018 19:18:09 +0100

> If `x` is just a window, how does quit-restore-window know that we want
> to hide BUF (and not some other buffer that happens to be displayed
> in the window once we get to quit-restore-window)?
>
> If `x` is just a window, how does quit-restore-window know whether BUF was
> already displayed in that window before temporary-undisplay-buffer was
> called (in order to decide whether to change the window's buffer or not)?

`quit-restore-window' remembers what buffer the window it quits
displayed before calling `with-temp-buffer-window' and also the
respective `window-start' and `window-point' positions, sometimes also
the window's size.

>> So please tell what's missing in `with-temp-buffer-window'.
>
> It forces scoping.

Where and how?  IIUC your

    (let ((x (temporary-display-buffer BUF)))

    +

    (temporary-undisplay-buffer x)

would force scoping (and is therefore IMHO not useful for our purpose)
but `quit-restore-window' doesn't rely on any scoping.

> IOW it can't be used when the
> temporary-undisplay-buffer part needs to be done at some arbitrary later
> time (e.g. after the user has run a bunch of commands).

Please show me an example.  `with-temp-buffer-window' was explicitly
designed to handle what you describe here so if it doesn't for you it
clearly failed to achieve its aim.

martin



reply via email to

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