emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Adding text/org MIME type to jshttp/mime-db


From: Joseph Turner
Subject: Re: Adding text/org MIME type to jshttp/mime-db
Date: Sun, 04 Aug 2024 20:19:53 -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 via email to

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