Hi All,
In the project drawer, a right-click on a file icon opens a dialog where one can find : Treat Files with ".xxx" Extension as Text Where does TM store this infos afterwards? Did not find anything in "Application Support" nor in "Preferences"
The point is to have TM consider files with a variable extension as text, like the ones I have to deal with : the extension is a 8-digit number representing the date the document was edited (*.20041023 for instance)
Can we use regular expression for this (like \d{8})?
Found nothing in the Wiki nor in Help.
Thanks,
Actually, file extension association information is stored by OS X, not by individual applications. Not sure if what you want can be done, although you could ask around forums like the one at http://macosxhints.com/ or the official apple one.
On 9/16/05, José Campos jose.campos+tm@galacsys.com wrote:
Hi All, In the project drawer, a right-click on a file icon opens a dialog
where one can find : Treat Files with ".xxx" Extension as Text Where does TM store this infos afterwards? Did not find anything in "Application Support" nor in "Preferences"
The point is to have TM consider files with a variable extension as
text, like the ones I have to deal with : the extension is a 8-digit number representing the date the document was edited (*.20041023 for instance)
Can we use regular expression for this (like \d{8})? Found nothing in the Wiki nor in Help. Thanks,
-- Jo <W:00�04'37" ; N:47�15'36">
1....'....12.....'....24.....'....36.....'....48.....'....60.....'....72
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Hi,
You may be able to use the 'Edit File Associations...' feature in the 'TextMate' menu
I just tried it with php files. I made the 'File extensions' textbox blank, and inserted '<?php' into the 'First line pattern' textbox. I made the language 'PHP'
It works. I guess this will only work for you if there's a common pattern on the first line of these documents that you can match.
I also found that the 'First line pattern' is ignored if there's anything in 'File extensions'
Hope that helps, Ian
Ian White eenywhite@gmail.com wrote:
You may be able to use the 'Edit File Associations...' feature in the 'TextMate' menu
I just tried it with php files. I made the 'File extensions' textbox blank, and inserted '<?php' into the 'First line pattern' textbox. I made the language 'PHP'
It works. I guess this will only work for you if there's a common pattern on the first line of these documents that you can match.
Unfortunately, there's no common pattern :(
Thanks for the helping,
Robert Deaton false.hopes@gmail.com wrote:
Actually, file extension association information is stored by OS X,
not by individual applications. Not sure if what you want can be done, although you could ask around forums like the one at http://macosxhints.com/ or the official apple one.
Thanks, I'll try this,
That's true, but that's not what he was asking about. He was asking about where TextMate stores info it knows about extensions, not where the system stores what extensions map to what applications.
On Sep 16, 2005, at 3:27 AM, Robert Deaton wrote:
Actually, file extension association information is stored by OS X, not by individual applications. Not sure if what you want can be done, although you could ask around forums like the one at http://macosxhints.com/ or the official apple one.
My best guess is the OakProjectTextFiles key in TextMate's preferences file. And no, I expect it's a simple string match, meaning no regular expressions.
I'd really like to see TextMate do a check on unknown files to see if they have any control characters in them (ASCII value < 32 or >= 127). If there are none, it should treat it like a text file, and if there are any, it should treat it like a binary file. To make it more efficient it could also only do this check on the first X bytes of the file (some experimentation probably necessary to determine what's an appropriate value - the point being so TM doesn't have to check the entire file if you select a multi-megabyte file).
On Sep 16, 2005, at 2:04 AM, José Campos wrote:
In the project drawer, a right-click on a file icon opens a dialog
where one can find : Treat Files with ".xxx" Extension as Text Where does TM store this infos afterwards? Did not find anything in "Application Support" nor in "Preferences"
The point is to have TM consider files with a variable
extension as text, like the ones I have to deal with : the extension is a 8-digit number representing the date the document was edited (*.20041023 for instance)
Can we use regular expression for this (like \d{8})? Found nothing in the Wiki nor in Help.
On 16/09/2005, at 10.35, Kevin Ballard wrote:
My best guess is the OakProjectTextFiles key in TextMate's preferences file. And no, I expect it's a simple string match, meaning no regular expressions.
Indeed, yes!
OS X is heavily extensions based, and so, introducing files with arbitrary extensions and wanting them to be treated the same is not only a problem in TextMate, it's also a problem e.g. association a program with that file type in Finder. A better scheme would be: «filename»_YYYYMMDD.«extension»
That said, if you have the developer tools you can manually set the file type to TEXT which will make TM open these, e.g.:
find «dir with your files» -regex '.*.[0-9]*$' -exec SetFile -t 'TEXT' '{}' ;
The key bit here is:
SetFile -t TEXT «filename»
I'd really like to see TextMate do a check on unknown files to see if they have any control characters in them (ASCII value < 32 or >= 127). If there are none, it should treat it like a text file
Partially agree -- though maybe the heuristic should instead be, if the file is valid utf-8 (there are useful characters below 32, and above 160, for cp1252 above 128 even).
According to José Campos:
The point is to have TM consider files with a variable extension as
text, like the ones I have to deal with : the extension is a 8-digit number representing the date the document was edited (*.20041023 for instance)
Side note: this information does not belong to the filename namespace. It should be handled through other means such as a revision control system or the ctime/mtime/atime metadata stored in the inode...