Hello!
I try to develop my own commands. So I'm new to Ruby, my commands
sometimes are buggy. How can I easily debug my commands. How do you
do it?
Helge
I've attached a complete rewrite of the Wikipedia linking code. It's a
little more modular, a lot more inclusive and a bit smarter than before.
I am definitely still open to input (Haris ;-)) on my coding technique and
anything that can be done to improve the command. I'm just getting my feet
wet with Ruby, regular expressions and TextMate in general.
If you're currently using the command I distriubted previously on this list,
Brett Inc. "strongly urges it's users to upgrade to this latest release".
I set up WordPress blogging per the help and screencast instructions. When I
fetch posts (I just did an svn up on the bundle, so I¹m at v.5327), I get
the following error:
/usr/lib/ruby/1.8/xmlrpc/client.rb:535:in `do_rpc': HTTP-Error: 406 Not
Acceptable (RuntimeError)
from /usr/lib/ruby/1.8/xmlrpc/client.rb:409:in `call2'
from /usr/lib/ruby/1.8/xmlrpc/client.rb:399:in `call'
from /Library/Application
Support/TextMate/Bundles/Blogging.tmbundle/Support/lib/metaweblog.rb:31:in
`getRecentPosts'
from /Library/Application
Support/TextMate/Bundles/Blogging.tmbundle/Support/lib/blogging.rb:546:in
`fetch'
from /Library/Application
Support/TextMate/Bundles/Blogging.tmbundle/Support/lib/blogging.rb:545:in
`popen'
from /Library/Application Support/TextMate/Support/lib/progress.rb:11:in
`call_with_progress'
from /Library/Application
Support/TextMate/Bundles/Blogging.tmbundle/Support/lib/blogging.rb:545:in
`fetch'
from /tmp/temp_textmate.mU5BiJ:3
The setup is:
# List of Blogs
#
# Enter a blog name followed by the endpoint URL
#
# Blog Name URL
finesite http://admin@myfinesite.com/wp/xmlrpc.php
Is this a familiar result and is there something stupid I¹m missing? BTW:
There is an admin user for the blog and I¹ve tried:
* siteadmin(a)myfinesite.com
* admin(a)www.myfinesite.com
Not sure where to go from here. Help appreciated!
Thanks
This is my template command
if test \! -e "$TM_NEW_FILE"; then
TM_YEAR=`date +%Y` \
TM_DATE=`date +%Y-%m-%d` \
TM_USERNAME=`niutil -readprop / /users/\$USER realname` \
TM_PACKAGE=`sed <<<"$TM_NEW_FILE_DIRECTORY" 's#.*classes/
##'|tr / .`
perl -pe 's/\$\{([^}]*)\}/$ENV{$1}/g' \
< class.as > "$TM_NEW_FILE"
fi
And TM_PACKAGE comes out blank.
what am I doing wrong?
On 26/9/2006, at 19:52, Ketan Anjaria wrote:
> 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 / .` \
Try this: TM_PACKAGE=`sed <<<"$TM_NEW_FILE_DIRECTORY" 's#.*classes/
##'|tr / .`
I have only had a chance to test this on Wordpress. It needs to be placed
in the Blogging Bundle because it references the blogging.rb file in that
support directory.
If anyone using the blogging bundle would be willing to give this a try and
let me know if it works with other platforms, it would be greatly
appreciated.
Thanks,
Brett
Dear list menbers,
I have the following problem:
I received a plain text file utf-8 encoded written on a Windows PC. I
could open this file and I could edit this file perfectly.
After my modifications I saved this as utf-8 with LF. OK.
Then I tried to import the content of that file in a database. This
didn't work, because the database couldn't parse the first line.
Then I opened that file in a HexEditor and I saw that the first line
begins with EF BB BF. After looking at this I remembered that these
bytes are the BOM (Byte Order Marker) for utf-8 and Windows PC's make
often use of it to save utf-8 text files.
My problem is now that I couldn't find a way to save my text file as
utf-8 without BOM.
I had to use jEdit for that, because in jEdit you can select the
encoding utf-8 or utf-8y (meaning with BOM).
Is there any chance to implement this in TextMate? Or, may be better,
that TextMate saves all utf-8 files without BOM, because I think this
marker is irrelevant within utf-8. It only makes sense in utf-16/32.
All the best,
Hans
Hi,
After reading on this list about all the great recent updates to the
Latex bundle I decided to svn-up all the bundles I've installed:
> cd /Library/Application\ Support/Textmate/Bundles
> svn up
Then I used the "Reload Bundles" command from inside TextMate.
Now an odd thing is happening. The old key equivalents don't seem to work
for the Latex-bundle commands anymore, even though they are the same in
the menu. Similarly they do not appear in the Use Bundle Item... dialog
when I summon it with Ctrl-Cmd-T. Suggestions? TIA for your help.
-dave
This little command is just the most basic proof of concept of a
working live shell command.
You can easily hack it up to run any random shell command you want.
I'm planning of using something like this to implement a bunch of
stuff soon.
TextMate Bookmarks, live updating.
ZenTest autotest
Mongrel server / Rails app log tail
etc...
Feel free to suggest other interesting stuff.

