<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Allan Odgaard wrote:
<blockquote
cite="mid:A3A9355C-763B-43B4-8769-4E2269B74054@macromates.com"
type="cite">There is nothing there to indicate, that the file is what
you refer to as binary. TextMate uses a heuristic where it scans the
first 4 KB or similar, and if it looks like text, it is treated as
text. But if you do not use extensions, you can’t expect programs to
figure out what the type of the file is.
<br>
</blockquote>
<br>
I'm not asking the application to determine it, just a way to manually
tell the app "this particular file is binary". As opposed to "all
files with this extension are binary".<br>
<br>
(Although I should note that whatever heuristic Perl uses to determine
whether a file is text or binary seems to work in the huge majority of
cases, so it's at least possible for the app to make an educated guess.)<br>
<br>
<blockquote
cite="mid:A3A9355C-763B-43B4-8769-4E2269B74054@macromates.com"
type="cite">You can however use double-extensions, like
‘file.real-type.txt’ and then update the language grammar of real-type
to claim the ‘real-type.txt’ extension.
<br>
</blockquote>
<br>
Alas, I can't go back and change years worth of file names. Again,
this is where I'd like a feature to say "this PARTICULAR file is
such-and-such" without saying "any file with this extension is
such-and-such". Or even a way to say "treat this particular file as a
different type for the duration of this session, but DON'T change the
type associated with the extension". I don't care if the temporary
association to an individual file is preserved across sessions.<br>
<br>
<blockquote
cite="mid:A3A9355C-763B-43B4-8769-4E2269B74054@macromates.com"
type="cite">The grammars have a ‘firstLineMatch’ regexp to look for
shebang and similar.
<br>
</blockquote>
<br>
Ah, I didn't know that! Is that a new behavior, or just something I've
missed seeing? Is there any way to extend it to a multiline match so
it could find something like an emacs modeline or vim config line
elsewhere in the file? (The vim guys like to put it at the end of the
file.)<br>
<br>
<div class="moz-signature">-- <br>
<address
style="font-family: sans-serif; font-style: italic; font-size: smaller;">
Steve King<br>
Sr. Software Engineer<br>
Arbor Networks<br>
+1 734 821 1461<br>
<a href="http://www.arbornetworks.com/">www.arbornetworks.com</a>
</address>
</div>
</body>
</html>