GNU bug report logs -
#62260
30.0.50; [PATCH] Restrict auto-save file mode
Previous Next
Full log
Message #67 received at 62260 <at> debbugs.gnu.org (full text, mbox):
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.