all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Manuel Giraud <manuel@ledu-giraud.fr>
Cc: Eli Zaretskii <eliz@gnu.org>, 62260@debbugs.gnu.org
Subject: bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode
Date: Mon, 20 Mar 2023 12:41:34 +0100	[thread overview]
Message-ID: <87zg871wgh.fsf@gmx.de> (raw)
In-Reply-To: <87v8iw6e0v.fsf@ledu-giraud.fr> (Manuel Giraud's message of "Sun,  19 Mar 2023 14:56:16 +0100")

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.





  reply	other threads:[~2023-03-20 11:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-18 15:18 bug#62260: 30.0.50; [PATCH] Restrict auto-save file mode Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-18 15:43 ` Eli Zaretskii
2023-03-18 18:39   ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-18 18:47     ` Eli Zaretskii
2023-03-18 18:51       ` Eli Zaretskii
2023-03-18 19:22         ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-18 20:00           ` Eli Zaretskii
2023-03-18 20:21             ` Eli Zaretskii
2023-03-19 11:43               ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-19 12:19                 ` Eli Zaretskii
2023-03-19 12:40                   ` Michael Albinus
2023-03-19 13:56                     ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-20 11:41                       ` Michael Albinus [this message]
2023-03-20 12:22                         ` Eli Zaretskii
2023-03-20 12:31                           ` Michael Albinus
2023-03-20 14:15                         ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-19 14:11                     ` Eli Zaretskii
2023-03-20 11:43                       ` Michael Albinus
2023-03-19 14:18                     ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-20 11:44                       ` Michael Albinus
2023-03-22 10:13                         ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-23 16:26                           ` Michael Albinus
2023-03-24  7:34                             ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-24 10:35                             ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-24 17:56                               ` Michael Albinus
2023-03-18 19:16       ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zg871wgh.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=62260@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=manuel@ledu-giraud.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.