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


View this message in rfc822 format

From: Noam Postavsky <npostavs <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: dak <at> gnu.org, stefan <at> marxist.se, 18336 <at> debbugs.gnu.org
Subject: bug#18336: 24.4.50; When editing externally changed file, Emacs asks too many questions
Date: Sun, 22 Mar 2020 11:45:24 -0400
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Noam Postavsky <npostavs <at> gmail.com>
>> Cc: dak <at> gnu.org,  stefan <at> marxist.se,  18336 <at> debbugs.gnu.org
>> Date: Sat, 21 Mar 2020 21:13:59 -0400
>> 
>> >> 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.
>> 
>> So maybe we could just check those conditions?  Here's a patch,
>> tentatively suggested for master.
>
> Isn't it better to check whether the file is already locked?  That
> way, we don't need any (error-prone) heuristics for when it's okay to
> ask the question and when it isn't.

If I understand the code correctly, lock_file() already checks this (the
'&& !NILP (Ffile_exists_p (fn))' part), but takes the wrong action in
that case.  So I'm not sure what we should do differently.




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.