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

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

bug#60929: 30.0.50; [FR] `file-name-extension' and backup suffixes


From: Ruijie Yu
Subject: bug#60929: 30.0.50; [FR] `file-name-extension' and backup suffixes
Date: Wed, 18 Jan 2023 19:08:36 +0800
User-agent: mu4e 1.8.13; emacs 29.0.60

Ihor Radchenko <yantar92@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





reply via email to

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