Document Class file filter (*.txt Vs EDIT??)

General questions about using TextPad

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

Post Reply
User avatar
meermanr
Posts: 4
Joined: Sat Dec 06, 2003 6:11 pm
Location: Warwick, UK / Paphos, CY / Sarawak, ML
Contact:

Document Class file filter (*.txt Vs EDIT??)

Post by meermanr »

Is it possible to set the file filter in a Document class to allow regexp like filename matching?

Specifically I'd like to have files which end with "todo.txt" to use a custom syntax definiton, also there are cases where I have a very rigid file pattern with no extension ( ie EDIT00, EDIT01, EDIT02 ... ) and would like to set a syntax def for them too!

I've tried "*todo.txt" and even being careful to ensure my many todo lists have the word todo in the same case I have been unsuccessful - I also tried using a double extension (*.todo.txt)..

I'm fairly sure the conflict is between my own docment class and the default text class, surely it is possible to have a file name checked for *todo.txt before being checked for *.txt?

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

Post by MudGuard »

If you open a file, the list of document classes is checked whether your file matches from bottom to top and the first match is taken.

This means your *.todo.txt document class must have a class name that comes later in the list than the *.txt document class. E.g. use z_todo as name for your document class to put it to the end of the list.
Post Reply