Hello,
Ok, I'm probably missing something obvious here, but I can't find
anything in textmate to let you run your tests without going to the
terminal. With everything else in there, it seems like it would be
something included.
Anyway, I took a few minutes from work to do a quick hack to the
bundle (my changes attached). I bound the run test command to command
- option - G. If the textmate cursor is in a controller or model, it
will run the associated test file. If the TM cursor is in a test file
(unit or functional) it will only run the test method that the cursor
is in (so that when I'm writing a test, I can run it real quick). If
the cursor is outside of a test method (test_*) it will run the entire
file.
I added a file to the bundle ( bin/test_helper.rb) and a command.
I also might have found a bug in the bundle. See the comments in
bin/test_helper.rb
Please let me know if there already is something out there that would
probably be far more thought through than this quick hack.
Thanks,
-carl
Hi!
Since yesterday I get the following authentification request while
trying to do an svn up:
Authentication realm: <http://macromates.com:80> macromates.com
Password for 'root':
When I interrupt it with ctrl+c I get:
subversion/libsvn_ra_dav/util.c:826: (apr_err=170001)
svn: PROPFIND request failed on '/svn/Bundles/trunk'
subversion/libsvn_ra_dav/util.c:296: (apr_err=170001)
svn: PROPFIND of '/svn/Bundles/trunk': authorization failed (http://
macromates.com)
I'm using the mateup-script for checkouts but manual checkouts didn't
work as well.
Anyone having the same problem or is there a solution?
Niels
--
Jack Sparrow: Me? I'm dishonest, and a dishonest man you can always
trust to be dishonest. Honestly. It's the honest ones you want to
watch out for, because you can never predict when they're going to do
something incredibly... stupid.
-- Pirates of the Carribean: The Secret of the Black Pearl
Hi,
so I'm posting this last message to share the "final"
version of the Label Table command; of course it is
very rudimentary and would need additional work, but
for me it does exactly what I need, so maybe it can
be useful for others too. I hope Haris or Allan like
it and add something like it to the Latex Bundle in
the future (who knows what's in the mind of masters
anyway).
I guess it is not possible to attach files from the web
gmane interface, so I am posting the command inside
the text. After all it takes 2 minutes to join back the long
sed commands into one line, copy and paste into the
bundle editor... Input: entire document, Output: HTML
file, scope: you choose.
The command creates an HTML window listing all the \label-s
of the topmost open window (only one file at the time, sorry).
Each label in the window is clickable, and clicking inserts text
at the insertion point in the open TextMate window.
If the label name starts with "eq", then \eqref{label_name}
is inserted; otherwise, only \ref{label_name}.
Best way to use the command: launch it the first time, the
HTML window opens; resize and put the window in a handy
position; then never close it, when you need it just issue the
command again (the window is refreshed and jumps over the
other windows).
Thanks to Allan for help.
Enjoy and improve,
Piero
TEXT OF THE COMMAND:
# parse the file for \labels (plus two lines following them)
sed -n -e "/\\label/{=;N;N;G;p;}" |
# separate labels from each other, the html way
sed '/^$/d' |
sed 's/^\([0-9]*\)$/\<p\>\<\/p\>\1/' |
sed 's/\(.\)$/\1\<br\>/' |
# the following two sed commands must be on one line each!
# do not insert spaces when joining lines
# insert active javascript links: for equations (we want \eqref here)...
sed 's/\\label{eq\(.*\)}/\<a href=\"javascript:TextMate.system
(\"\/usr\/bin\/osascript \&\>\/dev\/null -e @tell app \\\"
TextMate\\\" to insert \\\"\\\\\\\\eqref{eq\1}\\\"
@ \&\", null);\"\>\\label{eq\1}\<\/a>/' |
# ... and for the rest (sections, theorems etc.: we need \ref)
sed 's/\\label{\([^e][^q].*\)}/\<a href=\"javascript:TextMate.system
(\"\/usr\/bin\/osascript \&\>\/dev\/null -e @tell app \\\"
TextMate\\\" to insert \\\"\\\\\\\\ref{\1}\\\"
@ \&\", null);\"\>\\label{\1}\<\/a>/' |
# I used @ instead of ' for escaping reasons - put the quotes back
tr "@" "'"
In a previous version of textmate the following code for a template
worked to create a TM_PACKAGE variable
TM_PACKAGE=`sed <<<$TM_NEW_FILE_DIRECTORY -n 's#.*classes/\
(.*\)#\1#p'|tr / .` \
basically it takes the new file directory like this
/Users/ketan/Documents/client/project/development/classes/client/
project
And It turns the "/" to "." and removes everything before the classes
so the end result would be
client.project
Any ideas on how to do this ? I am not very good with sed.
Ketan
So this is the .tmCommand file containing the
Label Table command. Please see the preceding
post for description.
The number of messages I sent in the last two days
takes me dangerously close to the status of a
spammer, but I'll keep shut in the future, I promise
(yeah right)
Piero
Hi,
one never really escapes the escape tunnel.
I have a new problem with escapes.
>From the command line I can ask
TextMate to insert a backslash:
osascript -s 'tell app "TextMate" to insert "\"'
I want to do the same from a javascript
contained in an a href link. But I can not find the
correct way to escape things. Allan's suggestion
works perfectly with ordinary text; the following
html code:
<a href="javascript:TextMate.system("/usr/bin/osascript &>
/dev/null -e 'tell app \"TextMate\" to insert
\"TEXTTOINSERT\"' &", null);">
TEXTOFLINK</a><br>
produces a link TEXTOFLINK and when I click on it,
TEXTTOINSERT is inserted into TextMate. But if
TEXTTOINSERT contains a backslash, it is ignored.
A pity since I want to insert a tex command...
What should I write instead of TEXTTOINSERT to
get, say, "\eqref" to be inserted? Yes, I am escape-blind.
Thanks for any help,
Piero
PS hm... no one seems to like my new idea for label
completion. I'll keep it for personal use :)
With this text:
mainNavL1
Doing Control + right arrow will move the cursor first to the
beginning of the word, then to the left of the capital N, then left
of the capital L, and after that pressing the keystroke no longer
advances the cursor -- it gets "stuck" there.
It seems that the numeral ("1" here) causes the problem. If you
start with the cursor to the right of the entire word and use Control
+ left arrow the problem does not occur.
eo
Thanks everyone!
Jacob's note stepped me through the RoR screencast's actions*
Alan's note lead me to the TextMate screencast which starts to unlock
TextMate's bundle and snippet secrets*
And Tom pointed out that I was seeing snippets in use, not really completion.
If these answers lead to a new question its: does TextMate have all its
features when run in Panther (OS X 10.3)? And if not, what am I missing?
Scrutinizing the text insertion screencast I noticed *my version (1.5.3)
is missing the "Automation" menu. Ah-ha!
I find no mention of system requirements or Panther versus Tiger
capabilities in the docs (aside from a couple minor ones). Is there a
version feature comparison matrix somewhere? Maybe that's just for when
you have an entire martketing department!
So, thanks for all the help,
Ivy
I was on vacation for 2 weeks and didn't feel like going through the
60+ TM emails ;) Thanks for the link, creating my own macro solved
the issue.
I hope that in the future, modifications on behaviors such as this
one (that clearly effect every day use) are given a little more time/
thought before being implemented, or at least get documented in a
more "in your face" way, so that I don't have to be worried about
what's going to happen every time TM gets updated ;)
Yann
On Sep 24, 2006, at 11:37 PM, textmate-request(a)lists.macromates.com
wrote:
> What, you didn't get the memo? ;)
>
> http://comox.textdrive.com/pipermail/textmate/2006-August/012725.html
>
> Haris