[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode
From: |
Eli Zaretskii |
Subject: |
bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode |
Date: |
Mon, 20 Mar 2023 14:22:40 +0200 |
> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: Eli Zaretskii <eliz@gnu.org>, 62260@debbugs.gnu.org
> Date: Mon, 20 Mar 2023 12:41:34 +0100
>
> Manuel Giraud <manuel@ledu-giraud.fr> writes:
>
> > Thanks for your inputs. I have tried with
> > 'auto-save-file-name-transforms' like this:
> >
> > (add-to-list 'auto-save-file-name-transforms
> > '("\\`/\\(?:doas\\|ksu\\|su\\(?:do\\)?\\):.*\\'" "/dev/null" nil))
> >
> > But now, auto-save tries to create "/dev/#null#". How can I fix it to
> > "/dev/null"?
>
> auto-save-file-name-transforms does not know the meaning of "/dev/null",
> it handles it like an ordinary file name. The following code snippet
> shall do what you want instead (untested):
>
> --8<---------------cut here---------------start------------->8---
> (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)
> --8<---------------cut here---------------end--------------->8---
>
> @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?
Fine by me, but this is not for emacs-29.
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, (continued)
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Eli Zaretskii, 2023/03/18
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Eli Zaretskii, 2023/03/18
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Manuel Giraud, 2023/03/18
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Eli Zaretskii, 2023/03/18
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Eli Zaretskii, 2023/03/18
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Manuel Giraud, 2023/03/19
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Eli Zaretskii, 2023/03/19
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Michael Albinus, 2023/03/19
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Manuel Giraud, 2023/03/19
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Michael Albinus, 2023/03/20
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode,
Eli Zaretskii <=
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Michael Albinus, 2023/03/20
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Manuel Giraud, 2023/03/20
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Eli Zaretskii, 2023/03/19
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Michael Albinus, 2023/03/20
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Manuel Giraud, 2023/03/19
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Michael Albinus, 2023/03/20
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Manuel Giraud, 2023/03/22
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Michael Albinus, 2023/03/23
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Manuel Giraud, 2023/03/24
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Manuel Giraud, 2023/03/24