Version: (using KDE KDE 3.5.6) Installed from: SuSE RPMs I am writting a class for handling makefiles (C++) so I created two files for the start, Makefile.h and Makefile.cpp -- but kate recognizes them as... makefiles :-)
PS. _Makefile.h , Makefile_.h, MMakefile.h are all recognized as makefiles. Finally MakefileClass.h is for Kate C++ file.
WORKAROUND: Create a file type (configure editor->file types) to override the Other/Makefiles for *.cpp and *.h (make sure it has higher priority).
The wildcard for Other/Makefile current is set to "*makefile*;*Makefile*". Why a star in front? "makefile*;Makefile*" and a slightly lower prio than C++ would fix it.
> Why a star in front? "GNUmakefile" :-). I'll still say that making the detection lower-priority is the way to go. I don't think there is any need to remove the *'s.
I think we should look at it the other way around: We should only keep stars if they can eat an _infinite set of strings_ like with "*.cpp". If its just "GNUmakefile" that we need it for, then it should be much faster to add that sring as a constant: "GNUmakefile;makefile*;Makefile*". All that wildcard matching takes way to long anyway.
Somebody changed the default filetype pattern for Makefiles in Kate to include *makefile*, which not only fits GNUmakefile, but also things such as qmakefile.cpp, qmakefile.h, somedir/makefile.cpp, somedir/makefile.h IMHO such a generic pattern is of no real use, it matches far too many false positives. I think the list should read: GNUmakefile;makefile.*;Makefile;Makefile.* Or are there common makefiles named MakefileFoo? Also as filetypes haver higher precedence than .kateconfig files, this will confuse people that have a xxxmakefileyy in a dir, because only for that file the settings from the .kateconfig won't apply.
PS: And yes, changing the priority to -1 or -2 is also a good idea. *.cpp that actually contain Makefile code.
I agree moving away from "*Makefile*" is the right track. However why "GNUmakefile;makefile.*;Makefile;Makefile.*" as the solution? What's the second wildcard good for?
> What's the second wildcard good for? makefile.win, Makefile.cvs, etc.
Of course the second wildcard only makes sense if kate uses case-sensitive matching, which I assumed it does given that the current setting is *Makefile*;*makefile* If kate does the matching without case-sensitivity then the 2nd wildcard can go. Else you need it to match for example Makefile.cvs.
I'm really no sure what the final decision should look like. Maybe listing all cases and make it a finite set? Of what I have seen here and elsewhere the list would be: * Makefile * Makefile.in * Makefile.am * GNUmakefile * Makefile.gnu * Makefile.bsd * Makefile.bcc * Makefile.cvs * makefile.win For the wildcard matcher ordering by likelyhood is also important. What do you think? Any additions or tunings? Bad idea in general?
SVN commit 728342 by sping: First stage for fixing "*Makefile*" wildcard CCBUG: 144353 M +1 -1 makefile.xml WebSVN link: http://websvn.kde.org/?view=rev&revision=728342
> Maybe listing all cases and make it a finite set? I think it's a bad idea. I have some stuff lying around like Makefile.linux, Makefiele.solaris, etc. 'Makefile.<foo>' is a modestly common naming paradigm, but users are likely to invent things to replace '<foo>' with, that won't be known in advance.
I agree with Matthew. Also Makefile.Debug, Makefile.Release are pretty common (just look at Qt projects, sure you won't change those but you might look at them in kate). I think forcing a dot into the name and having special cases when a makefile has a "prefix" (i.e. GNU) should be ok.
SVN commit 846458 by cullmann: CCBUG: 144353 M +2 -1 makefile.xml WebSVN link: http://websvn.kde.org/?view=rev&revision=846458
Done now, allowing makefile,Makefile and GNUMakefile + .* suffixes, better than nothing.