I'm looking at Kate's highlighting feature and trying to figure out how it works
with
files that have no extension.
If I load a bash script into Kate it appears with lovely highlighting, and looking in
Settings => Configure Kate => Highlighting I see that it has somehow associated it
with
| application/x-shellscript;text/x-shellscript
I don't understand how it does this, since, looking at the mime entry for this in
KControl
Center => TDE Components => File Associations, to be matched, files must have one
of
the .sh, .csh, or .bash extensions. The bash script has the so-called "magic
number"
| #!/bin/bash
as its first line, but nothing in the Kate and File Associations handbooks mentions
these,
and there is no place in the Configure Kate dialog to make an association with a magic
number.
The reason I'm looking at this is that I use a different, more programmer-friendly
language, Rexx, for my scripting. Like bash scripts, I use a "magic number", in
this
case
| #!/usr/bin/rexx
to associate the text/rexx mime type with these scripts instead of an extension; but Kate
does not associate this mime type; the Highlighting entry is set to None for this file
when it is loaded, and no highlighting occurs.
How does Kate know what highlighting to use with a bash script that has no extension,
and
why doesn't that work for a Rexx script with no extension? N.B. the highlighting
works
for Rexx scripts with the extensions defined in File Associations, but unlike bash
scripts, not without them, so the mime types are functional; but I don't want to have
to
put extensions on all of my Rexx scripts just because of this Kate weirdness.
Leslie
--
Operating System: Linux
Distribution: openSUSE Leap 15.3 x86_64
Desktop Environment: Trinity
Qt: 3.5.0
TDE: R14.0.10
tde-config: 1.0