[TxMt] Replacement command for the C Library Bundle

Charilaos Skiadas skiadas at hanover.edu
Thu Dec 14 13:12:56 UTC 2006


On Dec 14, 2006, at 2:59 AM, Joachim Mårtensson wrote:

> I have written a replacement command for the C Library Bundle and  
> placed
> in the C Bundle. Type at least the first letter in the function you  
> want
> to autocomplete and hit ctrl-M, this will bring up a menu where you  
> can
> choose which function you want to complete.

Great work Joachim! Some comments:

1. ctrl-M might not be the most appropriate combo. In general ctrl-..  
combos are reserved for the user to use as they please.

2. Is it possible for the command to have two fall-back options? a)  
If the current word/selection doesn't match the beginning of the  
command, then search anywhere in the command name. b) If that doesn't  
work either, then search in some "keyword list", perhaps in another  
file containing one line of keywords for each snippet. For starters,  
this could be taken possibly from the menu structure that the C  
Library menus were using, for now at least.

3. Is it significantly more efficient to use the gz file instead of  
the txt file? With the txt file, it would be easier for the user to  
customize at will. In fact it might be nice to allow for a user- 
created file with similar format, and the command would then search  
in that file as well, in which case the original file can be kept at  
gz state without problems. Then another command would be allowing  
users to edit this file, kind of like the "Edit Configuration File"  
command in the LaTeX bundle works.

> The completions are stored in the file CLib.txt.gz, add that file  
> to the
> Support folder in the C Bundle in. The completions where taken from  
> the
> (now removed) C Library Bundle running the following command in the
> Snippet folder.
>
> ruby -e "Dir[\"*\"].each do |name| puts
> open(name).read.match(/content<\/key>\n\s*<string>(.*)/)[1] end"
>
> if for some reason CLib.txt.gz is to large for the list use that to
> generate CLib.txt and gzip it.

Haris





More information about the textmate mailing list