[TxMt] R bundle: getSig.r function of 'Insert Command Template' problem

Kevin Ballard kevin at sb.org
Sat Dec 30 10:45:40 UTC 2006


Thanks. Fixed in r6416.

Incidentally, gsub doesn't modify the variable, so the second should  
wrap the first, not come after the first. This is especially  
important because, if you'll notice, there's not a single semicolon  
in getSig.R as it stands now - it's purely functional, and I'd like  
to keep it that way ;)

If you pay attention, you'll notice I made the escape function a  
default argument to another function specifically so I could preserve  
the purely functional aspect here.

On Dec 19, 2006, at 6:51 AM, Hans-Joerg Bibiko wrote:

> I just found a very tiny bug within the R function getSig.r of that  
> bundle.
> If you type 'plot.lm' and invoke that command to get the template  
> it gives you a weird output because within the formals you find an  
> item 'caption', and within this item there is a '\n'. The ruby pop  
> down menu, of course, interprets a '\n' as a new line.
>
> To avoid this I would include within the getSig.r at line 12 this:
>
> 10:		if (is.symbol(f[[arg]]) && f[[arg]] == "") arg else list(arg, f 
> [[arg]])
> 11:	),
> 12:	function (arg, escape=function(x) ifelse(snippet, {gsub("([\\ 
> $`}])", "\\\\\\1", x);gsub("\n", "", x)}, x))
> 13:		if (is.list(arg))
>
> i.e. I add a  gsub in the 'escape' function to delete each '\n'
>
> I don't know whether this will be good. The case is very rarely.
>
> Comments?

-- 
Kevin Ballard
http://kevin.sb.org
kevin at sb.org
http://www.tildesoft.com


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20061230/ec3722cb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2432 bytes
Desc: not available
URL: <http://lists.macromates.com/textmate/attachments/20061230/ec3722cb/attachment.p7s>


More information about the textmate mailing list