[TxMt] R bundle: Suggestions for 'Insert Command Template'

Kevin Ballard kevin at sb.org
Sat Dec 30 10:31:19 UTC 2006


On Dec 19, 2006, at 4:56 AM, Hans-Joerg Bibiko wrote:

> Nevertheless I have some humble suggestions to improve it:
>
> 1)
> Now this command executes the apropos function within a new fresh R  
> session. This means that it doesn't know which libraries I'm  
> currently using and it doesn't know which functions I defined  
> within my R session. To use 'Insert Command Template' also for this  
> you should load the function 'getSig.r' in my current session  
> (renamed in '.getSig' ) and executes this within my session to get  
> these signatures too.
> By doing so you would increase the speed of it enormously and you  
> can insert signatures for user-defined functions and functions  
> coming from loaded libraries.
> The disadvantage of it would be that you have such queries in your  
> current session; ok you don't see them in the TM R console window,  
> but if you save it workspace you would have these.
> To avoid this you could think about to write the answer of the  
> query into a file and load it in TM.
> Or, if you don't interested in the user-defined functions you could  
> start a new R session which loads all libraries which are loaded in  
> my current session.
> (I don't know whether this would also work for user-defined  
> fucntions?)

That only works if you have a "current session". I assume you use the  
hackery that uses R.app to execute stuff? I, for example, don't like  
that and so I don't use it at all, so I wouldn't have the concept of  
a "current session".

I'd like to let it load libraries which are loaded in your current  
session, as well as detect function definitions and provide those as  
well. I just don't know how much work it takes to do that safely  
(safely meaning you don't want any side effects) and cleanly.

> 2)
> If you use the approach in 1) then you can do more elaborated  
> things with it because of the speed.
> Examples:
> -If I look for for a keyword it will insert the signature like the  
> old version. If there is nothing found it will look for functions  
> which begins with the keyword like the old version.
> -If I type e.g. 'data.' it lists all methods for 'data.' like  
> data.class, data.frame etc. but not 'dataentry'
> -If I type e.g. '.difftime' you get all functions where '.difftime'  
> is specified like mean.difftime, print.difftime. To insert the  
> signature you have to select the keyword in beforehand otherwise it  
> shows a tooltip.
> -If I have no idea about the complete name of a function you can  
> type e.g. '.load.'. This would look for '*load*' as regexp.  
> Furthermore sometimes I cannot remember whether the a function is  
> called 'shownames' or 'showNames', so you can write '.names.' and  
> it looks for '*names*|*Names*'.
> I would use periods for '.foo.' for indicating this because it will  
> be caught be Ruby's getword function.
>
> Of course you can do more things:
> -You could catch the 'apropos()' function and run it in TM and  
> print the result as pop down menu
>
> and  and  and
>
> What do you think about it?
>
> To change to code would be relatively easy.

I'm not really sure I understand the second point here.

-- 
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/f5ce1da5/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/f5ce1da5/attachment.p7s>


More information about the textmate mailing list