zsh-users
 help / color / mirror / code / Atom feed
* Equivalent of tcsh dabbrev-expand?
@ 1998-01-02  2:12 Adam Spiers
       [not found] ` <199801032056.UAA01450@dal-tsa11-15.cyberramp.net>
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Spiers @ 1998-01-02  2:12 UTC (permalink / raw)
  To: zsh users mailing list

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Equivalent of tcsh dabbrev-expand?
       [not found] ` <199801032056.UAA01450@dal-tsa11-15.cyberramp.net>
@ 1998-01-04 21:33   ` Adam Spiers
  0 siblings, 0 replies; 2+ messages in thread
From: Adam Spiers @ 1998-01-04 21:33 UTC (permalink / raw)
  To: TGAPE!

TGAPE! (tgape@cyberramp.net) wrote:
> history-beginning-search-backwards works for me...  It does what you
> want, it's documented, I don't know what more you could ask
> for...

Actually it's not at all what I want.  Looking back at my
original post I see that maybe I didn't make it quite clear
enough what tcsh's dabbrev-expand function does - it expands
/words/ from the history not whole lines.  I already use
history-beginning-search-backwards lots (M-p and M-/ were my two
most commonly used key-presses in tcsh!) but the functionality
of dabbrev-expand is quite different and very useful in its own
right.

> Before you claim functionality isn't there, you might try looking at
> zshall - sure, it's huge, but zsh isn't necessarily organized the way
> you think it is.

Oh believe me, I've looked at zshall!  In fact, I've looked in
great detail at every zsh man page, and I'm pretty much
convinced that there's currently no way of implementing
dabbrev-expand short of modifying the code (which is probably
what I'll do :-).

Thanks for your input anyway.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-01-04 21:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-01-02  2:12 Equivalent of tcsh dabbrev-expand? Adam Spiers
     [not found] ` <199801032056.UAA01450@dal-tsa11-15.cyberramp.net>
1998-01-04 21:33   ` Adam Spiers

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).