Re: The default mimeType seems overly aggressive.

Darcy Shen via Texmacs-dev <[email protected]>
Newsgroups gmane.editors.texmacs.devel
Message-ID <[email protected]>
> Some system will treat _text/plain_ very serious and override default

app for all text files, including .sh .py .cpp .h .conf .ini .xml

.html etc.



slbtty, could you explicitly list these systems?





---- On Mon, 2021-03-15 19:39:14 denis Raux <[email protected]> wrote ----



As I’m not a Linux user I cannot really see the tricky side effects.  As far I  remember desktop environment behaves differently according the linux distribution and desktop manager. As far I remember, it was quite difficult to overload the defaults mime types (defined for tex or historic texmacs)  and that is done by InitialPreference=99 for KDE Environment. Unfortunately this priority applies to every mime types defined  in texmacs.desktop.



On the most downloaded/used Linux distributions (Ubuntu), texmacs installation doesn’t change the default text/plain manager (at least with gnome desktop).



That’s said, texmacs is capable of dealing perfectly with text files but it’s true there are plenty others set in Linux systems.



I wonder if simply remove texmacs as support of text/plain cannot have side effect for example cut/paste functionality.

The solution would be to lower the texmacs priority for text/plain type in order to keep the current default. I’ll investigate in this way.





Denis



Le 13 mars 2021 à 16:29, Darcy Shen <mailto:[email protected]> a écrit :



I agree with you.



And here is your PR: https://github.com/texmacs/texmacs/pull/50



Thanks for your contribution.



If your PR actually fixes a bug, I would like to review and apply the patch to SVN.



-------



Denis, what's your opinion?





---- On Wed, 2021-02-17 16:56:47 slb <mailto:[email protected]> wrote ----



Hi,

According to `TeXmacs/misc/mime/texmacs.desktop` [0], texmacs will set

> MimeType=text/x-texmacs.doc;text/x-texmacs.sty;text/plain;text/x-tex;

It includes a _text/plain_ !

Some system will treat _text/plain_ very serious and override default
app for all text files, including .sh .py .cpp .h .conf .ini .xml
.html etc.

The reason is that text/x-python, text/x-c++src,  text/html are all
subtype of _text/plain_.

TeXmacs is obviously not a general purpose text editor like VIM or
Emacs. I do not want to use TeXmacs as source code editor or editing
my configuration files.

Please remove _text/plain_.

---

In the same time, texmacs rely on scheme source codes, I suggest to
include an "x-scheme".

x-scheme are defined at xdg-shared-mime-info.xml [1] as below. The
shared-mime-info database should be included on most of the modern
GNU/linux distros.
<comment>Scheme source code</comment>
<sub-class-of type="text/plain"/>
<glob pattern="*.scm"/>
<glob pattern="*.ss"/>
</mime-type>
<mime-type type="text/x-scheme">

[0] http://svn.savannah.gnu.org/viewvc/texmacs/trunk/src/TeXmacs/misc/mime/texmacs.desktop?view=markup
[1] https://github.com/freedesktop/xdg-shared-mime-info/blob/103b3058353ee7ca2b154b2e3d26d12cd1de958d/data/freedesktop.org.xml.in#L6462
[3] Shared MIME-info Database specification from http://freedesktop.org
https://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec/

Thanks for great software BTW :)
slbtty

_______________________________________________
Texmacs-dev mailing list
mailto:[email protected]
https://lists.gnu.org/mailman/listinfo/texmacs-dev

_______________________________________________
Texmacs-dev mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/texmacs-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.