GNU bug report logs - #19576
24.4; Broken function in `window-size-change-functions' cause `write-file' to write the wrong buffer

Previous Next

Package: emacs;

Reported by: Anders Lindgren <andlind <at> gmail.com>

Date: Mon, 12 Jan 2015 23:39:02 UTC

Severity: normal

Found in version 24.4

Done: Anders Lindgren <andlind <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #74 received at 19576 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 19576 <at> debbugs.gnu.org, andlind <at> gmail.com
Subject: Re: bug#19576: write-file writes the wrong buffer
Date: Thu, 19 Nov 2015 09:12:50 +0100
> Thanks for working on this, Martin.  However, I don't think we should
> install this change.  We call Lisp hooks from many places, including
> maybe a dozen in the display engine.  It makes little sense to make
> only one of them resistant to this kind of problems.  OTOH, if we do
> this everywhere, I feel that we will unduly punish 99.999% percent of
> legitimate users of these hooks just because one of them had a bug.

100% agreed.  But run_window_configuration_change_hook goes a long way
saving and restoring current buffer and selected window around each call
to a function on ‘window-configuration-change-hook’.

People who put their functions on ‘window-size-change-functions’ and
‘window-configuration-change-hook’ usually don't care about the precise
reason why these function get called.  They simply want to cover all
cases where a new window appears or a specific window changes size.  Do
we really expect them to add a ‘save-window-excursion’ in one case and
avoid it in the other because it would mean unnecessary extra work?

> I think this is a clear bug in follow.el, and should be fixed there,
> and nowhere else.  Perhaps we should also have some prominent warnings
> in the documentation about this gotcha, so that the probability this
> will happen again becomes lower.

We've broken the taboo in ‘window-configuration-change-hook’.  Anything
we add now will only increase confusion.

martin





This bug report was last modified 9 years and 179 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.