Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Equivalent of tcsh dabbrev-expand?



I've been meaning to switch from tcsh to zsh for a while now, as
zsh is clearly vastly superior.  However, one thing has put me
off, and that is the apparent lack of a key command which is the
equivalent of tcsh's dabbrev-expand.  For those who don't know,
dabbrev-expand is a method of completion which works by looking
backwords through the history to find a matching word, and I
believe may have originated from emacs' Lisp function of the
same name (by default both tcsh and emacs bind M-/ to it).

I realise that compctl provides the -H switch for searching
through history, but I find it extremely useful to have the
dabbrev-expand functionality bound to a separate key so that I
can choose whether I want to complete a word from the history or
according to the compctl settings.  Not only would having this
choice be useful in itself, but it would also eliminate the
problem of having history and other completions merged into the
same list of possible completions; this is currently a problem
with zsh because if you use the -H switch in order to be able to
complete from history and then on a particular occasion wish to
complete using file names, you can't get a list solely of
available files through list-choices or AUTO_LIST or whatever.

I did extensive searches through script archives, FAQs, mailing
list archives etc. but couldn't find any mention of anyone else
who's wanted to do this or even succeeded.  At first I thought
it would be possible to write a function which temporarily makes
all commands complete using history only, and then bind that to
the M-/ keypress, but I've just discovered that being able to
bind keypresses to functions is still on the wishlist :-(

So, could anyone tell me if there's another way of doing it that
I've missed, or if it would be particularly hard to write a
patch for the source which introduces the function?  Should I
join the zsh-workers list and mention it there?

Many thanks in advance!

--
Adam Spiers, Computing Officer, New College, Oxford University, UK **
cello/modern jazz/juggling/cycling/Perl/Linux/Quake fanatic, M$ hater



Messages sorted by: Reverse Date, Date, Thread, Author