zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: Overriding a yank* widget in zle
Date: Fri, 31 Dec 2010 00:28:20 -0800	[thread overview]
Message-ID: <101231002820.ZM7583@torch.brasslantern.com> (raw)
In-Reply-To: <AANLkTikgELYV5WuDOD9XEPRX7mUiGhtObx6Q5v=DzB2S@mail.gmail.com>

On Dec 30,  1:59pm, Wayne Davison wrote:
} 
} I've coded up a patch that adds the -y option to zle so that I can define a
} "zle -Ny yank" widget (as well as yank-pop), which marks it as being a
} ZLE_YANK equivalent.

This sort of follows from "zle -C".  For completion widgets, it was
recognized that there are a set of behaviors which are the model for
any newly-added widget, and the builtin completion widgets provide
names for those behaviors.

Perhaps a general solution would be that for *any* widget, not just
a completion one, it should be possible to name a "prototype" widget
whose behavior the new widget is intended to simulate or replace.
"zle -P WIDGET PROTOTYPE-WIDGET [FUNCTION]" where "zle -N ..." becomes
a special case equivalent to "zle -P WIDGET self-insert FUNCTION",
or something to that effect (or maybe undefined-key instead).

Then one could write, e.g.,

  zle -P history-search-sideways history-incremental-search-forward

and zle would "know" to invoke the minibuffer and re-call the function
as each new keystroke is typed, without that needing to be coded as a
loop in the widget itself.

Then the question would be whether we still need "zle -C ..." other
than for backward compatibility.

The only other solution to this that I've thought of would be to follow
the example of the auto-suffix-remove and auto-suffix-retain widgets,
that is, have a special widget whose only effect is to have the side-
effect of enabling yank-pop on the next interaction: yank-pop-enable
perhaps (is yank-pop-disable ever needed?).


  parent reply	other threads:[~2010-12-31  8:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-30 21:59 Wayne Davison
2010-12-31  6:39 ` Wayne Davison
2010-12-31  8:28 ` Bart Schaefer [this message]
2010-12-31 23:23   ` Wayne Davison
2015-08-31  7:54   ` PATCH: Implement zle -P Mikael Magnusson
2015-08-31  7:56     ` Mikael Magnusson
2015-08-31  9:55     ` PATCH: Set completion function flags correctly for " Mikael Magnusson
2015-08-31 10:17       ` Mikael Magnusson
2015-08-31 17:11     ` PATCH: Implement " Peter Stephenson
2015-09-01  6:23       ` Bart Schaefer
2015-09-01  6:50         ` Mikael Magnusson

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=101231002820.ZM7583@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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).