Hi. I have two different, but related, issues.
First, how does one execute a single line / selection in shell mode? I've enabled enhanced terminal usage. Script (cmd-R) executes fine, but on the entire document. The Textmate Manual direction (http://manual.macromates.com/en/shell_commands) to use ^R for a line or selection does not produce any results other than a forward slash.
Second, has anyone solved the "execute line / selection" issue in the Python bundle? (http://stackoverflow.com/questions/1775954/using-python-3-1-with-textmate). Again, can run an entire script just fine, but line/selection functionality appears broken and returns the following.
Traceback (most recent call last): File "/tmp/temp_textmate.QffC1S", line 19, in <module> stdout.write(exc) TypeError: argument 1 must be string or read-only character buffer, not list
I'm working on a MBP running Snow Leopard with most recent version of TM. Am hoping I am just missing something obvious, but have spent a few (fruitless) hours googling and searching the mailing list.
Am new to Textmate (couple of months) but already convinced it is an ideal editor for me. The R, Latex and Sweave bundles are nothing short of remarkable. Any help or directions to solutions would be greatly appreciated, and would make what is already a great tool, almost perfect.
Cheers
Charlie
On Sun, Feb 26, 2012 at 3:20 PM, Charles DiMaggio < charles.dimaggio@gmail.com> wrote:
Hi. I have two different, but related, issues.
First, how does one execute a single line / selection in shell mode? I've enabled enhanced terminal usage. Script (cmd-R) executes fine, but on the entire document. The Textmate Manual direction ( http://manual.macromates.com/en/shell_commands) to use ^R for a line or selection does not produce any results other than a forward slash.
Create a new file in TextMate, and enter this text:
echo $PATH
Then hit Ctrl-R. What do you see?
Cheers,
David.
Thank you very much for that remarkably fast response. I get:
/Applications/TextMate.app/Contents/SharedSupport/Support/bin/CocoaDialog.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/Applications/TextMate.app/Contents/SharedSupport/Support/bin
Charlie
On Feb 26, 2012, at 10:32 AM, David Howden wrote:
On Sun, Feb 26, 2012 at 3:20 PM, Charles DiMaggio charles.dimaggio@gmail.com wrote: Hi. I have two different, but related, issues.
First, how does one execute a single line / selection in shell mode? I've enabled enhanced terminal usage. Script (cmd-R) executes fine, but on the entire document. The Textmate Manual direction (http://manual.macromates.com/en/shell_commands) to use ^R for a line or selection does not produce any results other than a forward slash.
Create a new file in TextMate, and enter this text:
echo $PATH
Then hit Ctrl-R. What do you see?
Cheers,
David.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
OK, then. That last bit helped sort me out on the shell command issue. I was trying to use ^R to reach a location that was not in the path that TM inherited from Finder. Thanks again, David. One issue down, one to go.
Charlie
On Feb 26, 2012, at 10:32 AM, David Howden wrote:
On Sun, Feb 26, 2012 at 3:20 PM, Charles DiMaggio charles.dimaggio@gmail.com wrote: Hi. I have two different, but related, issues.
First, how does one execute a single line / selection in shell mode? I've enabled enhanced terminal usage. Script (cmd-R) executes fine, but on the entire document. The Textmate Manual direction (http://manual.macromates.com/en/shell_commands) to use ^R for a line or selection does not produce any results other than a forward slash.
Create a new file in TextMate, and enter this text:
echo $PATH
Then hit Ctrl-R. What do you see?
Cheers,
David.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On Sun, Feb 26, 2012 at 5:08 PM, Charles DiMaggio < charles.dimaggio@gmail.com> wrote:
OK, then. That last bit helped sort me out on the shell command issue. I was trying to use ^R to reach a location that was not in the path that TM inherited from Finder. Thanks again, David. One issue down, one to go.
No worries :-).
Are you using TM2 alpha or TM1?
David.
Charlie
On Feb 26, 2012, at 10:32 AM, David Howden wrote:
On Sun, Feb 26, 2012 at 3:20 PM, Charles DiMaggio < charles.dimaggio@gmail.com> wrote:
Hi. I have two different, but related, issues.
First, how does one execute a single line / selection in shell mode? I've enabled enhanced terminal usage. Script (cmd-R) executes fine, but on the entire document. The Textmate Manual direction ( http://manual.macromates.com/en/shell_commands) to use ^R for a line or selection does not produce any results other than a forward slash.
Create a new file in TextMate, and enter this text:
echo $PATH
Then hit Ctrl-R. What do you see?
Cheers,
David.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Also, I followed that link you gave in relation to the python problem. I don't see what it has to do with the issue - I think I'm missing something here?
Cheers,
David.
On Sun, Feb 26, 2012 at 7:16 PM, David Howden dhowden@gmail.com wrote:
On Sun, Feb 26, 2012 at 5:08 PM, Charles DiMaggio < charles.dimaggio@gmail.com> wrote:
OK, then. That last bit helped sort me out on the shell command issue. I was trying to use ^R to reach a location that was not in the path that TM inherited from Finder. Thanks again, David. One issue down, one to go.
No worries :-).
Are you using TM2 alpha or TM1?
David.
Charlie
On Feb 26, 2012, at 10:32 AM, David Howden wrote:
On Sun, Feb 26, 2012 at 3:20 PM, Charles DiMaggio < charles.dimaggio@gmail.com> wrote:
Hi. I have two different, but related, issues.
First, how does one execute a single line / selection in shell mode? I've enabled enhanced terminal usage. Script (cmd-R) executes fine, but on the entire document. The Textmate Manual direction ( http://manual.macromates.com/en/shell_commands) to use ^R for a line or selection does not produce any results other than a forward slash.
Create a new file in TextMate, and enter this text:
echo $PATH
Then hit Ctrl-R. What do you see?
Cheers,
David.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
After further investigation, I think that this I have found the link you meant to post: http://stackoverflow.com/questions/5282567/textmate-execute-line-selection-f...
There is indeed a bug in the execute line/selection python code - for a start the error that is shown in TM2 is not helpful, and the error catching code in the script does need fixing to change this (at least!).
I have played around with the rest of the code, and can't decide how it should work.
Currently it takes the input (current selection, or the current line), and uses eval() to evaluate it. Of course, this fails for certain statements, such as
print "Hello World"
I changed my python bundle to use exec, but this fails for things like:
1+1
as it doesn't return the output. Obviously running print 1+1 fixes this
I am hesitant to change the default behaviour of the bundle, as I don't know what the purpose of the command is in the first place :-). I suggest that you decide between the two approaches and fork the bundle for your own use.
Cheers,
David.
On Sun, Feb 26, 2012 at 7:22 PM, David Howden dhowden@gmail.com wrote:
Also, I followed that link you gave in relation to the python problem. I don't see what it has to do with the issue - I think I'm missing something here?
Cheers,
David.
On Sun, Feb 26, 2012 at 7:16 PM, David Howden dhowden@gmail.com wrote:
On Sun, Feb 26, 2012 at 5:08 PM, Charles DiMaggio < charles.dimaggio@gmail.com> wrote:
OK, then. That last bit helped sort me out on the shell command issue. I was trying to use ^R to reach a location that was not in the path that TM inherited from Finder. Thanks again, David. One issue down, one to go.
No worries :-).
Are you using TM2 alpha or TM1?
David.
Charlie
On Feb 26, 2012, at 10:32 AM, David Howden wrote:
On Sun, Feb 26, 2012 at 3:20 PM, Charles DiMaggio < charles.dimaggio@gmail.com> wrote:
Hi. I have two different, but related, issues.
First, how does one execute a single line / selection in shell mode? I've enabled enhanced terminal usage. Script (cmd-R) executes fine, but on the entire document. The Textmate Manual direction ( http://manual.macromates.com/en/shell_commands) to use ^R for a line or selection does not produce any results other than a forward slash.
Create a new file in TextMate, and enter this text:
echo $PATH
Then hit Ctrl-R. What do you see?
Cheers,
David.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Yes, that's the link and the issue. And your response gives me a clear fix, I'll edit my bundle to use exec, which with print() gives me a unified solution. I Once again, many thanks for you help with this. Had no expectation of resolving both issues so quickly.
Cheers
Charlie
PS -'m using TM1 for now, but looking forward to the upgrade.
On Feb 26, 2012, at 2:46 PM, David Howden wrote:
After further investigation, I think that this I have found the link you meant to post: http://stackoverflow.com/questions/5282567/textmate-execute-line-selection-f...
There is indeed a bug in the execute line/selection python code - for a start the error that is shown in TM2 is not helpful, and the error catching code in the script does need fixing to change this (at least!).
I have played around with the rest of the code, and can't decide how it should work.
Currently it takes the input (current selection, or the current line), and uses eval() to evaluate it. Of course, this fails for certain statements, such as
print "Hello World"
I changed my python bundle to use exec, but this fails for things like:
1+1
as it doesn't return the output. Obviously running print 1+1 fixes this
I am hesitant to change the default behaviour of the bundle, as I don't know what the purpose of the command is in the first place :-). I suggest that you decide between the two approaches and fork the bundle for your own use.
Cheers,
David.
On Sun, Feb 26, 2012 at 7:22 PM, David Howden dhowden@gmail.com wrote: Also, I followed that link you gave in relation to the python problem. I don't see what it has to do with the issue - I think I'm missing something here?
Cheers,
David.
On Sun, Feb 26, 2012 at 7:16 PM, David Howden dhowden@gmail.com wrote: On Sun, Feb 26, 2012 at 5:08 PM, Charles DiMaggio charles.dimaggio@gmail.com wrote:
OK, then. That last bit helped sort me out on the shell command issue. I was trying to use ^R to reach a location that was not in the path that TM inherited from Finder. Thanks again, David. One issue down, one to go.
No worries :-).
Are you using TM2 alpha or TM1?
David. Charlie
On Feb 26, 2012, at 10:32 AM, David Howden wrote:
On Sun, Feb 26, 2012 at 3:20 PM, Charles DiMaggio charles.dimaggio@gmail.com wrote: Hi. I have two different, but related, issues.
First, how does one execute a single line / selection in shell mode? I've enabled enhanced terminal usage. Script (cmd-R) executes fine, but on the entire document. The Textmate Manual direction (http://manual.macromates.com/en/shell_commands) to use ^R for a line or selection does not produce any results other than a forward slash.
Create a new file in TextMate, and enter this text:
echo $PATH
Then hit Ctrl-R. What do you see?
Cheers,
David.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate