Subject: bug#47493: 27.1; auto-save-file-name-transforms with uniquify should not create invalid filenames

From: Michael Albinus <[email-masked]>
Date: Tue, 30 Mar 2021 09:55:26 +0200

Vladimir Nikishkin <[email-masked]> writes:

> Dear Emacs developers,

Hi Vladimir,

> In order to avoid littering my file system with autosaves, I have the
> following setting in my .emacs:
>
> #+begin_src
> (setq auto-save-file-name-transforms '((".*" "~/.emacs.d/autosave/" t)))
> #+end_src
>
> The t flag is the 'uniquify' flag, which roughly means "replace all
> slashes by exclamation marks".
>
> However, this way it is possible to create a file name that is invalid
> for use in the file system tree, especially if the file you are editing
> is deeply nested.

Could you pls show an example of such invalid file name?

> Would it be possible, to, maybe, add a flag "ensure-filesystem-correctness"?

Maybe we could have a flag which means "convert the directory part of a
file name into sha1" (or whatever `secure-hash' provides).

> Your sincerely,
> Vladimir

Best regards, Michael.