unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 60929@debbugs.gnu.org
Subject: bug#60929: 30.0.50; [FR] `file-name-extension' and backup suffixes
Date: Wed, 25 Jan 2023 13:37:03 +0000	[thread overview]
Message-ID: <87pmb2loqo.fsf@localhost> (raw)
In-Reply-To: <83mt66g2ya.fsf@gnu.org>

Eli Zaretskii <eliz@gnu.org> writes:

>> >   . given "foo.org.~10~" return the list ("foo" org-mode backup)
>> >   . given "foo.org.gpg.gz" return ("foo" org-mode epa-file compress)
>> 
>> I do not think that you can deterministically associate file extension
>> with major mode. Alternative major modes do exist for some file
>> extensions (like built-in python.el vs. python-mode.el). Just extension
>> list may suffice in the simplest scenarios.
>
> The intent was to use auto-mode-alist, of course.  Or are you saying
> that you'd like, for example, to treat *.org files as Org files even
> if the user customized auto-mode-alist to use a different mode?

Fair point. But then the extension information will be lost.
"backup" may mean multiple different things, including "bak" or "~10~"
or "~". "compress" may also involve different algorithms.

>> In addition, given "foo.txt.org.gpg.gz" may return
>> ("foo.txt" "org" "gpg" "gz") not stripping the first .txt as it never
>> affects how Emacs opens the file.
>
> Talking about "opening the file" again narrows the scope of the
> requested feature, IMO.  We don't want to assume that the application
> would like to open the file.  Besides, Text mode does affect how Emacs
> treats the file.

Agree.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>





  parent reply	other threads:[~2023-01-25 13:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18 10:50 bug#60929: 30.0.50; [FR] `file-name-extension' and backup suffixes Ihor Radchenko
2023-01-18 11:08 ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-18 12:47 ` Eli Zaretskii
2023-01-18 13:01   ` Ihor Radchenko
2023-01-18 14:47     ` Eli Zaretskii
2023-01-23 10:05       ` Ihor Radchenko
2023-01-23 13:34         ` Eli Zaretskii
2023-01-24 11:12           ` Ihor Radchenko
2023-01-24 12:37             ` Eli Zaretskii
2023-01-25 13:18               ` Ihor Radchenko
2023-01-25 13:26                 ` Eli Zaretskii
2023-01-25 13:33                   ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-01-25 13:43                     ` Ihor Radchenko
2023-01-25 13:37                   ` Ihor Radchenko [this message]
2023-01-18 14:20   ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87pmb2loqo.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=60929@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).