[TxMt] DIALOG2 popup Summary + Suggestion
Hans-Joerg Bibiko
bibiko at eva.mpg.de
Fri Apr 18 12:27:23 UTC 2008
Hi,
maybe some of you wondered about this thread ;)
I would like to clarify it a bit.
My overall goal was to figure out whether it's possible to use this
popup dialog in such a way that one can separate: what I'm seeing in
the list, what I'm typing, and what I'm getting. I call it lookup mode.
Example:
{display="2" ; match="DIGIT TWO 2 NUMBER DOS DOIS ZWEI TWEE" ;
insert="${1:you've chosen }2${0;}"; }
| "$DIALOG" -ile ' '
option -l = lookup mode
If you invoke that you will see the normal popup list but with an
header. The header title stores my keyboard events, because no
keyboard event will send to TM, only to popup.
Now you can type any string in like "ois" and it find "2".
If one types "ois digit" it also finds "2" because popup looks for
CONTAINS "ois" AND CONTAINS "digit".
In other words you can insert a string by looking for its properties.
Well, what can you do with it? There are multifarious applications
possible.
Here
http://www.bibiko.de/TM_DIALOG2_popup_lookup.mov (1M)
I show three simple examples. (This is only a prototype!!)
-insert a character by looking for its Unicode name
-insert an HTML entity by looking for the character itself or by the
entity name
-Obj-C: It often occur to me that I want to insert a method let's say
for NSString and I cannot remember how it begins, e.g.
"stringWithUTFString". But I know that "utf" is in it. So I can use
this lookup mode.
Further more one could use it as a tiny translator.
display="work"; match="arbeiten"
Thus I can search for "arbeit" and I get "work".
And so forth.
Furthermore there is an option -b which allow to look for the begin of
words only inside "match".
But by doing this I have some limitations:
1) The size of my suggestions:
Up to now I have to pipe it to DIALOG2 but this size is limited. Maybe
it is worth to think about a mechanism to load a file containing the
suggestions.
2) Dead keys:
In lookup mode I allow to use OPTION+ to insert e.g. ß or ø. But if I
want to use a dead key like OPTION+e u to get ú, well this is up to
now not possible, because I do not how. One easy solution would be
instead of using the header of the table to use a NSTextField which
can handle it.
Well, to have that functionality in popup it only costs a very few
lines of code more.
But the first question to all of you is whether it's worth to
implement that lookup mode?
All the best,
--Hans
More information about the textmate
mailing list