emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Org mode MIME type
@ 2024-01-21 13:56 Max Nikulin
  2024-01-21 15:11 ` Timothy
  0 siblings, 1 reply; 31+ messages in thread
From: Max Nikulin @ 2024-01-21 13:56 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

I have been surprised when I got

     xdg-mime query filetype /tmp/test.org
     text/org

for a following file

     cat /tmp/test.org
     * A section

     An example of Org mode file

It is pleasant, however shouldn't it be "text/x-org", not just 
"text/org"? (I am against "application/*" variants since it is a text 
based format).

1. The MIME type has not registered in IANA, so the "x-" prefix should 
be preferable
<https://www.iana.org/assignments/media-types/media-types.xhtml>

2. It would be in line with

     emacs -Q -l mailcap --batch \
         --eval '(prin1 (assoc ".org" mailcap-mime-extensions))' \
         --eval '(terpri)'
     (".org" . "text/x-org")

I have not found any discussion of the following commit that is a part 
of shared-mime-info 2.2 release:
https://gitlab.freedesktop.org/xdg/shared-mime-info/-/commit/4dd4fd5cb54d03cb73102c6f1f674675b5186e47
2021-05-27T20:27:31Z David Faure adding org-mode

>   <mime-type type="text/org">
>     <comment>Org-mode file</comment>
>     <sub-class-of type="text/plain"/>
>     <glob pattern="*.org"/>
>   </mime-type>

I think, "type" should be "text/x-org" here, perhaps "text/org" alias 
may be added to this entry to not break workflow of those who already 
have text/org e.g. in mail messages.

By the way, shouldn't description be "Org mode file" without a dash? See 
org-mode/doc/Documentation_Standards.org

> - Prefer "Org mode" to "Org-mode" or "org-mode".  This is simply
>   because it reflects an existing convention in [[info:emacs:Top][The Emacs Manual]] which
>   consistently documents mode names in this form - "Text mode",
>   "Outline mode", "Mail mode", etc.

Actually it is more complicated:

     file --mime /tmp/test.org
     /tmp/test.org: text/plain; charset=us-ascii

It is expected, since "file" relies solely on file signatures (magic 
bytes) and text files have no specific ones. A more perplexing result is

     emacs -Q -l mailcap --batch \
     --eval '(prin1 (mailcap-file-name-to-mime-type "/tmp/test.org"))' \
     --eval '(terpri)'
     "application/vnd.lotus-organizer"

in agreement with run-mailcap that reads /etc/mime.types

     see --norun /tmp/test.org
     Error: no "view" mailcap rules found for type 
"application/vnd.lotus-organizer"

I am unsure if it is possible to convince maintainers of
https://salsa.debian.org/debian/media-types
and
https://pagure.io/mailcap
to change mapping of .org originating from IANA, but certainly it would 
be easier for text/x-org than for text/org. IBM seized support of Lotus 
Organizer many years ago and only early versions around 1992 used .org 
suffix, later ones used or2...or6 extensions.

In the case of Emacs text/org was replaced by text/x-org:

https://list.orgmode.org/87aaiufaoj.fsf@gmail.com/T/#u
Subject: Re: Adding a new text/org mime type
Date: Fri, 21 Jan 2011 18:06:52 +0100
From: "Štěpán Němec"

Should we ask maintainers of shared-mime-info to update the Org mode entry?


^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2024-02-02 16:29 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-21 13:56 Org mode MIME type Max Nikulin
2024-01-21 15:11 ` Timothy
2024-01-22 16:21   ` Max Nikulin
2024-01-24 14:43   ` bug#68687: [PATCH] Use text/org media type Max Nikulin
2024-01-25 23:10     ` Stefan Kangas
2024-01-25 23:43       ` Ihor Radchenko
2024-01-26  7:40         ` Eli Zaretskii
2024-01-26 14:00           ` Ihor Radchenko
2024-01-30 19:39         ` Stefan Kangas
2024-01-30 20:34           ` Ihor Radchenko
2024-01-26  7:23       ` Eli Zaretskii
2024-01-31 16:30         ` Max Nikulin
2024-01-27  3:38       ` Richard Stallman
2024-01-28 16:35         ` Max Nikulin
2024-01-28 16:47           ` Eli Zaretskii
2024-01-30  3:56             ` Richard Stallman
2024-01-30 12:13               ` Ihor Radchenko
2024-01-30 17:12                 ` Org mode code evaluation (was: bug#68687: [PATCH] Use text/org media type) Mike Kupfer
2024-01-30 17:51                   ` Ihor Radchenko
2024-02-02  3:38                     ` bug#68687: " Richard Stallman
2024-02-02  4:58                       ` bug#68687: Org mode code evaluation Max Nikulin
2024-02-02 16:10                       ` bug#68687: Org mode code evaluation (was: bug#68687: [PATCH] Use text/org media type) Ihor Radchenko
2024-01-31 16:18                 ` bug#68687: [PATCH] Use text/org media type Max Nikulin
2024-01-31 16:32                   ` Ihor Radchenko
2024-02-02  3:40                 ` Richard Stallman
2024-02-02  7:15                   ` Eli Zaretskii
2024-01-30 12:52               ` Eli Zaretskii
2024-01-31 20:00     ` Stefan Kangas
2024-02-01 10:40       ` Max Nikulin
2024-02-02  7:09         ` Stefan Kangas
2024-02-02 16:28           ` bug#68687: [PATCH v2] " Max Nikulin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).