zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk
Subject: Re: globcomplete desctroys file completion
Date: Sat, 21 Feb 2009 16:57:45 -0800	[thread overview]
Message-ID: <090221165745.ZM13030@torch.brasslantern.com> (raw)
In-Reply-To: <090221111624.ZM12907@torch.brasslantern.com>

On Feb 21, 11:16am, Bart Schaefer wrote:
}
} Interesting.  Comparing the traces I find that at _path_files:238 with
} globcomplete, menu=yes is being set, and at _path_files:623 the value
} of $compstate[pattern_match] is "*" so the code branches to line 667
} instead of 629.  This sends us around the (for i in "$tmp1[@]"; do)
} loop at line 673 a bunch of times, each time adding either "texlive"
} or "texlive2008" as a completion with a different path tail as a hidden
} suffix.

Fooling with this a bit more ... that loop looks like:

            for i in "$tmp1[@]"; do
	      tmpdisp=("${i%%/*}")
	      _list_files tmpdisp "$prepath$realpath$testpath"
	      compadd "$tmp4[@]" -s "/${i#*/}" $listopts - "$tmpdisp"
	    done

If I change line 674 to this:

              tmpdisp=($i)

then I get the same results with globcomplete set as without:

torch% setopt globcomplete 
torch% print Tmp/texlive/t
                        ^
                        cursor on this final slash

However, I suspect using $i there is only working in this specific
example and not in the general case.  The resulting compadd looks
like (line break added for readability):

    compadd -Qf -J -default- -J -default- -p Tmp/ -s '' -W Tmp/ \
     -M 'r:|/=* r:|=*' -s /temp - texlive/temp

(and similarly for all the other files in texlive and texlive2008).
That looks wrong to me in any case because the description of -W
indicates that it's used "together with" -p ... but also note that
we have two -s options, so something is rotten in tmp4 at line 668,
is it not?

(However, in the NO_globcomplete case, the compadd still has identical
arguments to the -p and -W options, so maybe that's a red herring and/or
the -W doc is imprecise.)


  reply	other threads:[~2009-02-22  0:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-21 14:18 Jörg Sommer
2009-02-21 19:16 ` Bart Schaefer
2009-02-22  0:57   ` Bart Schaefer [this message]
2009-02-25 20:39     ` Peter Stephenson
2009-02-25 20:48       ` Peter Stephenson
2009-02-26  0:24         ` Jörg Sommer
2009-02-26  1:30         ` Bart Schaefer
2009-02-26  4:12           ` Bart Schaefer
2009-02-26 10:49             ` Peter Stephenson
2009-02-22 20:36   ` Jörg Sommer
2009-02-23  2:25     ` Bart Schaefer

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=090221165745.ZM13030@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).