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

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

bug#18336: 24.4.50; When editing externally changed file, Emacs asks too


From: Eli Zaretskii
Subject: 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@gmail.com>
> Cc: Eli Zaretskii <eliz@gnu.org>,  stefan@marxist.se,  18336@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.





reply via email to

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