From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6363 invoked from network); 29 Jun 1999 07:02:11 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 29 Jun 1999 07:02:11 -0000 Received: (qmail 22369 invoked by alias); 29 Jun 1999 07:01:36 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6903 Received: (qmail 22362 invoked from network); 29 Jun 1999 07:01:35 -0000 Date: Tue, 29 Jun 1999 09:01:34 +0200 (MET DST) Message-Id: <199906290701.JAA20538@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk Subject: PATCH: compstate[insert] We were talking about this lately and I had already prepared it... With this you can get insertion as for normal completion (i.e. with the space appended) when using compstate[insert]='1 ': it's the trailing space that triggers it. There are probably better solutions, but at least I don't want to have another compstate-key just for this. Bye Sven diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c --- os/Zle/zle_tricky.c Mon Jun 28 16:18:37 1999 +++ Src/Zle/zle_tricky.c Mon Jun 28 22:55:07 1999 @@ -98,7 +98,7 @@ /* The match and group number to insert when starting menucompletion. */ -static int insmnum, insgnum, insgroup; +static int insmnum, insgnum, insgroup, insspace; /* This is used to decide when the cursor should be moved to the end of * * the inserted word: 0 - never, 1 - only when a single match is inserted, * @@ -4701,6 +4701,7 @@ insgroup = 1; insgnum = atoi(m + 1); } + insspace = (compinsert[strlen(compinsert) - 1] == ' '); } else useline = usemenu = 0; useexact = (compexact && !strcmp(compexact, "accept")); @@ -7653,7 +7654,7 @@ inststrlen(&(m->autoq), 1, 1); minfo.insc++; } - if (!menucmp && usemenu != 3) { + if (!menucmp && (usemenu != 3 || insspace)) { inststrlen(" ", 1, 1); minfo.insc++; if (minfo.we) diff -u od/Zsh/compwid.yo Doc/Zsh/compwid.yo --- od/Zsh/compwid.yo Mon Jun 28 22:54:54 1999 +++ Doc/Zsh/compwid.yo Mon Jun 28 23:06:39 1999 @@ -238,7 +238,9 @@ Negative numbers count backward from the last match or group (with `tt(-1)' selecting the last match or group) and out-of-range values are wrapped around, so that a value of zero selects the last match or group and a value -one more than the maximum selects the first. +one more than the maximum selects the first. Unless the value of this +key ends in a space, the match is inserted as in a menu-completion, +i.e. without automatically appending a space. ) item(tt(to_end))( Specifies the occasions on which the cursor is moved to the end of a string -- Sven Wischnowsky wischnow@informatik.hu-berlin.de