[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode
From: |
Michael Albinus |
Subject: |
bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode |
Date: |
Mon, 20 Mar 2023 12:41:34 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Manuel Giraud <manuel@ledu-giraud.fr> writes:
> Hi Michael,
Hi Manuel,
> 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?
Best regards, Michael.
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, (continued)
- 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/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 <=
- bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode, Eli Zaretskii, 2023/03/20
- 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