help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make-auto-save-file-name: not using name transforms for mere buffers


From: Eli Zaretskii
Subject: Re: make-auto-save-file-name: not using name transforms for mere buffers
Date: 11 Dec 2003 17:07:30 +0200

> From: Florian von Savigny <florian265@uboot.com>
> Newsgroups: gnu.emacs.help
> Date: 11 Dec 2003 12:46:02 +0100
> 
> > Because its doc string says, in its very first line:
> > 
> >    *Transforms to apply to buffer file name before making auto-save file 
> > name.
> >                         ^^^^^^^^^^^^^^^^^^^
> > So buffers with no file name are not subject to such transforms.
> 
> Ok, so it doesn't do it because it is not told so ;-) but I still
> wonder why it is told not to do so (I mean why, in the first place,
> the author decided not to apply this feature to file names derived
> from mere buffer names).

Probably because the rules that are supposed to be applied to file
names aren't fit for buffer names.  In other words, the applications
of auto-save-file-name-transforms that the programmer had in mind did
not include the kind of situation in which you've found yourself.

> Wow, thanks for this hint; it does sound like a sane approach. But I
> still need to understand when, in the particular case of auto-save
> file names derived from buffer names, convert-standard-file-name takes
> effect. AFAICS, it is not called directly from within
> make-auto-save-file-name.

It _is_ called directly, at least in my version of Emacs, albeit only
for non-Unix platforms.  But that should be easy to fix: simply
modify the condition under which make-auto-save-file-name calls
convert-standard-file-name.

If your version of make-auto-save-file-name doesn't call
convert-standard-file-name on any OS, perhaps you have an old Emacs
(or else I have a too new Emacs ;-).

> However, I've made a start. I've decided that no direct function
> to the kernel to query mounted filesystems seems available, and
> between looking at the output of /proc/mounts and calling mount with
> no arguments, I've decided to do the latter (I don't know if any
> approach is favourable over the other).

Why not call `df' instead?  I think "df ." should produce a line where
one field gives you the type of the filesystem that you want.

> For looking up transforms, I'd like to have a list of alists of a
> value and a list of alists each ;-) ... is that possible?

I'd try to use regexps and replace-match instead.

> This one
> here doesn't work:
> 
>   (defvar file-name-char-transforms
>     '(("vfat" . (("*" . "_") (":" . "%") 
>                 ("ä" . "ae") ("ö" . "oe") ("ü" . "ue") ("ß" "ss")))
>       ("fat" . (("*" . "_") (":" "%"))))
>     "Complexly structured list containing rules how to translate
> filename characters in the context of given file systems.")

What doesn't work, exactly?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]