GNU bug report logs -
#60929
30.0.50; [FR] `file-name-extension' and backup suffixes
Previous Next
Full log
Message #8 received at 60929 <at> debbugs.gnu.org (full text, mbox):
Ihor Radchenko <yantar92 <at> posteo.net> writes:
> Hi,
>
> Would it be possible to make `file-name-sans-extension' strip extension
> upon removing backup suffixes (optionally)?
>
> Currently, Emacs' handling of backup extensions is a bit inconsistent:
>
> auto-mode-alist recognizes
>
> ("\\.~?[0-9]+\\.[0-9][-.0-9]*~?\\'" nil t)
> ("\\.\\(?:orig\\|in\\|[bB][aA][kK]\\)\\'" nil t)
>
> as backup extension and thus opens files like foo.org.bak with Org mode.
>
> [...]
>
> It would be useful if functions like `file-name-extension',
> `file-name-sans-extension', and similar could optionally strip backup
> suffixes that contain ".".
> [...]
Note that since the backup extensions can be stripped recursively in
`auto-mode-alist' (that is, "test.c.bak.Bak.BAK.baK" is opened in c-mode
because of the recursive extension stripping), if this FR is to be
accepted, we would need to ensure that the above scenario is covered.
Best,
RY
This bug report was last modified 2 years and 142 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.