GNU bug report logs - #54401
28.0.91; Buffer visited file replaced with lockfile location

Previous Next

Package: emacs;

Reported by: Kenny Ballou <kb <at> devnulllabs.io>

Date: Tue, 15 Mar 2022 17:19:01 UTC

Severity: normal

Found in version 28.0.91

Full log


View this message in rfc822 format

From: Kenny Ballou <kb <at> devnulllabs.io>
To: 54401 <at> debbugs.gnu.org
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>
Subject: bug#54401: 28.0.91; Buffer visited file replaced with lockfile location
Date: Thu, 17 Mar 2022 09:15:33 -0600
On 2022-03-17, 12:20 +0100, Lars Ingebrigtsen wrote:

> Kenny Ballou <kb <at> devnulllabs.io> writes:
>> ```
>> (setq auto-save-visited-file-name t)
>> (setq auto-save-default t)
>> (setq auto-save-timeout 20)
>> (setq auto-save-interval 20)
>
> You only need the first, apparently.

I included the other values to ensure the bug is triggered.  But yes,
`auto-save-visited-file-name` seems to be "real, honest" trigger of the behavior.

> And there's more bugginess going on than described.
>
> /tmp/foo1 no longer exists!  But /tmp/foo2 does.

For some reason, I thought this was expected behavior.  But now that I've
switched off `auto-save-visited-file-name`, I have seen `write-file` act more
like a "copy" operation, not a "rename" operation.  Certainly, more is wrong
here.

>
> <type something>
> `M-x do-auto-save RET'
>
> /tmp/#foo2# now exists!  And `buffer-file-name' in the "foo2" buffer is
> now "/tmp/#foo2#'

Frustratingly, the content of `/tmp/#foo2#` contains the result of "<type
something>", and `/tmp/foo2` is at the content before "<type something>".  I've
lost a fair amount of work to this before I figured out what was happening (and
a work around) before reporting.
>
> So this is kinda totally broken.  Now, `auto-save-visited-file-name' was
> made obsolete in Emacs 26.1, but perhaps these things should be fixed
> anyway.

This "rename" behavior does not happen when using the minor mode.  Therefore,
the "fix" should probably be adding warnings against using the variable
directly or accelerating its deprecation (not sure how that would work since
the variable is probably used internally by the minor mode, no?).

I'm new here, I'm not sure how this proceeds.




This bug report was last modified 3 years and 97 days ago.

Previous Next


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