[TxMt] Re: req: command output to contextual menu

Mats Persson mats at imediatec.co.uk
Sun Feb 20 17:19:25 UTC 2005

On 20 Feb 2005, at 13:27, max at machinate.org wrote:
> Maybe it would be a bit harder than I thought to make it backwards
> compatible. Keep thinking about it though.
> The reason I asked for it in the first place is that I was making a 
> script
> to insert filenames into textmate, a bit like pressing tab in terminal.
> Sometimes I would get more than one result, and I wanted those to 
> appear in
> a list. Now I've been thinking about it though, it might be a nice 
> thing to
> have this behaviour built into Textmate.
> An example would be that if you typed in an html document: "href='i" 
> and
> then pressed tab, you could invoke a menu which showed files matching 
> 'i.*'.
> It could even be multi-dimensional as in my included mock-up.

OK, not wishing to detract, offend or anything else here other than 
being helpfull. Max, you can find a really nice implementation of this 
type of functionality is in skEdit when dealing with <img> or  <a> 
tags. skEdit is $20 and beats both DW & BBEdit, but struggles a bit to 
compare with TM in some areas :)

Now on to the interesting part, where I'm thinking aloud which is not 
always a good thing. :)
Perhaps naively, but I think much of this functionality already exists 
in TM, although I can't see how to control it into a functional format 
right now.  Maybe the grand master Allan can whip something up in his 
magic chambers late at night ??

The required ingredients (with additions):
- Go To File Chooser: (does all we would need in it's non QS way to 
list available files)
	-- need to be able to set search dir starting point: i.e. when typing 
"images/" we only see files in "images" dir
	-- have context flag: i.e. when looking for images we only want to see 
.jpg, .gif, .png files
	-- ability to invoke GTFchooser from commands with path and context 
flag data
		example: $TM_FILE_CHOOSER --path "images/" --context img
	-- ability to receive the output from GTFchooser in a command

- Multiple Commands Pop-up Menu (in use when commands share the same 
key trigger)
	-- ability to invoke the pop-up menu ($TM_POPUP_MENU ??) in a command 
and send it data
	-- ability to receive chosen item from pop-up menu 
	   then process that choice to insert correct data rather than what's 
just displayed in the menu
	-- ability to display a simplified version of GTFchooser (with small 
scrollbar) into the menu

Add the above abilities to a command of your liking with whatever 
functionality you'd like and we have a form of TM pop-up menu that can 
enable a multitude of great things!!  File look-ups or auto-completes 
are just two things.
I hope you all can see the same picture/possibilities that I see. 
Apologies if you can't, sort of find it hard to explain it clearly.

Now I do not expect Allan to get this going anytime soon, but sometimes 
he does amaze us mere mortals with his coding skills.

Kind regards,


"TextMate, coding with an incredible sense of joy and ease"
- www.macromates.com -

More information about the textmate mailing list