Ryan,
> Could you put together an example of a theme rule that would
> highlight the
> spaces in a document using this bundle?
Just add a new line to whatever theme you are using (in prefs,
fonts&colors, click the plus button), select that line, enter the
scope selector that the Invisibles.bundle assigns to invisibles - et
voilá!
hth,
Daniel
PS: I don't have access to the bunlde -- thus you will need to figure
out the scope yourself from the bundle editor.
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/
I tried to google but didn't really find anything in my oh so short
overview.
It would be great to have a meta-selector of sorts for the scope, so
you can "highlight" the current element when editing or something.
I'm actually beginning to really like the Brilliance Dull Beta theme
(!) and that html-tags are almost "invisible". However, it would be
really cool if it could light up when the caret is over it, or light
up an attribute with the caret on and so forth.
This must have been mentioned before, but as I said, I did google ...
a bit :)
Andreas
I use this to create the feeds for ollieman.net. I thought you guys
might like this...
You'll want to start out with a valid RSS2 feed like this:
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title></title>
<link></link>
<language>en-us</language>
<description></description>
</channel>
</rss>
Now to the real fun; it's just a snippet but it makes hand-coding RSS
feeds a breeze. Here it is:
<item>
<title>$1</title>
<description><![CDATA[
$2
<a href="$5">Read more</a>
]]></description>
<pubDate>${3:`date +%a,\ %d\ %b\ %Y\ %H:%M:%S\ %Z`}</pubDate>
<author>${4:Oliver Taylor} nospam(a)example.com</author>
<guid isPermaLink="true">${5:http://ollieman.net/$6}</guid>
<link>$5</link>
<category>$7</category>
</item>
The only thing of real note here is getting the pubDate correct. If
you want it to insert GMT instead of your local time you'll have to
tweak that.
Lastly, make sure to set the scope to text.xml and you're all set.
That's it! 1,2,3-easy RSS feed.
Dear TMaters,
I am experiencing weird problems with TextMate not recognizing some
keyboard shortcuts from bundles (i.e. the LaTeX bundle) containing
the escape-key. I can get the completion when pressing esc - but all
the other commands working with esc and a modifier key do not work at
all. If I am lucky I get a beep; selecting the macros I need by hand
from the bundle-macro-menu works as intended… any ideas?
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. ;(
Any idea where I might look for causes to this problem?
* there are no other InputManagers installed
* my .services are rather trimmed by using ServiceScrubber - and as
far as I can tell none are colliding on the shortcuts…
Thanx again,
Daniel
Haris,
thank you for your hint, this solved the probelm I guess. I have not
been using \ref since I am using a mixture of \vref and \prettyref
instead - which both did not have a scope of "meta.label.reference".
I just recently added those commands to the grammar and now it works
fine with alt-esc. The "old" completion gives me the following output
on console.log:
> Mar 26 01:45:47 dekayBase crashdump[724]: bash crashed
> Mar 26 01:45:47 dekayBase crashdump[724]: crash report written to: /
> Users/dekay/Library/Logs/CrashReporter/bash.crash.log
and within TextMate I get:
47:68: execution error: System Events got an error: Die Liste ist
leer. (2)
I am using a svn checkout of the bundle -
> e181090182:/Library/Application Support/TextMate dekay$ ls
> Bundles Conventions.txt LICENSE Themes Tools
Dan
Haris,
As you are the "local LaTeX bundle god." Do you think functionality
like what I am trying to do would be useful in the main bundle? I
have been thinking about doing some bundle or snippets for language
grammar extension specifically targeted to LaTeX, as this is my main
concern these days (or better call it major distraction from actually
*writing* my thesis).
What I am trying o accomplish is a much more detailed markup/
assignemnt of scopes for possible theme development. I believe it
would be very useful to have that much more markup available,
especially since I am using many packages, environments -- just
getting some visual feedback would be nice. Or something where you
are editing some lines somewhere and you are wondering which
environment you are currently in, just press ctrl-shift-P and it
prints "meta.environment.myverycoolenv" -- much better would be a
very light color change in that environment. (I like to have my list
environments colored… and possibly with different colors for itemize,
enumerate etc.)
And these thoughts brought me to the point where I figured I could
create that "detour" to include my custom language grammar before the
LaTeX language grammar was read.
Examples for my changes are:
- recognize \vref and \prettyref as meta.label.reference
- markup the different \headings with
support.function.section.XXX.latex with XXX being part, chapter,
section etc.
- markup the acronym package
- markup the fixme package so the \fixme{} is easy to spot.
Many of these changes are not essential and mostly eye candy. But
then: I like eye candy ;) Marking up commands that are not standard
TeX or LaTeX does have other benefits - if you have a different color
for recognized commands vs. words that start with \ - you kind of get
spell checking built in for commands ;) i.e. "no special color? Not
spelled correctly"
I am still not very comfortable with the whole language grammar
setup, but I am learning… a bit awkward is also the naming convention
- as I need a better understanding of the underlying logic in order
to apply stuff to latex. But in the end - it is just markup and as
long as there is some convention you can easily use the markup - but
names are names and if i call something text.latex or humftibunm
makes no difference to the machine -- just convenience for us users. ;)
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.
- 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
Good night ;)
Dan
Dear TMaters,
Is there a way to parse an external file, say within my project, and
possibly defined by a project environment variable - to add certain
terms to my Language Grammar? This would be very useful for LaTeX
projects where you have different custom macros and/or different used
packages where you want some hi-lighting in your theme and thus have
to change the grammar file for all those changes. Better would be a
macro/script/whatever that would just scan the preamble.tex or so for
all my \newcommands and add them to the recognized scopes...
Or, less fun but still useful: one could write a file with certain
terms that need a new scope - and parse that from within the bundle.
I guess maybe this is overkill, but it seems to me that LaTeX is one
of the more customizable languages out there - and I at least would
love some more power-tools and flexibility on my fingertips *without*
running to write new regexp's every time (but then I am not familiar
enough with regexps to do so easily - maybe that will need to change).
What exactly IS the most useful way and best way in regards to
updating "official" bundles via svn to make customized bundles? How
can I make sure that I can still take advantages of "official"
changes that come via svn but still retain my customizations? (And
possibly be informed if there are conflicts - i.e. if there are
changes in a bundle where I have changes as well…?).
…Dan
Hi all,
Using TextMate and love using it in my current (Python) project.
I have a question though. I svn co-ed the
RegularExpressions.tmbundle, and installed it. Now is there a way to
get this to play nicely with Python?
Let me explain: In Python most regular expressions are defined as
follows:
blah = re.compile(r'...')
would compile the regular expression ... into blah object.
Now I would like the (regular expression code) inside the r'...' to
be colored with RegularExpressions.tmbundle. I think I can do this
somehow with scopes, but this is still my first week with TextMate,
and I don't know what I'm doing with it yet.
Thanks for the help!,
_Ryan Wilcox
Dear folks,
I have succeeded, a bit at least. I have been looking for a way to do
two things:
1. create markup for the different heading types
2. create some kind of mechanism that lets me extend the latex
grammar without the need to fiddle with the main latex grammar file
(as I would like to keep my edits separate from those within the svn/
official version).
The following is just quick description, I will clarify later if
there are questions… for now. And I will post some samples somewhere
if anyone cares.
solution for #2:
start the LaTeX language grammar with:
patterns = (
{ include = 'text.latex.user'; },
and define overriding patterns as well as new, custom patterns such
as stuff you would like for packages you use or macros you defined
yourself (useful since right now everything starting with \ is
colored, but in order to catch typos or whatever I like to have my
custom commands colored in a certain way - thus recognizing them
easier.)
solution for #1:
add those lines (adapted to each heading that should be styled
separately) before the main section recognition pattern:
{ name = 'meta.section.latex';
begin = '((\\(?:chapter))(\*?)(?:(\[)[^\[]*?(\]))??(\{))';
end = '(\})';
captures = { 1 = { name =
'support.function.section.chapter.latex'; }; };
patterns = ( { include = 'source.tex'; } );
contentName = 'entity.name.section';
},
further notes:
the includes may need to be adapted in the examples in order to
correctly parse things in bracket within your custom definitions.
Lessons learned:
* You should not create a circular include structure. This will crash
TextMate
* and thus: save early and save often. Just when does TextMate save
edited bundles? (I just quit TM, this does the job, but else? i.e.
after that crash I lost the work of about 2h ;))
Dan
Dear folks,
I would like to get some language grammar markup to the different
levels of headings in my Latex stuff - and thus I am trying to mess
with the grammar file. I have added rules like:
{ name = 'meta.section.level0.latex';
begin = '((\\(?:part))(\*?)(?:(\[)[^\[]*?(\]))??(\{))';
end = '(\})';
},
which seem to work - but I am losing the functionality of the
"regular" Latex grammar. So I am trying to nest the recognition
somehow, resulting in:
{ name = 'meta.section.latex';
comment = 'this works OK with all kinds of crazy stuff as long as
section is one line';
begin = '((\\(?:(?:sub)*section|chapter|paragraph|part|addpart|
addchap|addsec|minisec))(\*?)(?:(\[)[^\[]*?(\]))??(\{))';
end = '(\})';
captures = { 1 =
{ name = 'support.function.section.latex';
patterns = (
{ include = '#levelA'; },
);
};
};
patterns = ( { include = 'source.tex'; } );
contentName = 'entity.name.section';
repository =
{ levelA =
{ name = 'meta.section.level0.latex';
match = '((\\(section))(\*?)(?:(\[)[^\[]*?(\]))??(\{))';
};
};
},
but somehow this does not work. Any ideas what needs to be changed?
thanx,
Daniel
Hi TextMate list,
I just made, and uploaded to the svn repository, a bulletin board bundle
(BBCode). Let me know what you think. Specifically, does it match the
syntaxes of web fora other than Ars Technica, which I designed it for?
Ars's smileys are probably unique. Then again, I don't really know the
ins and outs of BBCode.
-Jacob
On Mar 24, 2006, at 10:38 AM, textmate-request(a)lists.macromates.com
wrote:
> The ideal case for me [...] would be that TextMate could detect
> "linked" lines in scopes and reflow them dynamically, so deleting
> characters from a long line would allow words from the surrogate
> lines to return to the first line, and typing characters on an
> intermediate line would reflow the block.
What you are really talking about is control of margins within a
plain-text document.
If this could happen in the display of the text within textmate
*only* and not be reflected in the document itself (with real line-
breaks), that would be a godsend. I'd use it every day.
howdy.
I just spend a couple hours making the Brilliance Black BETA theme[1]
work with LaTeX.
It looks a lot better than it did. It all does seem a bit too purple
since a lot of the language is functions.
There are some subtle things you might love to hate. Nested lists get
slightly darker text for each level of depth.
Thanks to David Levy for sending be a bunch of sample LaTeX files to
test with. It helped a lot!
Thanks also to Michael Sheets who sent me sample source files for a
whole slew of languages.
I wouldn't have bothered collecting and testing my stuff with all
these languages if it had not been for these guys.
[1] http://textmate.svn.subtlegradient.com/Themes/Brilliance%20Black%
20BETA.tmTheme
I have only updated Brilliance Black. I'm not going to get around to
updating brilliance dull for a little while. I'm still planning on a
Brilliance White, too. How interested are people in the alternate
versions?
thomas Aylott
subtleGradient
oblivious(a)subtleGradient.com
For historical reasons I would like to bind f3 to "close window" command. I
tried to record a macro, but as soon as I hit apple-w, the window obviously
closes but also the macro recording does abort. It would be simple if I
could just add in the bundle editor a macro doing "closeWindow" (I assume
that is the name of the command).
Cheers, Fons.
--
Org: CERN, European Laboratory for Particle Physics.
Mail: 1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers(a)cern.ch Phone: +41 22 7679248
WWW: http://fons.rademakers.org Fax: +41 22 7669640
http://trippledoubleyou.subtlegradient.com/textmate/taylott_svnlog.rss
My personal crazy textmate bundles and themes are now available in
RSS form.
Enjoy.
This is especially important for making sure you have the latest
version of my themes, as i'm updating the BETA themes constantly.
thomas Aylott
subtleGradient
oblivious(a)subtleGradient.com
Hi,
I am a newbie to TextMate.
I've tried to run a simple test with creating a
TeX document and running a latex (using the built-in)
bundle. I am getting the "unbound variable error"
when I try to execute the command. I get similar
problem with other bundles.
What seems to be the problem and how to fix it?
Thanks.
M.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
for all the germans using textmate for html-coding this little
command will lookup the current html-element on selfhtml.org. i'm
sorry as of now there's no english version of this excellent website
available.
regards, niko.
#!/usr/bin/env ruby
#
# open element reference on de.selfhtml.org
# this is certainly a BAD implementation
# works for me, though
# any improvements are highly appreciated
# niko.
require 'net/http'
$tag_name = ENV["TM_CURRENT_WORD"].to_s
# get the elemnte.htm and attribute.htm:
Net::HTTP.start( 'de.selfhtml.org', 80 ) do |http|
$html_elemente = http.get( "/html/referenz/elemente.htm" ).body
$html_attribute = http.get( "/html/referenz/attribute.htm" ).body
end
# strip the head and the current tag:
$html_elemente.gsub!(/(<!.*<body>).*(<h2><a class="an" name="#
{$tag_name}">#{$tag_name}<\/a><\/h2>.*?)<h2>.*/m,'\1\2')
# prepend "elemente.htm" to anchor-links:
$html_elemente.gsub!(/href="#(.*?")/,'href="elemente.htm#\1')
# the current tag:
$html_attribute.gsub!(/.*(<h2><a class="an" name="#{$tag_name}">#
{$tag_name}<\/a><\/h2>.*?)<h2>.*/m,'\1')
# prepend "elemente.htm" to anchor-links:
$html_attribute.gsub!(/href="#(.*?")/,'href="attribute.htm#\1')
# concat the two strings:
$html = $html_elemente + $html_attribute
# turn relative links into absolute links (for hrefs and imgs):
$html.gsub!(/href="(.*?")/,'href="http://de.selfhtml.org/html/
referenz/\1')
$html.gsub!(/src="(.*?")/,'src="http://de.selfhtml.org/html/referenz/
\1')
# output the html
puts $html
--
____________________________
niko dittmann <ni-di(a)web.de>
____________________________
I'm not sure what XCode, or BBEdit, call them - and I'm also not sure
if this has been discussed in detail on this list - but has there
been any thought to having a double-paned view in Textmate?
Being able to have two documents open side by side could be extremely
useful.
Colin D. Devroe
Thomas,
I really like the work you have done so far on say the iLife theme,
also the Brilliance beta seems cool, although I will need to test it
if it is useful for work ;) I have never had a non-white background yet.
I am looking forward to your theming-howtos. Will you cover just the
theme parts or will you include some stuff about the language grammar/
markup side of things as well?
Daniel
…who just figured out that combining two selectors in themes with
transparent colors makes for very cool effects.
Howdy. I'd just like to revive this old feature request.
I have a much large monitor than ever before.
I also develop rubyonrails apps, so most of my files are rather short.
I want to keep the window the full height of the screen. But when I
do that the code is all stuck to the top of the screen.
It's much easier to code when the code i'm editing is in the middle
of the window, in the middle of the screen.
Any chance of adding an extra half page of scroll space to the top
and bottom of the text pane?
Maybe it could be a preference for people who'd hate it.
Thanks, much much!
> oh yes. this would be lovely icing.
> not particularly necessary functionality, but the mac isn't about
> bare necessities.
> it's about making things lovely to use
>
> On Aug 24, 2005, at 11:46 PM, Ivan wrote:
>
>> Hi,
>>
>> Half window view is like adding "virtual space" in text windows to
>> push the last line to the middle of the windows. It behaviors as if
>> you have added a couple of returns at the end of the document. I hate
>> to see all the lines in the viewing area pushed up everytime I hit
>> return or softwrap to the next line. With half window views, the
>> lines
>> only get pushed up every half window instead of every line.
>>
>> I use this feature a lot in vim and TextWrangler. In vim, it can have
>> any number of virtual space (denoted by tildes), which I think it's
>> better implentation than TextWrangler, which allow you to choose
>> "none", "half", or "full" only. However, I will be happy with just
>> one
>> option, half window view.
>>
>> Anyway, I just want to bounce the idea to other users.
>>
>> Ivan
Hi,
This is a bit off-topic for this list, I know, but since I know there
are a lot of highly competent people on this I'll give it a try...
I'm currently trying to figure out how to use regexp + javascript to
parse the content of a web page. What I want to do is collect weather
data from a Norwegian website and include it in a dashboard widget.
Here is the site with an example search:
http://tux.aftenposten.no/weathersearch/weathersearch.do?
name=levanger&sok=limnor
I tried to copy the source into TextMate and use the regexp search in
TM to figure out the patterns to use, but I can't seem to solve it.
Any help are appreciated.
As far as I can see, the weather data for a particular day are
enclosed by <tr><td class="idag" ... </tr>, but there is a lot of
space around the tags, which I presume must be included in the regexp
patterns.
Anyone here which could kick me in the right direction when it comes
to these patterns?
--
Mvh/Regards
Geir-Tore Lindsve
lindsve(a)bluezone.no
http://www.lindsve.net
Is there a way to get TextMate to treat files with the extension
"webarchive" as binary files? As Text they are useless and I'd love
to just double-click on them in the project window and have Safari
open them.
Dear TextMaters,
I am looking for a theme that works very well with LaTeX - I don't
care much about colors and such, yet. But it seems that TM provides
some very detailed features for syntax coloring and I am not happy
(yet) with the themes I have found so far, I would like much more…
so I am looking for either a theme base for latex that at least has
styles already defined for most sections, or some pointer on how to
best design a theme, how to find out the scopes for sections of text…
basically an in-depth-tutorial or documentation for the theme design?
(Maybe I am looking at the wrong places…?) Is there an easy way to
extract all possible scope selectors from a languag definition and
create a blanket theme out of this?
Dreaming?!,
Dan
Hello,
those of you that use LaTeX a lot, you might be interested in
checking out the LaTeX experimental bundle that i just checked into
the repository. It's got a couple of commands that are still "rough"
and not quite production ready, hence the title "experimental".
One simulates the greek letter method of inserting letters commonly
found in emacs (i.e. first press shift-ctrl-g, then the letter, then
space).
Another encloses the current sequence of non-space characters in
dollar signs, so you could for instance type: \sin ctrl-$ and get $
\sin$.
Another, given as a selection a math equation of the form $...$ or $
$...$$ or \(...\) etc, it toggles the math symbols. I.e. it will take
$foo$ and \(foo\) to \[foo\] and vice versa.
Finally, the home and end keys are bound to two macros that are
inspired by Thomas Aylott's macros for moving about in HTML
documents, except they try to do a descend job with LaTeX.
All these are work in progress, and any ideas/contributions/
suggestions are more than welcome.
Haris
Hi,
is there a way to, when saving, to remove all trailing spaces and tabs
from lines. I would like this when saving C++/C files.
Cheers, Fons.
--
Org: CERN, European Laboratory for Particle Physics.
Mail: 1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers(a)cern.ch Phone: +41 22 7679248
WWW: http://fons.rademakers.org Fax: +41 22 7669640
I use reformat paragraph a lot for reStructuredText. Normally the
text is not indented so reformat paragraph works well. However, for
lists and other things that are indented, reformat paragraph works
unexpectedly. When I reformat a paragraph that is indented by a
single tab the indented text is indented with spaces. So, the first
line still contains the tab I inserted, but subsequent lines are
indented with spaces. This of course causes issues with the reST parser.
My question, is this something I've screwed up in my settings or is
this expected behavior? I expected whatever indent I started with to
be copied to subsequent lines. Nothing turned up when I searched the
mailing list. Any help is appreciated. Thanks _matt
Hi, I have a Python C module, and comments between the
end of the arguments and the opening brace seem to screw
up its ability recognize the function name:
static PyObject *
tableio_writeTable(PyObject *self, PyObject *args) /* args: (string) */
{
/ * function body */
}
I'm not sure how to modify the module to get this to work.
Putting that comment somewhere else makes it work fine,
but I'd like to avoid having to go through the code and
editing every function definition.
Can someone offer a hint as to how to fix the module?
TIA,
Dave
Howdy.
Just wanted to let you guys know about my new theme.
http://macromates.com/wiki/Themes/UserSubmittedThemeshttp://textmate.svn.subtlegradient.com/Themes/Brilliance%20Black%
20BETA.tmTheme
I'd like you guys to test it our for me and let me know if any of it
looks ugly or unusable with the code that you use.
I developed primarily for xHTML, CSS, JS, RubyOnRails & Ruby.
I also tested and tweaked it for: actionscript, Ada, ANTLR, asp,
asp.net, C, C++, obj-C, embedded Django, java, markdown, MIPS
Assembler, Perl, PHP, Python, Slate, SQL, xml
XML is currently rather hard to read without a bright monitor.
PHP could use some color tweaks to look less ugly. (even though php
doesn't deserve to look pretty ;) )
I haven't tested it with LaTeX, yet.
I got some great code samples from <insert name here, because I
forgot it>
If anyone uses a language where this theme looks ugly, please let me
know.
The idea of this theme is to be the ultimate theme prototype that all
themes are based on.
I, personally, will use this theme as the template that all my new
themes are based on.
So I really want to get the scopes as perfect and all-encompassing
as possible.
Thanks!
Enjoy ;)
PS: no screenshots of it yet.
thomas Aylott
subtleGradient
oblivious(a)subtleGradient.com
I created a poll on the wiki to get a feel for which languages
TextMate is primarily used with:
http://macromates.com/wiki/Polls/WhichLanguageDoYouUse
Cast as few votes as possible, i.e. do not add points to languages
you rarely use (it is not a poll about how many languages people
know, but which they actually use regularly).
Be vary of edit conflicts on the wiki page. These will be detected
automatically, but needs manual resolving -- it is probably easier to
just start over, if one happens (the wiki presents the diff when
committing the edit when there is a conflict).
I think queuing theory dictates that some edit conflicts are bound to
happen, given the number of subscribers to this list, but I am not
writing specific polling functionality just for this :)
Hi All,
I have been using textmate for a little over a week now and I love
the program. I have been using it for mostly RoR and HTML Development
but I am looking for a bundle that will help me create MySQL DDL
files. Any Ideas?
David Newberger
A search of the ML archives has come up empty, so I turn to the
mothership: I have a problem.
Textmate is selectively refusing to open (or, rather, display) files
that it should have no problem with.
Some quick and dirty testing seems to indicate that this has to do
with specific file extensions. It first manifested with a problem in
using the "Edit in TextMate" command, but now I fear it's more
widespread than that.
First, an example to show what the behavior is like. Then, how it
affects the whole system.
### Illustrative Example ###
At the moment I am writing this email in TextMate, via using the
"Edit in TextMate" command.
The file:
/private/var/tmp/folders.501/TemporaryItems/Trouble with "Edit in
Textmate".mail
opens just fine in TextMate. An experiment shows that I can open it
fine from the Finder by dragging it onto the TM icon.
However, when I tried to write this email from gmail, and used the
"Edit in TextMate" command from within Safari, it changes focus to
TextMate, but no file opens.
A file has been created:
/private/var/tmp/folders.501/TemporaryItems/Loading “Gmail - Compose
Mail”.safari
But textmate won't open it, not via File:Open, not via a drag to the
dock, and not via Get Info association of .safari files with TextMate.
__However__. If I select _more than one_ .safari file in the Finder,
and drag them to the TextMate, a very odd thing happens.
Textmate opens a new project with the three files listed. But
clicking on one of those files doesn't actually open the file:

