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

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

bug#19576: write-file writes the wrong buffer


From: Alan Mackenzie
Subject: bug#19576: write-file writes the wrong buffer
Date: 17 Nov 2015 22:10:16 -0000
User-agent: tin/2.3.1-20141224 ("Tallant") (UNIX) (FreeBSD/10.1-RELEASE-p16 (amd64))

Hello, Anders.

In article <mailman.9.1447720293.31583.bug-gnu-emacs@gnu.org> you wrote:
> [-- text/plain, encoding 7bit, charset: UTF-8, 28 lines --]

> Hi,

> about a year ago I reported that `write-file' sometimes writes the wrong
> buffer to the destination file. Unfortunately, I had no feedback regarding
> this. When I checked today, the bug is still there.

> The problem occurs when a function on the hook
> `window-size-change-functions' change the current buffer. The functions in
> this hook are executed when `y-or-n-p' is called, which is used by
> `write-file' to verify that it is OK to overwrite an existing file. One
> such function is `follow-window-size-change' in follow.el.

I've run the test code you posted back in January, and I can reproduce
the error.

But I don't see why `window-size-change-functions' are being called when
`y-or-n-p' is run.  It seems to me, all windows stay the same size.
Surely I'm missing something obvious, but what?

> This problem is not limited to `write-file' -- all functions calling
> `y-or-n-p' are affected by this!

> Of course, it would be relatively straight forward to modify the offending
> function (and all other similar functions). However, a more robust solution
> would be for the code that calls the functions on the hook to ensure that
> it isn't derailed when the buffer is changed.

> Personally, I don't know that part of the code well enough to do this
> change. Martin, is this something that you could look into, or suggest
> someone who can?

> See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19576 for more details.

>     -- Anders Lindgren

-- 
Alan Mackenzie (Nuremberg, Germany).






reply via email to

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