GNU bug report logs - #18336
24.4.50; When editing externally changed file, Emacs asks too many questions

Previous Next

Package: emacs;

Reported by: David Kastrup <dak <at> gnu.org>

Date: Wed, 27 Aug 2014 08:19:01 UTC

Severity: minor

Tags: fixed, patch

Found in version 24.4.50

Fixed in version 28.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: dak <at> gnu.org, stefan <at> marxist.se, 18336 <at> debbugs.gnu.org
Subject: Re: bug#18336: 24.4.50;
 When editing externally changed file, Emacs asks too many questions
Date: Thu, 05 Mar 2020 21:31:20 +0200
> From: Noam Postavsky <npostavs <at> gmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  stefan <at> marxist.se,  18336 <at> debbugs.gnu.org
> Date: Thu, 05 Mar 2020 12:54:41 -0500
> 
> > Thanks.  Any suggestions for how to fix this?  A new argument to
> > lock_file, perhaps?  Or maybe some additional check in
> > userlock--ask-user-about-supersession-threat to recognize the special
> > situation where we are saving a file?
> 
> I'm not sure.  Why exactly are we calling lock_file from write_region?

Because write-region can be called from an unmodified buffer, I
suppose, and from a buffer whose buffer-file-name is not the same as
the file being written to.

>    Do not (normally) call this for a buffer already modified,
>    as either the file is already locked, or the user has already
>    decided to go ahead without locking.
> 
> It seems we are doing exactly this, so I guess that makes
> save-buffer/write-region an "abnormal" situation?

Evidently, when we disabled backups in /tmp, we missed the fact that
lock_file called from write-region will be affected.  When backups are
not disabled, this works correctly.




This bug report was last modified 5 years and 120 days ago.

Previous Next


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