hi all,
I have a quick question - is there a way to write a command that would
run the previously run ruby test - whether it was a whole test case
(command R) or the 'focused test run' ? I often want to tweak code,
rerun the last test, tweak code, rerun, etc....So basically I could
map ctrl-cmd-R to 'rerun previous test run', and it would be smart
enough to run whatever I ran last.
thanks,
Rob
--
http://www.robsanheim.com
Hi everyone,
This is a minor bug, mostly cosmetic in the LaTeX
bundle. Please have a look at this screenshot :
http://img213.imageshack.us/img213/5403/image1fd3.jpg
Notice that the accented characters in the name of the
section do not appear in italic in the label whereas they
are OK in the last line.
It probably has to do with the RegExp which is involved
in the definition of this command.
I'm very new to (yet enthusiastic about) TextMate... A quick search
of the web and this mailing list doesn't return much in the way of
XSLT bundles/extras/goodies for TextMate.
Can anyone provide any pointers and/or let me know that nothing
currently exists (In which case I'll develop something)?
Thanks,
Todd Ditchendorf
Scandalous Software - Cocoa Developer Tools
http://scan.dalo.us
Howdy.
In light of the recent C Library bundle, it's obvious that people re
extremely interested in having some code completion in TextMate.
I've done a few things will code completion already.
Filepath - http://subtlegradient.com/articles/2006/11/02/filename-
filepath-completion-for-textmate-screencast
English - http://subtlegradient.com/articles/2006/10/30/english-word-
completion-for-textmate-screencast
And someone did Cocoa completions
http://theocacao.com/document.page/332
I think we should come up with a brick simple library that will let
you do completions.
Then the hardcode d00ds can get on with extending and perfecting the
completion library.
While everyone actually gets the chance to use it.
Plus, we'll be able to unify all the code completion stuff into a
single library.
thomas Aylott — design42 — subtleGradient — CrazyEgg
Hi,
I looked at the R-bundle command 'Execute Line / Selection'.
I rewrote this command to improve it and fasten it a bit, at least in
my eyes.
Changes for this command and for the language grammar 'R console':
1)
I compiled the AppleScript and saved it as 'Run only'. This is a bit
faster.
Furthermore within this script I use the clipboard to pass the
command to R, and I also get back R's result via the clipboard.
This has a nice side-effect for the encoding problems:
Example: If I type 'print("Immer Ärger mit Jörg")'
I will get back '[1] "Immer Ärger mit Jörg"' with the 'old' version
caused by the UTF-8 encoding.
If I do it via the clipboard then it outputs the string correctly,
but if you have a look at R.app you see weird characters.
And finally I took care about the AppleScript file size, because it
remembers the the 'oldtext' and 'text_area'. So, I set these
variables to "" and the end.
Of course, to use the clipboard will destroy its content, but this
can be discussed.
To work with the AppleScript tm_get_r.scpt you have to copy the
attached script to R-bundle's /Support/bin folder, or you can compile
it by yourself.
2)
If you have a TM window set to R console scope, and you enter a
command like '> 3*3' the script now is checking whether R.app is
running. If not it opens it, waits 5 seconds, hides R.app, and sends
the command to R.
3)
I changed the language grammar for 'R console' to be able to do the
following:
I type '4+' press ENTER, R returns '+ ' to complete my command. If
you type now '4' the old grammar ignores that.
So I changed the line 'begin = ...' within the grammar to:
________________
{ scopeName = 'source.r-console';
fileTypes = ( );
patterns = (
{ name = 'source.r.embedded.r-console';
begin = '^[>|\+] ';
end = '\n|\z';
beginCaptures = { 0 = { name = 'punctuation.section.embedded.r-
console'; }; };
patterns = ( { include = 'source.r'; } );
},
);
}
________________
Now you can type as usual.
4)
If R asks for an user input via 'readline' you can't just type the
answer and press ENTER because TM's command expects '> ' or '+ ' at
the beginning of the line.
To solve it here's a suggestion:
If the last line of R's return is not '> ' or '+ ' I insert '\n> '.
It is not standard but now you can type the answer straightforward.
5)
I suppressed any error message coming from AppleScript. E.g., if you
type '?C' and R.app is not running, R starts, and shows the help, but
meanwhile AppleScript wants to have the content, but it does not get
it. Thus AppleScript outputs an error, but there is no error. In such
a case R's return is nothing and by using the suggestion of 4) you
have a '> ' and no error message at the last line in TM.
6)
I only changed the code, not the input/output settings.
#########
Here comes the new code for 'Execute Line /Selection':
__________________
echo
echo -e `tail -c+2` | pbcopy
# check whether R.app is running
if [ $(ps -xc | grep ' R$' | wc -l) -eq 0 ]; then
open -a R
# sleeps for 5 sec - can be fine-tuned
sleep 5
osascript <<-AS
tell application "System Events"
set visible of process "R" to false
end tell
AS
fi
osascript "$TM_BUNDLE_SUPPORT/bin/tm_get_r.scpt" &>/dev/null
RES=$(pbpaste | tail -n +2)
echo -en "$RES"
NL=$(echo -en "$RES" | tail -n 1)
if [ "$NL" != "> " -a "$NL" != "+ " ]; then
echo -en "\n> "
fi
##########################################
# source code for 'tm_get_r'
#
#
# tell application "System Events"
# -- Get a reference to the text field
# set text_area to (process "R")'s (window "R Console")'s (scroll
area 1)'s text area 1
#
# -- Get text before and after our command
# set oldtext to text_area's value
# tell application "R" to cmd (the clipboard)
# set newtext to text_area's value
#
# -- Find the difference between old and new
# set the clipboard to text from ((oldtext's length) + 1) to -1 of
newtext
# set oldtext to ""
# set newtext to ""
# set text_area to ""
# end tell
#
###########################################
_________________________
Any comments?
Is there someone who is quasi responsible for this bundle?
All the best,
Hans
I'm working with an open-source Java project that uses the so-called
"mixed" mode for indentation. This is the convention popularized by
Emacs where indentations are (say) 4 spaces but tab characters expand
to 8 spaces. Unfortunately, TextMate does not support this mode, as
discussed previously [1]. There is a script that converts between
mixed mode, but it appears to be manual [2], which won't work in my
case. (I'd have to run the conversion every time I open and save a
file.)
So, I need a better solution to get around TextMate's lack of support
for mixed mode. I was thinking about submitting a patch upstream that
would simply get rid of mixed mode and instead use Java's standard
convention [3], but then I noticed that it apparently recommends
mixed mode!
"Four spaces should be used as the unit of indentation. The exact
construction of the indentation (spaces vs. tabs) is unspecified.
Tabs must be set exactly every 8 spaces (not 4)."
Am I reading that right? Does Java's coding standard recommend mixed
mode indentation? What are TextMate users to do in this situation?
Trevor
[1] http://comox.textdrive.com/pipermail/textmate/2004-December/
002053.html
[2] http://comox.textdrive.com/pipermail/textmate/2006-November/
015565.html
[3] http://java.sun.com/docs/codeconv/html/CodeConventions.doc3.html
Newbie woes. Had TextMate working fine with TeXniscope with the
settings below. Then, I tried to set up PDFView (it just looks better)
according to the instructions on their web page.
In the Bundle Editor I wrote over the old TeXniscope item, calling the
new item "Show in PDFView (pdfsync)" and copied the commands from the
PDFView web page for setting up TextMate.
My TextMate preferences Shell Variables are:
TM_LATEX_COMPILER latex
TX_PSTRICKS 1
I hit Command-R (Typset & View PDF) and all the tex files are created.
I just cannot view the pdf file from within TextMate by hitting
Ctrl-Option-Command-O (Show in PDFView).
Any suggestions?
thanks
walter johnson
Is there any way to get a command to play a sound when it is complete?
I can't think of any shell script for just playing a sound, but I'm
looking for something like:
echo "
Aprox. page #$(( (TM_LINE_NUMBER+31) / 32 ))
"
play "$TM_BUNDLE_SUPPORT/harp.wav"