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

PATCH: pws-22: zle -C after rebinding completion widgets



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@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



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