GNU bug report logs - #62260
30.0.50; [PATCH] Restrict auto-save file mode

Previous Next

Package: emacs;

Reported by: Manuel Giraud <manuel <at> ledu-giraud.fr>

Date: Sat, 18 Mar 2023 15:19:01 UTC

Severity: normal

Tags: patch

Merged with 57395

Found in versions 28.1, 30.0.50

Full log


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

From: Manuel Giraud <manuel <at> ledu-giraud.fr>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 62260 <at> debbugs.gnu.org
Subject: Re: bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode
Date: Mon, 20 Mar 2023 15:15:59 +0100
Michael Albinus <michael.albinus <at> gmx.de> writes:

[...]

> (defun my-find-file-hook ()
>   (and buffer-file-name
>        (member (file-remote-p buffer-file-name 'method) '("doas" "ksu" "su" "sudo"))
>        (auto-save-mode 0)))
> (add-hook 'find-file-hook 'my-find-file-hook)

Hi Michael,

Thanks for this method, I'll try that.

> @Eli: We have already remote-file-name-inhibit-auto-save-visited. Shall
> we define another user option remote-file-name-inhibit-auto-save, which
> could be used similarly?

It is a good idea and will be more simple for the end user than the hook
you proposed above.  That said, I think an important aspect of bug#57395
is to consider what remote/sudo file is "dangerous" and what isn't.

So maybe, it would be better to have an option
'dangerous-file-name-inhibit-auto-save' and have a "piece of code" (so
easy to say 😅) that check whether a file is a dangerous one or not…  Or
maybe it is over engineering things.

Best regards,
-- 
Manuel Giraud




This bug report was last modified 2 years and 83 days ago.

Previous Next


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