Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: for Re: REC_EXACT and AUTO_MENU, and compctl -U too
- X-seq: zsh-workers 4140
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxxx
- Subject: PATCH: for Re: REC_EXACT and AUTO_MENU, and compctl -U too
- Date: Mon, 22 Jun 1998 08:45:04 +0200 (MET DST)
- In-reply-to: "Bart Schaefer"'s message of Fri, 19 Jun 1998 11:14:59 -0700
Bart Schaefer wrote:
>
> ...
>
> While I'm on the subject of mildly stupid completion behavior, automenu
> in conjunction with compctl -U could do with a bit of work. It'd be a
> lot more useful if menu completion kicked in immediately when compctl -U
> returns multiple matches and automenu is set. Otherwise you lose both
> the set of completions and the nonunique suffix as soon as the first TAB
> is pressed.
>
Sounds very reasonable. And if we want to do it in the drastic way you
described, the patch is pretty simple.
Bye
Sven
*** Src/Zle/zle_tricky.c.old Mon Jun 22 08:23:18 1998
--- Src/Zle/zle_tricky.c Mon Jun 22 08:26:36 1998
***************
*** 2246,2252 ****
{
Compctl cc = NULL;
int oloffs = offs, owe = we, owb = wb, ocs = cs, oll = ll, isf = 1;
! int t, sf1, sf2, ooffs;
char *p, *sd = NULL, *tt, *s1, *s2, *os = NULL;
unsigned char *ol = NULL;
--- 2246,2252 ----
{
Compctl cc = NULL;
int oloffs = offs, owe = we, owb = wb, ocs = cs, oll = ll, isf = 1;
! int t, sf1, sf2, ooffs, um = usemenu;
char *p, *sd = NULL, *tt, *s1, *s2, *os = NULL;
unsigned char *ol = NULL;
***************
*** 2266,2271 ****
--- 2266,2272 ----
if (unset(COMPLETEINWORD) && cs != we)
cs = we, offs = strlen(s);
+ usemenu = um;
ispattern = haswhat = lastambig = 0;
patcomp = filecomp = NULL;
menucur = NULL;
***************
*** 2413,2418 ****
--- 2414,2420 ----
*delit = 1;
*s = '\0';
offs = 0;
+ if (isset(AUTOMENU)) usemenu = 1;
} else
*delit = 0;
*** Doc/Zsh/compctl.yo.old Mon Jun 22 08:36:59 1998
--- Doc/Zsh/compctl.yo Mon Jun 22 08:42:43 1998
***************
*** 353,359 ****
tt(-K) option) which can examine the word components passed to it
(or via the tt(read) builtin's tt(-c) and tt(-l) flags) and
use its own criteria to decide what matches. If there is no
! completion, the original word is retained.
)
item(tt(-y) var(func-or-var))(
The list provided by var(func-or-var) is displayed instead of the list
--- 353,362 ----
tt(-K) option) which can examine the word components passed to it
(or via the tt(read) builtin's tt(-c) and tt(-l) flags) and
use its own criteria to decide what matches. If there is no
! completion, the original word is retained. Since the produced
! possible completions seldom seldom have interesting common prefixes
! and suffixes, menucompletion is started immediatly if tt(AUTO_MENU) is
! set and this flag is used.
)
item(tt(-y) var(func-or-var))(
The list provided by var(func-or-var) is displayed instead of the list
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author