zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: "Zsh Hackers' List" <zsh-workers@sunsite.dk>
Subject: Re: Regression in braces completion
Date: Sun, 12 Oct 2008 15:47:19 -0700	[thread overview]
Message-ID: <081012154721.ZM22722@torch.brasslantern.com> (raw)
In-Reply-To: <20081012204236.6669a668@pws-pc>

On Oct 12,  8:42pm, Peter Stephenson wrote:
}
} There will be an underlying reason why this particular case inserts the
} brace in the wrong place.  It will take many hours of work to find out.

It's not really "this particular case".  The brace ends up in the
wrong place in the following examples too:

schaefer<508> ls abc{g,d<TAB>
schaefer<508> ls abcdef{g,

schaefer<516> cd ..
schaefer<517> ls dta/abc{d<TAB>
schaefer<517> ls dta/abcdef{

Seems to happen any time there's a longer unambiguous prefix possible.

In order to find the possible completions of the rightmost expansion
of the brace expression, the C code removes everything between the
brace and the comma, inclusive, and then asks the completer (which
happens to be _path_files) for the matches.  It's not expecting the
completer to modify the command line as a side-effect, but that's
what happens when "compadd -U" is called.

Is there a reason you think it's deeper than that?

This one is interesting, though:

schaefer<518> ls dat/abc{d<TAB>
schaefer<518> ls dta/abc{def/
Completing corrections
abcdef/   abcdefg/
Completing original
dat/abcd

Note that it's wrong about what the "original" string is, and sort of
wrong about what the corrections are, because really the correction is
"dat" --> "dta" ... but in this case the brace is in the right place,
and menu completion cycles through:

schaefer<518> ls dta/abc{def/
schaefer<518> ls dta/abc{defg/
schaefer<518> ls dat/abc{d

Looking at _complete_debug output, this seems in part to be because
with the misspelt "dat" in front, "dta/abcghi" remains a candidate
match until later in the process.

It helps, when testing this stuff, to remove _expand and _oldlist
from the completer style.

-- 


  reply	other threads:[~2008-10-12 22:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-12  2:32 Vin Shelton
2008-10-12  4:32 ` Bart Schaefer
2008-10-12  7:10   ` Bart Schaefer
2008-10-12 19:42     ` Peter Stephenson
2008-10-12 22:47       ` Bart Schaefer [this message]
2008-10-13  9:04         ` Peter Stephenson
2008-10-13 15:43           ` Bart Schaefer
2008-10-13 16:27             ` Peter Stephenson
2008-10-13 16:56               ` Bart Schaefer
2008-10-14  4:37               ` PATCH (?) " Bart Schaefer
2008-10-14  8:45                 ` Peter Stephenson
2008-10-15  1:34                   ` Vin Shelton

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=081012154721.ZM22722@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.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).