octave-maintainers
[Top][All Lists]
Advanced

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

shared-mime-info: distinguish x-octave and x-matlab files


From: Carnë Draug
Subject: shared-mime-info: distinguish x-octave and x-matlab files
Date: Wed, 28 Jan 2015 13:01:34 +0000

Hi

currently, shared-mime-info [1] treats x-octave as an alias of x-matlab.
It does this despite using "##" as magic to identify the file as Matlab.
The most obvious problem of this is with text editors picking Matlab as
syntax highlight for Octave code.  My take on the two mime types, is that
having the file written in Octave does not matter, what matters where it
can run.  This means that a file written in Octave that is Matlab compatible
deserves a x-matlab mime.

I submitted them a patch that splits them into two types and added magic
to recognize a shebang line for an octave interpreter [2].  In addition,
it also replaces the common "##" magic with "#" for Octave and "%" for
Matlab.  However this last got rejected since this seems to be too small
of magic for their new standards.  Can anyone suggest new magic that
would help in distinguish between code that is meant to be Octave only
and Matlab compatible?

Another thing I would suggest is to start adding a shebang line to our
Octave files.  This has two advantages, 1) make it easier for such
applications to recognize the file as Octave source, and 2) raise awareness
that it is possible to actually write an Octave program (I think this is a
really nice feature of Octave that it is not given enough attention).

Carnë

[1] http://freedesktop.org/wiki/Software/shared-mime-info/
[2] https://bugs.freedesktop.org/show_bug.cgi?id=88596

P.S.: to have this fixed in your local machine, create an octave.xml file
in "~/.local/share/mime/packages/" with the magic you want and then run
"update-mime-database ~/.local/share/mime/"



reply via email to

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