This is either a bug or I'm doing something wrong. I've created a bundle
command with the following line:
osascript -e 'tell application "TextMate"' -e 'set bounds of window 1 to
{640, 1, 1279, 832}' -e 'set bounds of window 2 to {1, 1, 640, 832}' -e
'end tell';
TextMate beachballs until I run 'killall osascript' in the terminal. If
I run the above line in the terminal directly, it works as expected. Is
there some kind of break in the chain of Command -> Shell -> Applescript
-> TextMate?
Can anybody think of a better way to emulate BBEdit's "Arrange Windows"
command?
Thanks,
Quinn
Hi folks,
Don't know what happened to my original email, but it seems it got
gobbled up before it even reached the mailing list, so here goes again:
I'm not sure if this is a bug in TM or the java grammar since upon
reviewing the Java Lang definition itself, it seemed to be correct in
the "hey-that-looks-right" sense .. not the "oh-yeah-I-know-what-I'm-
talking-about-and-that's-definitely-right" sense.
I just pulled the latest (everything) from svn. I didn't realize if
the Java.tmbundle was updated, but there are some things going on
which look a bit buggy.
FIRST:
When the cursor is immediately outside of a block comment, the scope
still shows "comment.documentation.java" or "comment.block.java" when
I don't think it should be (imagine the ^ character to be the cursor):
Example:
/* some comment here */^
-- or --
/**
* My method does this
*/^
the scope on the outside of the closed comment is being recognized as
comment.block.java and comment.documentation.java respectively when
really I'm out of the comment blocks.
SECOND:
All the code after an abstract method is scoped to
meta.definition.method.java, like for Example:
public abstract void doSomething();
// all code in the file below this is scoped to the
meta.definition.method.java
if I add a {} at the end of the abstract method signature the scope
gets fixed -- but, y'know ... then the compiler complains :-)
Thanks,
-steve
Hi,
I'm new to Textmate and enjoying it a lot.
This weekend, I was playing around with the good old Sieve of Eratosthenes.
That was the very first computer program I ever wrote (way back in 1970 in
Fortran IV - ran it on an IBM1130 with 8K - yes that's K! of core memory).
It computed all the primes less than 10,000 and its runtime (determined by
using my wristwatch while looking through the window into the computer room
- timed from when the operator loaded the cards into the reader until the
output started on the line printer) was about 90 seconds, not counting the
printout which probably took longer than the compute time.
Just out of curiosity, I wrote a cheesy, q&d little python script to do the
sieve:
#!/usr/local/env python
import sys, os
"""
The sieve of Eratosthenes. Compute all primes less than some integer
(given here by 'bound')
"""
def printem(sieve):
# Any sieve entries still not 0 must be primes
# (Eratosthenes - antiquity)
px = 0
for p in range(0, len(sieve[2:])):
if sieve[p] != 0:
print sieve[p],
px += 1
if (px % 10) == 0:
print
def sievem(bound=0):
if bound == 0:
sys.stdout.write('How many integers should I sieve? ')
bound = int(sys.stdin.readline()[:-1])
sieve = range(0, bound+1)
remove = 2
while remove * remove < bound+1:
for pm in range(remove*remove, bound+1, remove):
if pm < bound + 1:
sieve[pm] = 0
# Find "next" prime from the remaining sieve elements
for np in range(remove+1, bound+1):
if sieve[np] != 0:
remove = np
break
printem (sieve)
print
if __name__ == '__main__':
sievem(10000)
I ran 'time python sieve.py' and got:
real 0m0.816s
user 0m0.127s
sys 0m0.215s
This on my dual 867mhz Mac G4 with 2Gb RAM. Not surprising that it's faster.
But comparing python to compiled Fortran seems a little unfair, so I ginned
up a little C program and compiled that for N=10000 and timed it:
(list of primes < 10000)
...
found 1229 primes
real 0m0.331s
user 0m0.005s
sys 0m0.022s
That's about 272 times as fast as the old IBM machine, but that's not the
point of this story.
I decided to see how far I could push the calculations on my machine without
tying it up for a week and without spending a lot of time fiddling with the
algorithm. I finally wound up computing all the primes less than 1 billion
and redirecting the output to a file. (Googling confirmed that the number of
primes computed by my code was correct). The resulting file is fairly large:
-rw-rw-r-- 1 dick staff 507044566 Mar 27 17:54 primes_upto_a_billion.txt
So, I decided to see how various programs would handle loading, displaying
and (shudder) manipulating this file. First, I burned it to a CD using Toast
with little or no difficulty.
Then I experimented with BBEdit (Lite), irEdit, Eclipse3.1, SeaMonkey
(Mozilla browser), Alpha, etc. etc. with very mixed results. Most of them
either loaded the file (and then were very sluggish about navigating it),
had to be force killed, or cleanly gave up. The latter was the case for most
of the Java based apps, since they probably defaulted to starting the JavaVM
with too little heap: it's obviously gonna take at least 600mb or more. The
programs that succeeded usually showed both Real and Virtual memory sizes in
the range of 900+ Mb.
Finally, I got around to trying TextMate. Well, the results were
disappointing. It crashed before finishing its load:
TextMate(21976,0xa000ef98) malloc: *** vm_allocate(size=1073741824) failed
(error code=3)
TextMate(21976,0xa000ef98) malloc: *** error: can't allocate region
TextMate(21976,0xa000ef98) malloc: *** set a breakpoint in szone_error to
debug
terminate called after throwing an instance of 'std::bad_alloc'
what(): St9bad_alloc
My interpretation of this console output is that TextMate was trying to
acquire over a gigabyte of memory with a single request. Not clear (a) why
this much would be needed for a slightly over 500mb file and (b) why my
machine couldn't respond, since I regularly have Inactive size at or near
1Gb and lots more available from programs that at idle could be forced to
page out their real memory to disk.
Anyway, I thought it was all interesting and I would like to hear people's
reactions about the whole topic of editor scalability and editing huge
files. This does have real-world ramifications. E.g. the product I work on
is a large Financial Analysis programming language written in C and bits of
C++, which implements a proprietary database format for time-series data
storage. When there are problems in debugging, we generate "slog" files
(selective logs) which routinely in the worse cases can approach 1Gb in
size. We've never really found a reasonably way to deal with the largest of
these and usually resort to other methods, but it would be nice some day to
be able to actually edit them with some measure of efficiency. I'm sure most
readers of this list have had similar experiences.
In addition, when I had finished experimenting with the other editors /
browsers / IDEs, and went to quit my existing TextMate session, it took
quite some time. I got several spinning beachballs in the process. My take
on this is that my experimenting caused lots of TextMates working storage to
be paged out and that it had to fault all that stuff back into it's working
set. That kind of thing seems to happen with TextMate in general: e.g. when
I accidentally hover too long in the File menu on Open Recent... TextMate
spins that beachball for all it's worth - often taking 10 or 15 seconds to
come back to life. What's up with that? Does it try to generate this from
project files and have to read through the equivalent of 1000's of status
entries, many perhaps out on disk? Whatever - it's quite annoying and I've
tried to force myself to use Cmd-O whenever possible.
Sorry for the length of this, I just couldn't resist. (How many of you made
it all the way to the end?)
-- Dick Vile at home in Dexter, MI USA
I'm a long-time web developer and BBEdit user wanting to learn TextMate for
a Ruby on Rails project. I've grown used to relying on BBEdit's show
invisibles command as meaning "show me tabs, spaces, line-endings, and other
non-printing characters (gremlins)" as symbols. I was expecting the same
behavior out of TextMate as BBEdit or SubEthaEdit, but it doesn't seem to
work the same.
I've searched the TextMate documentation and the mailing list archive for
any mention of "showing spaces", (i.e. the ability to show spaces, a la
BBEdit's "Show Invisibles" command) but I've been unable to find any results
that address my problem.
However, TextMate seems to show tabs and line endings but not any more of
the non-printing characters that BBEdit shows. I was able to find the
ShowInvisibles Bundle for TexMate that aims to highlight tabs and spaces in
different colors but it doesn't appear to work with my setup and/or
preferences.
ShowInvisibles Bundle (11-27-04)
http://macromates.com/wiki/pmwiki?n=Bundles.ShowInvisibles
Has anyone had any success in configuring TextMate to "Show Invisibles" or
"Show Spaces" like BBEdit or SubEthaEdit allow? If there's a a build of
TextMate that already does is, I can't find it and in that case would
appreciate a hint or help getting it working. Thanks!
- Ryan J. Bonnell
ryan(a)creativearc.com
http://creativearc.com/
Hi All,
I'd like to be able to export my bundle customizations to another
installation of TextMate.
What's the easiest way to do this?
Thank you.
Diana T
Not sure why this is happening, but on my MacBook pro, i have weird
"php" symbol in the language chooser thingie..
I've attached a screen shot. Basically, instead of the usual "X" i
got some funky [->] thing.
Any reason for this?
Eric Coleman
Hey all,
i wonder if their is encoding detection in TextMate usable in anothe
app.
i'd like to discriminate between :
iso-8859-1, iso-8859-15, cp-1252 and Mac Roman
for the time being, using a ruby regex i'm only able to detect US-
ASCII and UT-8....
in case u have some light upon that...
Yvon
Allan,
thank you for clarifying things even more.
I believe THIS:
>> [...] What exactly IS the most useful way and best way in regards
>> to updating "official" bundles via svn to make customized bundles?
>
> Create an entirely new language grammar and have that one include
> the default one. Then set your files to use the custom grammar
> instead of the official.
Should be in the manual or FAQ. (Or is it and I have missed it?)
>> [...] A couple questions still bog my mind, though:
>> - Am I correct assuming that I can use a certain pattern just
>> once? When I copy a rule from Latex.plist to my custom.plist -
>> only the one encountered first gets to markup the text.
>
> Yes, just like a regular parser :)
Oh, OK, whatever a regular parser is - I am just a chemist, not a
programmer. ;)
>> - Is there a way to markup a pattern with more than just one
>> scopes? Like for \begin{mycustomlist} set something like
>> meta.environment.list *and* meta.package.custom
>
> Generally one would use a longer scope name and put the extra
> information deeeper in the scope name. But you can use captures to
> overcome the limitation.
Thanks for the hint; I guess I will need to figure out if the whole
thing is necessary at all… ;)
>> I am using a svn checkout of the bundle -
>>> e181090182:/Library/Application Support/TextMate dekay$ ls
>>> Bundles Conventions.txt LICENSE Themes
>>> Tools
>
> No Support folder?
I had a support folder in ~/Library/Application Support/TextMate but
did check out the svn version into /Library… as well, now.
>> [...] Also I cannot get the "Edit in Textmate"-InputManager to
>> work in Mail.app - it works e.g. in TextMate's Bundle-Editor (very
>> useful), but Mail.app would be even more so. ;(
>
> Do you see the Edit in TextMate… menu item in the Edit menu of
> Mail? If not, did you restart Mail after installing the input manager?
No, I do not see it. Even after a couple of restarts… maybe it is
because of me being on an iMac CoreDuo? But then as far as I have
seen the InputManager seems to be Universal.
now back to my breakfast,
Dan
Dear TMaters,
I am just editing some language grammar (again) and -- since this is
about the best idea ever -- am doing this in a regular textmate
window (not the bundle editor). And voila, I can select a new
language, one for which I cannot find a bundle, called "Language
Definition." Neat. But it beeps. When I select the language, when I
add new lines etc.
From console.log
2006-03-26 14:05:08.905 TextMate[455] didn't find rule named
source.plist
2006-03-26 14:05:08.906 TextMate[455] didn't find rule source.plist
Anything I should/can do about this?
thx,
Dan
PS: If I am clogging the list, tell me :)
Hi, I'm new to TextMate, coming from Vim.
Is there an equivalent to Vim's textwidth setting, which
automatically wraps a line as you type past the nth character? The
new line is indented two extra tab stops generally.
If not, is this something which would be possible with a plug-in
(when the API is ready)?
Thanks,
Ben
________________________________
We're cycling through Cambodia to raise money for Oxfam, help us
raise £5,200!
http://cambodiachallenge.org/