You get a blank tab. Clicking on that tab _does_ display the file:

So there's something odd going on here.
Another wrinkle is that, once you've clicked the tab and closed it
once, it opens properly from the Project drawer. But not from the
Finder or File:Open or the "Edit in TextMate" command.
(Yes, I am OCD about checking things like this out, why do you ask?)
I thought this was just for items in the TemporaryItems folder. But,
it seems, I was wrong about that. I dragged a .safari file to the
desktop and tried to open from there. No dice. Same odd multiple-item
behavior.
### The Real Problem ###
The loss of "Edit in TextMate" from the browser is, for me, bad
enough. I have tasted the "real text editor for the browser" crack,
and I'm hooked.
But what really gets me is that this started with .php files, in
Transmit. And I can't open .php files at all.
I first edited a .php file remotely in Transmit, off my SFTP server.
Saved the contents, got a system beep, closed it. Totally normal,
except that after that, .php files broke.
Same behavior as above: I try double-clicking a .php file in the
Finder, I get TextMate open and nothing else; no document window,
nothing. Multiple .php files = a new project with multiple files in
the drawer. Clicking one gets a blank tab. Clicking the tab shows the
file.
Now, I _can_ edit non-php files remotely in Transmit. HTML works
fine. Python works fine. But no .php
Naturally, I spend most of my remote time editing .php files these
days. :/
I'd prefer not to have to totally nuke TextMate, but I would really
dearly love to have a functional text editor.
Thanks in advance.
Cheers,
--
Josh DiMauro
josh(a)metacarpal.net
http://blog.metacarpal.net
All my troubles with TextMate seem to do with language grammars. Here's
another issue I can't work out on my own...
I'm trying to add " case 'something': " to the Symbol List in the PHP
language grammer. I've added the following pattern:
{ name = 'meta.symbol-list.php';
match = "\bcase\s+[^:]+:";
},
And after also adding a showInSymbolList preference item it does place
all case items into the symbol list. But the unfortunate side effect is
that the text is now not in the keyword.control.php scope, so has no
syntax highlighting.
How to give more than one scope name to a pattern? I don't want to
include ALL the matches for keyword.control.php in my symbol list.
Thanks, Quinn
Hi all,
Recent user of TextMate... I've downloaded the latest bundles via
subversion and have noticed a problem with the vb.asp.net bundle.
If I try to open an .asp file, which is not a .NET file, just plain
asp, there are errors generated in the Console:
TextMate: zero width match (swallow pattern) {
begin = "\\(";
"begin_nfa" = <058c1720 >;
end = "\\)";
"end_nfa" = <006192d0 >;
name = "meta.round-brackets";
patterns = ({include = "source.asp.vb.net"; });
swallow = "(\\([^\\)]*[^\\)]*\\)|s*\\n*s*)";
"swallow_nfa" = <04ed1cb0 >;
}
TextMate: zero width match (swallow pattern) {
begin = "\\(";
"begin_nfa" = <058c1720 >;
end = "\\)";
"end_nfa" = <006192d0 >;
name = "meta.round-brackets";
patterns = ({include = "source.asp.vb.net"; });
swallow = "(\\([^\\)]*[^\\)]*\\)|s*\\n*s*)";
"swallow_nfa" = <04ed1cb0 >;
}
TextMate: zero width match (swallow pattern) {
begin = "\\(";
"begin_nfa" = <058c1720 >;
end = "\\)";
"end_nfa" = <006192d0 >;
name = "meta.round-brackets";
patterns = ({include = "source.asp.vb.net"; });
swallow = "(\\([^\\)]*[^\\)]*\\)|s*\\n*s*)";
"swallow_nfa" = <04ed1cb0 >;
}
...about 39 times. I'm not sure if it corresponds to anything in my
.asp file. It's a rather simple file.
Also, if I create a new HTML file using the New from Template -> HTML
command, and I try to insert a <script> tag in the header, TextMate
will make an error sound, and for each key I try to type within the
script tags, the error "ding" sounds. In the Console, many errors like
this are shown:
2006-03-18 22:00:22.896 TextMate[16514] didn't find rule named
source.js.bracketed
2006-03-18 22:00:22.898 TextMate[16514] didn't find rule source.js.bracketed
To get rid of the errors, I deleted the vb.net bundle (I don't do
.NET, so no great loss), but I thought I'd report it.
I suppose I should send this off to support too..
Thanks.
Hey all,
today i've discovered may be a prob with file encoding (???) over
a .txt file.
my pref setup is tuned to UTF-8 and a text file edited by TextMate
was MacOS Roman, something to avoid definitely...
then, using another text editor i've converted this file to UTF-8 and
discovered again that after having edited this file with TextMate the
file becomes again in MacOS Roman...
the symtom is that TextEdit (also setup default to UTF-8) is unable
to open the file.
did other get about the same prob ???
Yvon
I'm helping a group that I consult with in customizing TextMate for
their PHP development.
They have a library of functions within their company that they want
to have syntax-highlighted, similar to the built-in PHP functions.
I accomplished this by creating a custom bundle, making a scope for
their functions and adding the appropriate functions to the patterns
section of the new language file.
My problem is this: In order to get this new scope included with PHP
files, I modified the default PHP.tmbundle with
{ include = 'source.php.ccb'; },
This works great, everything highlights. *But*, now this is a custom
PHP bundle, and any updates to the default will be masked, until the
new default is manually changed.
Is there any way that I can "inject" my new scope into the PHP bundle
without modifying the PHP bundle itself? I tried adding another
language to my custom bundle, and just putting the include line in
for the source.php scope. This disabled all the other PHP functionality.
Thanks for the help,
Ken Scott