On 03/10/2012 09:09 AM, E. Liddell wrote:
I believe the detection is by file extension (ran into this when adding WesnothML to the list of available highlight types in an older version that didn't have it by default--its extension is also sometimes used by . . . I think it was QuakeScript).
It is not only by file extension, but also by file pattern. Thinking about it, Darrell is on to the root cause of the problem. The detection does not seem to be using any 'file <filename>' information. Archlinux uses PKGBUILD scripts as the build scripts for building packages. PKGBUILD is nothing more than a special name for a bash script. In order to have unique filenames in kate, I append the trinity package name to the end so that I clean list, eg:
PKGBUILD-tde-arts PKGBUILD-tde-avahi-tqt PKGBUILD-tde-dbus-1-tqt PKGBUILD-tde-dbus-tqt PKGBUILD-tde-libart-lgpl PKGBUILD-tde-libcaldav PKGBUILD-tde-libcarddav PKGBUILD-tde-tdeartwork <snip>
For these build scripts, I can configure a highlighting rule so that kate/kwrite properly recognize them as bash scripts by including ';PKGBUILD*;' in Configure kate -> Editor -> Highlighting -> Properties -> file extensions.
For special cases, where there is some consistent filename patter, this works, but kate should be smart enough to parse the 'head <filename>' information and at least look for a '#!<something>' or something similar. I'll have time to dig into this further once I get the remaining TDE build scripts done. That has been my big push lately. You guys don't have any other thoughts on 'tdeutils' or 'tdepim' failures I'm seeing do you :)