zsh-workers
 help / color / mirror / code / Atom feed
From: "Andrej Borsenkow" <borsenkow.msk@sni.de>
To: "ZSH workers mailing list" <zsh-workers@sunsite.auc.dk>
Subject: Completion widgets, bindkey and ZLE widgets
Date: Wed, 24 Mar 1999 14:49:34 +0300	[thread overview]
Message-ID: <001f01be75ec$62b12220$21c9ca95@mowp.siemens.ru> (raw)

Currently we have to use bindkey to activate completion widgets. I
understand, that it was the simplest way in the beginning (and safest, must
I add :-) Unfortunately it means, that
you must select your keymap before loading completion and only one keymap is
modified. This is particulary annoying, when you change keymap after that. I
was very confused by the fact, that I have EDITOR=vim and bidkey -e by
default; this results in selecting vi mode with zsh -f - and after I
switched to emacs, all new completion was lost. And if on-the-fly keymap
switching will be implemented (actually, internally we already have it -
between viins and vicmd and from emacs to vi), this may be a real problem.

Now, that new completion is already proven fact, why not simply redefine
completion widgets? zle -C complete-word complete-word FUNCTION. The
original widget is always available (.complete-word) and you can change back
in any time. And this will make completion widgets available in any keymap.

A step further is to unify normal widgets (zle -N) and completion (zle -C).
Consider:

widgets are always called using standard interface described in ZLE (with
all parameters likes BUFFER, NUMERIC etc set).

if this is a completion widget, additional parameters (and arguments) are
setup.

We still need to designate widget as completion widget in this case, so
zle -N won't work - but -C can then be reduced to simple 'zle -C expand-word
function'. That will redefine complete-word and mark new widget as
completion widget.

Looks somewhat cleaner ... and, later, if we find the way to make ZLE
widgets more useful, that will be automatically available to completion
widgets as well.

cheers

/andrej


             reply	other threads:[~1999-03-24 11:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-24 11:49 Andrej Borsenkow [this message]
1999-03-24 12:17 Sven Wischnowsky
1999-03-24 12:52 ` Andrej Borsenkow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='001f01be75ec$62b12220$21c9ca95@mowp.siemens.ru' \
    --to=borsenkow.msk@sni.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).