zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: "Zsh hackers list" <zsh-workers@sunsite.auc.dk>
Subject: PATCH: pws-22: zle -C after rebinding completion widgets
Date: Wed, 16 Jun 1999 18:14:40 +0200	[thread overview]
Message-ID: <9906161614.AA17674@ibmth.df.unipi.it> (raw)
In-Reply-To: "Peter Stephenson"'s message of "Wed, 16 Jun 1999 17:42:42 DFT." <9906161542.AA12356@ibmth.df.unipi.it>

Peter Stephenson wrote:
> "Andrej Borsenkow" wrote:
> > Since I've never seen any reply to this, I repeat it here.
> > 
> > My suggestion was, that instead of rebinding keys (as is done currently) we
> > should simply redefine corresponding widgets.
> 
> This certainly looks like a good idea.

One tweak might be nice first: if a completion widget, for example
complete-word, is rebound, then `zle -C ... complete-word ...' doesn't
work; you need .complete-word.  There's no reason in this case why we
shouldn't use the immortal version with the `.' in front all the time,
since the intention is unambiguous.

--- Doc/Zsh/compwid.yo.dot	Mon Jun 14 09:12:38 1999
+++ Doc/Zsh/compwid.yo	Wed Jun 16 18:07:45 1999
@@ -26,7 +26,8 @@
 tt(complete-word), tt(expand-or-complete),
 tt(expand-or-complete-prefix), tt(menu-complete),
 tt(menu-expand-or-complete), tt(reverse-menu-complete),
-tt(list-choices), or tt(delete-char-or-list).
+tt(list-choices), or tt(delete-char-or-list).  Note that this will still
+work even if the widget in question has been rebound.
 
 startmenu()
 menu(Special Parameters)
--- Src/Zle/zle_thingy.c.dot	Mon Jun 14 16:46:53 1999
+++ Src/Zle/zle_thingy.c	Wed Jun 16 18:06:12 1999
@@ -490,7 +490,8 @@
 	return 1;
     }
 #endif
-    t = rthingy(args[1]);
+    
+    t = rthingy((args[1][0] == '.') ? args[1] : dyncat(".", args[1]));
     cw = t->widget;
     unrefthingy(t);
     if (!cw || !(cw->flags & ZLE_ISCOMP)) {

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


  reply	other threads:[~1999-06-16 16:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-15  9:15 pws-22 Peter Stephenson
1999-06-15 10:10 ` pws-22 Helmut Jarausch
1999-06-15 15:23 ` New completion - redefine widgets instead of rebinding keys pws-22 Andrej Borsenkow
1999-06-16 15:42   ` Peter Stephenson
1999-06-16 16:14     ` Peter Stephenson [this message]
1999-06-18 14:55     ` Peter Stephenson
1999-06-15 15:40 ` Modules and function install " 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=9906161614.AA17674@ibmth.df.unipi.it \
    --to=pws@ibmth.df.unipi.it \
    --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).