emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Joseph Turner <joseph@ushin.org>
To: emacs-orgmode@gnu.org
Cc: Max Nikulin <manikulin@gmail.com>
Subject: Re: Adding text/org MIME type to jshttp/mime-db
Date: Sun, 04 Aug 2024 20:19:53 -0700	[thread overview]
Message-ID: <87ikwfoduu.fsf@ushin.org> (raw)
In-Reply-To: <821aa597-349e-4ded-8c5f-16e80a59965e@gmail.com> (Max Nikulin's message of "Sun, 4 Aug 2024 17:33:29 +0700")

Max Nikulin <manikulin@gmail.com> writes:

> On 04/08/2024 00:37, Joseph Turner wrote:
>> jshttp/mime-types utility does this:
>>    // source preference (least -> most)
>>    var preference = ['nginx', 'apache', undefined, 'iana']
>> and then discards duplicate mappings which are of lower preference.
>
> I can not say that I have consistent vision which way media type
> database should be designed. It is rather close to off-topic on this
> list (though `org-file-types' is a kind of override map, built-in
> mailcap.el is far from being perfect, and Emacs ignores
> shared-mime-info completely).
>
> - Both fallback and override entries should be implemented.
> - It seems there are differences which way custom entries should be
>   handled during compiling database and when an application uses third
>   party mappings. The reason is that version of external database may
>   be older or newer than version of an application. Some conflicts may
>   cause fatal error during compiling of database while applications
>   have to be more intelligent in respect to conflict resolution.
> - Priorities of media type to suffix and suffix to media type may be
>   different.
> - My impression is that multiple types may have the same suffix, so
>   there should be "get all media types for given suffix" method.
> - It should be possible to specify priorities within the same source.
>
> I am a bit surprised that jshttp/mime-types developers use added
> entries as fallback, not as overrides for IANA, but it is their design
> decision. Since it is a DB, not DB user, they can just drop
> conflicting entries. Perhaps they still want to preserve ambiguous
> mapping of multiple media types to the same suffix (otherwise
> text/x-org should be dropped due to a conflict).

Yes, I am also surprised that jshttp/mime-types does not offer a way to
customize MIME type source preference.

However, on the topic of Org mode support in Agregore, I am not sure
that the ability to specify a different preference or even a "get all
media types for given suffix" function would help.  In this case, we
want the browser to treat .org files as text files and attempt to render
them.  Currently, .org files are treated as non-text files and the
browser attempts to download them when the user opens one.  This means
that our code to render Org files doesn't even get a chance to run.

For now, perhaps we can override the MIME type map in the extension:

https://github.com/AgregoreWeb/extension-agregore-renderer/issues/8#issuecomment-2267958828

>> Max Nikulin writes:
>>> I think, text/org may be added as well (without removing of
>>> text/x-org).
>> Shall we consider this this after we find a way for these
>> low-preference
>> mappings to be useful?
>
> I still believe that the following behavior is preferable
>
> - applicaion/vnd.lotus-organizer -> .org
> - text/x-org -> .org
> - text/org -> .org
> - .org -> text/org (preferably without relying on x- heuristics)
>
> Unless a user explicitly configured local mapping .org to
> applicaion/vnd.lotus-organizer

I agree with your preference!

Thanks,

Joseph


  reply	other threads:[~2024-08-05  3:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-01 19:55 Adding text/org MIME type to jshttp/mime-db Joseph Turner
2024-08-02 10:46 ` Max Nikulin
2024-08-03 10:25 ` Max Nikulin
2024-08-03 17:37   ` Joseph Turner
2024-08-03 18:05     ` Joseph Turner
2024-08-04 10:33     ` Max Nikulin
2024-08-05  3:19       ` Joseph Turner [this message]
2024-08-05 10:35         ` Max Nikulin
2024-08-05 19:29           ` Joseph Turner
2024-08-05 18:35     ` Ihor Radchenko
2024-08-09 12:57       ` Joseph Turner
2024-08-10 13:15         ` Ihor Radchenko
2024-08-10 18:46           ` Joseph Turner
2024-08-11 15:05             ` Ihor Radchenko
2024-08-13 19:02               ` Joseph Turner
2024-08-13 19:11                 ` Ihor Radchenko
2024-08-14 15:36                   ` Ihor Radchenko
2024-08-17  1:19                     ` Joseph Turner

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.orgmode.org/

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

  git send-email \
    --in-reply-to=87ikwfoduu.fsf@ushin.org \
    --to=joseph@ushin.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=manikulin@gmail.com \
    /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/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).