[TxMt] Reformat comment command

Alan Schussman alan at schussman.com
Wed Aug 23 22:51:37 UTC 2006


On Aug 23, 2006, at 3:20 PM, James Edward Gray II wrote:

>>>     text = `ruby "#{ENV["TM_SUPPORT_PATH"]}/bin/rubywrap.rb" # 
>>> {flags}`
>>
>> Here's where I go "huh." That works, but 1) I don't at all get how  
>> the input is passed to the command; and 2) if I call on STDIN.read  
>> prior to this line (by using it to get the beginning of the  
>> input), then that line fails to get any input, and I have to  
>> manually pipe the text back into it. What's happening there?
>
> Well, if you call read(), you consume the input, so it's not there  
> to pass on to the child process.

I was guessing that was the case. But how about the first question,  
if there is input how does that statement suck it up automatically?  
(Apologies if this is excruciatingly basic; I'm just trying to  
understand how the input gets passed without explicitly doing so.)

> Hmm, I think you are still having trouble understanding where to  
> use these:
>
>   e_sh(): for data headed to the shell

Aha, now that I know there's e_sh(), I do understand it. Thanks :)

> Here's the code I just moved into the Source bundle.  Let me know  
> if this is working please:

It looks like it works well for most cases, but I think the more  
lenient regex causes a problem in the case of a latex comment such as  
"%\usepackage" (note no space); in that case, the comment parameter  
is set to "%\" and the backslash ends up causing problems.

Cheers-
-Alan






More information about the textmate mailing list