thomas Aylott — subtleGradient — CrazyEgg
Hi!
I really like the blogging bundle. It's amazing.
But each time I close the window, I am asked to save the file. I
think there are few, if at all, who save their blog entries as files.
Wouldn’t it be a better behavior to ask for post to blog? Also I
naturally type apple+s, when I am finished. So, I added a copy of the
post to blog command and associated this shortcut to it. Storing the
file in this case seems similar to post it. What do you think?
Helge
Hi,
I could swear I have used a command that would reformat something like
<tr>
<td> </td>
<th id="number">N</th>
<th id="percontage">%</th>
<th id="number">N</th>
<th id="percontage">%</th>
</tr>
and "ex/plode" it to:
<tr>
<td > </td>
<th id="number" >N</th>
<th id="percontage">%</th>
<th id="number" >N</th>
<th id="percontage">%</th>
</tr>
for easy option+selection. I wanna say it was part of subtlegradient,
but cant find it anywhere.
(it probably does not help that somehow I have ended up with 3
subtlegradieent bundles.)
--
dc
-----
David Clark
Web Specialist
Institute for Community Inclusion (http://www.communityinclusion.org/)
david.clark(a)umb.edu
(617) 287-4318
Hello Textmate-Users,
i'd love to see a solid block-cursor in Textmate, configurable by the
user : blinking or not, block or default as it is. Maybe i'm gettin'
old, but i find myself frequently searching for the cursor since I
switched to working on black.
I'd like to read u'r opinion on this and for sure maybe there exists
a osx-hack already to achive this without bothering Allen ;-)
Greets, Andreas
---
»In a perfect world… spammers would get caught, go to jail, and share
a cell with many men who have enlarged their penisses, taken Viagra
and are looking for a new relationship.«
If anyone is interested, and happens to have Rmagick installed, I added on
to the image insertion drag and drop command in the blogging bundle to
automatically thumbnail and link with titles, alt tags, etc. It gives you a
drop down menu asking you whether you want the thumbnail, the full image, or
the thumbnail linked to the full image (a rel=lightbox tag is included for
those using it).
Like I said, it requires Rmagick (and ImageMagick or GraphicsMagick) to be
compiled and installed. It bootlegs on the original command for everything
else.
Brett
A common refrain on this list is being able to edit files remotely. I
explored various solutions (transmit, subversion, hotkey), but
decided that ultimately what I wanted was something that would just
watch one or more local files I was editing and then as they change,
automatically upload them to a remote destination.
So I spent some time last night hacking together syncmate (python
script), attached:
Usage: syncmate <file> [<file>...] [username@]host:/remote/path/
Watches one or more files for changes and copies to host whenever the
file changes locally. The first time called, starts an instance of
syncmate
as a daemon. Each subsequent time called registers new files with the
running
daemon.
Usage: syncmate --list
Lists registered files
Usage: syncmate --quit
Causes daemon to quit
It requires the Growl python bindings be installed for notification
(btw, I had trouble with the Growl python bindings occasionally
causing python to crash, but I think I've narrowed the problem down
to attempting to use a custom icon in the notifications, so I've left
that out.)
Anyway, I find this useful in combination with textmate, so I figured
I'd post it here. Hope someone else finds it useful.
j.
The darwin ports email list is temporarily shutdown and I couldn't
find any other help online. thought one of the experts here could
help since I need this to use LaTex with TextMate.
I'm trying to install teTex on my iBook G4 and have installed Xcode
2.4 and DarwinPorts 1.3.1, I get the following error.
Any ideas on what I can do to get Tex on my Mac?
Thanks
Dennis
/usr/bin/ld: warning weak referenced symbols:
_getaddrinfo
/usr/bin/ld: Undefined symbols:
_XCreateGC referenced from libXpm expected to be defined in
/usr/X11R6/lib/libX11.6.dylib
_XCreatePixmap referenced from libXpm expected to be defined in
/usr/X11R6/lib/libX11.6.dylib
_XFreeGC referenced from libXpm expected to be defined in
/usr/X11R6/lib/libX11.6.dylib
_XPutImage referenced from libXpm expected to be defined in
/usr/X11R6/lib/libX11.6.dylib
_XAllocColor referenced from libXpm expected to be defined in
/usr/X11R6/lib/libX11.6.dylib
_XCreateImage referenced from libXpm expected to be defined in
/usr/X11R6/lib/libX11.6.dylib
_XDefaultColormap referenced from libXpm expected to be defined in
/usr/X11R6/lib/libX11.6.dylib
_XDefaultDepth referenced from libXpm expected to be defined in
/usr/X11R6/lib/libX11.6.dylib
_XDefaultScreen referenced from libXpm expected to be defined in
/usr/X11R6/lib/libX11.6.dylib
_XDefaultVisual referenced from libXpm expected to be defined in
/usr/X11R6/lib/libX11.6.dylib
_XFreeColors referenced from libXpm expected to be defined in
/usr/X11R6/lib/libX11.6.dylib
_XGrabServer referenced from libXpm expected to be defined in
/usr/X11R6/lib/libX11.6.dylib
_XParseColor referenced from libXpm expected to be defined in
/usr/X11R6/lib/libX11.6.dylib
_XQueryColors referenced from libXpm expected to be defined in
/usr/X11R6/lib/libX11.6.dylib
_XUngrabServer referenced from libXpm expected to be defined in
/usr/X11R6/lib/libX11.6.dylib
collect2: ld returned 1 exit status
make[2]: *** [xdvi-xaw.bin] Error 1
make[1]: *** [all] Error 1
make: *** [all] Error 1
I noticed that there's an XHTML bundle in the repository and then
there's the HTML bundle included by default. I'm wondering, if
there's an XHTML bundle, why does the default HTML bundle use XHTML
in its snippets? Can we move that nonsense into the XHTML bundle and
let those that want it install it? (Perhaps it should be included by
default as well.) Just curious.
Rob
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