Matlab files are misdetected as TeX files
Submitted by Erik Quaeghebeur
Assigned to Shared Mime Info group
Description
Matlab source files use the extension .m and comment character % (often at the beginning of a file).
Also for TeX files the % character starts a comment and magic is included to detect arbitrary files with that as a TeX file:
``TeX document`` ... `` `` ... ``This matches .m files starting with %.
Identical strength magic is also performed for Matlab files:
``MATLAB script/function`` ... `` `` ... ... ``It turns out that this is not strong enough, even if the files have an extension .m, which is not used for TeX files.
I therefore request that the entries for text/x-tex and text/x-matlab are modified in such a was as to guarantee that any file with .m an extension starting with % is considered to be more likely a Matlab file than a TeX file. One option would be to decrease (increase) a little the priority in the x-tex (x-matlab) case (N.B.: bug 7387).
To indicate that there are others hit by this issue:
https://olezfdtd.wordpress.com/2010/05/11/fix-matlab-and-latex-file-associations-on-kde/