zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@math.gatech.edu
Subject: Re: Completion behavior change in 3.0-pre3
Date: Wed, 17 Jul 1996 14:52:38 -0700	[thread overview]
Message-ID: <9607171452.ZM9186@candle.brasslantern.com> (raw)
In-Reply-To: "Bart Schaefer" <schaefer> "Completion behavior change in 3.0-pre3" (Jul 15, 11:00pm)

On Jul 15, 11:00pm, Bart Schaefer wrote:
> Subject: Completion behavior change in 3.0-pre3
> Here's zsh 3.0-pre2:
> 
> zagzig[85] echo z*i<TAB>
> (feep)
> zagzig[85] echo z*i
> 
> Here's zsh 3.0-pre3:
> 
> zagzig<3> echo z*i<TAB>
> (feep)
> zagzig<3> echo z\*i

I've traced the point where the extra backslash gets inserted into
makecomplist(), right here:

    /* ... */
    lpre = zalloc(lpl + 1);
    memcpy(lpre, s, lpl);
    lpre[lpl] = '\0';
    p = quotename(lpre, NULL, NULL, NULL);
    if (strcmp(p, lpre) && !strpfx(p, qword)) {
	/* ... */
	inststrlen(p, 1, l2 = strlen(p));	/* This adds the backslash */
	/* ... */
    }
    /* ... */

In 3.0-pre2 and earlier, the backslash would get removed again as shown
by the following patch (which backs out two hunks of Zoltan's changes).
I'm not sure why Zoltan thought the line should only be restored when
going around the xorrec: loop.  Should cs et.al. get restored along with
the line when *not* going around the loop?  (They weren't in pre2, this
just puts back the pre2 behavior.)

*** Src/zle_tricky.c.0	Mon Jul 15 22:46:49 1996
--- Src/zle_tricky.c	Wed Jul 17 14:45:34 1996
***************
*** 2957,2962 ****
--- 2957,2964 ----
      validlist = 1;
      if(nmatches && !errflag)
  	return 0;
+     /* No matches: restore the command line. */
+     strcpy((char *)line, (char *)ol);
  
      if ((isf || cc->xor) && !parampre) {
  	/* We found no matches, but there is a xor'ed completion: *
***************
*** 2967,2973 ****
  	wb = owb;
  	we = owe;
  	cs = ocs;
- 	strcpy((char *)line, (char *)ol);
  	offs = oloffs;
  	s = dupstring(os);
  	free(amatches);
--- 2969,2974 ----



  parent reply	other threads:[~1996-07-17 21:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-07-14  0:34 Another patch to compctl-examples CVS compctl, and a bug? Bart Schaefer
1996-07-14  1:55 ` Bart Schaefer
     [not found]   ` <schaefer>
1996-07-14  2:00     ` Bart Schaefer
1996-07-17 21:52     ` Bart Schaefer [this message]
1996-07-19 19:53     ` Bart Schaefer
1996-07-22  7:34       ` Peter Stephenson
1996-07-22  6:53     ` Bug in case stmt with '(' Bart Schaefer
1996-07-15  1:02 ` Another patch to compctl-examples CVS compctl, and a bug? Zoltan Hidvegi
1996-07-15  2:32   ` Bart Schaefer
1996-07-15  4:30     ` Zoltan Hidvegi
1996-07-15  7:03   ` Bart Schaefer
1996-07-15 17:02     ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
1996-07-16  6:00 Completion behavior change in 3.0-pre3 Bart Schaefer
1996-07-17  9:52 ` Christoph von Stuckrad
1996-07-17 15:29   ` Bart Schaefer
     [not found] <199607191600.SAA08613@bolyai.cs.elte.hu>
     [not found] ` <9607211853.ZM979@morgan.com>

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=9607171452.ZM9186@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=schaefer@nbn.com \
    --cc=zsh-workers@math.gatech.edu \
    /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).