Enhanced Document Class Detection...

Ideas for new features

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

Post Reply

How important is it to you, to have this feature implemented into future versions of TextPad?

Important, even if the efficiency of TextPad degrades
1
13%
Important, even if the size of TextPad increases
1
13%
Somewhat important
3
38%
I'm okay either way
1
13%
Somewhat unimportant
2
25%
Bad idea, even if the size/efficiency of TextPad remains unaffected
0
No votes
 
Total votes: 8

mromanch
Posts: 8
Joined: Sat Mar 07, 2009 4:58 am

Enhanced Document Class Detection...

Post by mromanch »

I would like to be able to have the document class of a file detected based on file content. For example, Unix/Linux/Cygwin is able to detect different types of script files based on the comment in the first line. Also, most well formed XML and HTML based documents use a DOCTYPE in the first line.

Some of the Unix/Linux desktops take this a bit further by supporting methods to define and detect MIME types. This last time I did anything with this it was on Gnome, and the files were kept in /usr/share/mime-info and /usr/share/application-registry. (This may have moved because at that time (3+ years ago) the Linux community was really trying to standardize this stuff.)

I don't know how hard it is to implement the code to parse the files that I used. I do know that for a lot of file types, the mime-info and application-registry files were easy to create. Also, if you choose to use the same format, you could use all the existing files. (You could also take advantage of the open source code if you are so inclined.)

I would mostly like this for the zillions of files I edit that have no extension. However, it would also be nice if it could optionally override the extension based doc-class setting.
User avatar
ds0934
Posts: 41
Joined: Thu Nov 18, 2004 2:06 pm
Location: Virginia, USA
Contact:

Enhanced Document Class Detection

Post by ds0934 »

I would rather it not try to detect the class based on the first line of code. I encounter quite a few files that are not the expected language based upon the first few lines inside the file. I would rather it assume the class based on the filename extension, BUT, I would like to see the option to automatically toggle my active clip library based on the active document class detection. Not huge. Not a "gotta have". But I'd rather see that feature than have it try to detect by file scanning.
Post Reply