Sunday, March 04, 2007

dabbrev-expand

How on earth did I code before emacs's dabbrev-expand function? I have even sometimes gone as far as to assign it to a key on the home row (k). Regular k is typed with C-qk.

One can do improve it in two ways: Given a string "abc", instead of search for the regexp /^abc.*/, one can search for /^a.*b.*c.*/ which will more rapidly narrow down among many symbols that begin with the same long prefix.

One can also search for symbols only in lexical scope. It looks challenging, though perhaps not so bad in a Lisp-like language that has been indented properly. The indentation hint is key when in the middle of development and the parentheses don't match properly yet.

1 comment :

Anonymous said...

with regard to your comment on use of regexps such as /^a.*b.*c.*/ you might be interested to look at
Magpie Expansion
where I have put something similar to what you discuss at almost the same time.