Document Class File Specifiers

Ideas for new features

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
tasbury
Posts: 9
Joined: Fri Feb 03, 2006 7:21 pm
Location: Bozeman, MT

Document Class File Specifiers

Post by tasbury »

I have a document class for makefiles, specified to makefile, makefile.*, and *.mak. Makefile.mak gets syntax highlighting, but Makefile does not. It would be handy if more general file specifiers than *.mak worked.

Also, I am unable to find anywhere which document class is currently in effect, or any way to force the issue should I choose, and both of those would be useful as well.

Thank you.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

Try

Code: Select all

Makefile.
tasbury
Posts: 9
Joined: Fri Feb 03, 2006 7:21 pm
Location: Bozeman, MT

Post by tasbury »

Yes, the Makefile document class I have defines file specifiers for Makefile and *.mak. "AnyFileName.mak" is picked up, "Makefile" is not.

I'm using gnumake.syn, but of course the file specification is in under
"Configure/Preferences/Document Classes". The "how to customize document properties" help page indicates that filenames should work, but I can't get them to, so perhaps I should file this as a bug report...?

I have (since this morning) realized that I can get to document properties by right-clicking on the tab, and going to "syntax".

Thank you, anyone, for any light you can shine here.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

not

Code: Select all

Makefile
but

Code: Select all

Makefile.
tasbury
Posts: 9
Joined: Fri Feb 03, 2006 7:21 pm
Location: Bozeman, MT

Post by tasbury »

I assume you're talking about the "files in class" column in the "Document Classes" branch of the Preferences dialog. Tried specifying "Makefile." instead of "Makefile". Made no difference.

The file specifiers I am using are Makefile.*, *.mak, Makefile., and *.mkf.

A file named "Makefile.lkj", for instance, gets tagged as a makefile, and highlighting is turned on, whereas "Makefile" still does not.

Thank you, though.
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

TextPad sorts the document classes alphabetically, and searches them backwards for a wildcard expression that matches the name of a file being opened. So if, for example, you have a class called Text, and it includes the file spec "*.", and if you have a class called Makefile, and it includes the file spec "Makefile", then if you open a file called Makefile, TextPad will match it with the file spec in the Text class and never notice that it also matches the file spec in the Makefile class.

Solution: put the makefile class near or at the end of the list, for example, by naming it ~Makefile.
tasbury
Posts: 9
Joined: Fri Feb 03, 2006 7:21 pm
Location: Bozeman, MT

Post by tasbury »

Thank you! That makes perfect sense, but I still can't get it to work. I defined "zzMakefile", still uses gnumake.syn, files in class still Makefile., Makefile.*, *.mak, *.mkf. Makefile.mak still gets highlit, Makefile does not.
Changed zzMakefile class to only pick up Makefile., Makefile class to pick up Makefile.*, *.mak, *.mkf. No help.

How, just out of curiousity, do I *delete* document classes?
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Take the dot off the end of the file spec: not
Makefile.
but
Makefile
.

There is a note in Configure | Preferences | Document Classes:
Note that this list of classes can only be modified when no documents are open.
Make sure that no other instances of TextPad are open either, so that you don't overwrite the new settings with the previous ones.
tasbury
Posts: 9
Joined: Fri Feb 03, 2006 7:21 pm
Location: Bozeman, MT

Post by tasbury »

MudGuard (several posts ago) said *to* use the dot. I have tried both and not seen any difference.

I have also closed and re-opened all instances of textpad and the document classes are as I have set them.

Let's face it, setting a filename without extension as a class member in a document class just plain does not work.

I thank you all for your help.

Oh, and if anyone is curious, as far as I can tell the only way to remove junk document classes is to go to

HKCU\Software\Helios\TextPad 5\Document Classes\

in the registry, and manually remove the ones you don't like.

Thanks again.
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

tasbury wrote:Let's face it, setting a filename without extension as a class member in a document class just plain does not work.
It does here.
tasbury wrote:as far as I can tell the only way to remove junk document classes is to go to

HKCU\Software\Helios\TextPad 5\Document Classes\

in the registry, and manually remove the ones you don't like.
It works here as I described above.
Post Reply