From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23139 invoked from network); 17 Apr 2022 18:37:02 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 17 Apr 2022 18:37:02 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1650220622; b=BlahP80Cr2ALljXIUXFlTQRJ/V02VajwMFjONuCfhNF6p1S2u856cxvQ4mfY5eEDIaO0nW9gV6 Hdokp01mvvNu/T9CGNkz5/w8B0gh4Vgf9tqY37IO5vy2fK7muJXFRJ/jCnBmJZUzGyZYSTcnNe a+yWZvuTEFy5hBxjvQZS5jVkV/19jafcy4ygXEQyatJ0il77UdzI/HsJopeBY6vjV8dJryuO5L hRFtJFXqhusvmF3+jOhA+9S6zuv4btY9dUkio3ifQxYXACmsnYg8JKCt1TvYT01sI8WKh+vQRn ufsu6cXEjBAirO5VtBCoMEA47prCaP5po6KyJNHVYo4hZg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (pepin.polanet.pl) smtp.remote-ip=193.34.52.2; dmarc=none header.from=polanet.pl; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1650220622; bh=+NtvoK67JMR//LMsmzv93y+/sqM+NwfoSYb3fGN48lo=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:DKIM-Signature; b=Vb2t7GCBg0elUnNS92dLq+2ANW3EgBkZ8ZoOEM1J4B0MewOLT7SEi3Y2qltdvOseCCwY7EGnRd 3hdH6Vcmz09jTUK9F6pl2WK2FDgVJEqOCnyxX2dhkDfxuXyiEdwcT/TOp2obc4RRG941OvznIb b8JNN8F723pd9CkzGs/rEv0g+7kKibGgL+UuDuvgqzwfI5VT97LrAL3/dMIEhdQbHp2BdZh7/v B1HvX3S8Bm2OsxDBAPc+HtQ/Tv62Hp9ySxMnckUq2yUCfWPkSbkObEsJnGDb/G7tQ0L0aQf9TO ezYJHauHuOPZ4cI4oIjthkjK8h4Szy3700cURhZ2sBIjbQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=5y+RkreuI7IGLDiFtebWv55CHhppUGRSPYCh3ScldII=; b=olo9Dm5Hfvu/b16zbJSmOHLGxm yRWfRFobTACFDFJbWEltFVffMMCoVKYKb1RxF/y6bJXLTtElR9kr6yIb6TaPl+3rgIqfCrFq+nCp+ pYR3ClUKMLpwj9bCSUL0xjCKJnFU+EG4heItW3eXYPsuhQpG3I+HJxC0aa1kaYXfb46srj19cUUH+ e8gen15m1aNagfo9z0P9lnPpL5Jk/8hCBwy1cufdz2qTrn1vvmfoK0rzsMtS2JDXFwJ5BCfP2xswu BWUcsCnsg2Gv2EXwdH3Pq7g/MvQ5ci6zVOvKBrUcT3nGBMPVIoTO1x1ZLKZd3wo5EXffumKkKCGbt wFZQ+iuw==; Received: from authenticated user by zero.zsh.org with local id 1ng9ld-000J5I-Uv; Sun, 17 Apr 2022 18:37:01 +0000 Authentication-Results: zsh.org; iprev=pass (pepin.polanet.pl) smtp.remote-ip=193.34.52.2; dmarc=none header.from=polanet.pl; arc=none Received: from pepin.polanet.pl ([193.34.52.2]:40313) by zero.zsh.org with esmtps (TLS1:DHE-RSA-AES256-SHA:256) id 1ng7uq-000Bg5-Fj; Sun, 17 Apr 2022 16:38:25 +0000 Date: Sun, 17 Apr 2022 18:17:27 +0200 From: Tomasz Pala To: Bart Schaefer Cc: Zsh Users Subject: Re: cd /u/N/v/ tab expansion Message-ID: <20220417161727.GA31153@polanet.pl> References: <860877fd-ec69-0323-3f2a-8a40e96e6aee@rayninfo.co.uk> <2b388cce-1412-36cd-9a90-d58f853ee830@rayninfo.co.uk> <20220410010441.GA24829@polanet.pl> <20220410143222.GA21848@polanet.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Validation-by: larryv@zsh.org X-Seq: 27663 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Sat, Apr 16, 2022 at 20:00:18 -0700, Bart Schaefer wrote: >> > $ cd /e/s/s/[tab] >> > No matches for: `directory' >> >> This happens with: setopt glob_complete interfering with >> >> zstyle ':completion:*' list-dirs-first true > > I am not able to reproduce this with zsh-5.8.1.2-test-9-g0ad3b11, at > least not with only: > > zstyle '*' format %d > zstyle ':completion:*' list-dirs-first true > zstyle ':completion:*:*:*:*' list-suffixes yes > setopt globcomplete I might look for the other options involved if that matters, to provide minimal config, however since you see the effect in scenario below I guess the above one is only some compound side-effect (as this is also fixed/masked by any of my 2 proposals, either "gs" or "-U"). >> $ mkdir -p a/{b1,b2}/d/{e1,e2}/g >> $ ls a/b/d/e/g[tab] >> No matches for: `files' or `directory' > > This I am able to reproduce with the settings above. > > However, if I invoke _next_tags at that point, I get: > > % ls a/b/d/e/g > directory > b1/d/e/g b2/d/e/g > > So the results have been correctly completed and added, they're just > not in the tag group where they appear on the first attempt. This is why "-U" alone also "fixes" my case as far as I understand (?). > The settings of list-dirs-first and list-suffixes have no effect on > the tag to which the matches are added in this case. It's all down to > globcomplete. _next_tags works here, too. > > When globcomplete is set, the following differences occur: > _path_files line 251 forces menu=yes > _path_files line 737 sets SUFFIX=*/d/e/g* > _path_files returns false to _files line 119, so ret=0 is not done at line 120 > _files line 109 invokes _tags which calls comptags -N > _files returns false to _arguments, so ret=0 is not done at line 465 > _arguments line 467 sets alwopt=yes > _arguments line 538 test is true, so 543-551 run compadd > _arguments line 586 is false, returns false to _dispatch, no ret=0 at line 63 > _dispatch returns false to _complete, no ret=0 at line 117 > _complete returns false _main_complete This is far beyond my skills on completion flow tracking... > As you mention in a later message on this this thread, one problem is > at _path_files line 737, that suffix will never match given that the > /e/ path segment is ambiguous. Using :gs as you suggested resolves > everything after that, but introduces a new difference at > _main_compete:411, where compstate[pattern_match]='*' and > unambiguous_cursor=8 (instead of 4 in the noglobcomplete case). That > seems to go along with having forced menu completion on, but it seems > odd. During some tests I did saw a 'weird' jumping of cursor from 'b' position forward after a tab, just like the single disambiguation took over and chosen both (AFAIR), but I didn't record the scenario. > Regarding: >> - compadd "$tmp4[@]" $listopts - "$i" >> + compadd "$tmp4[@]" -U $listopts - "$i" > > Try ${Uopt} instead of -U there, and see if that makes any difference? I've already tried this without success. > I don't seem to be able to re-create the setup for your "ctrl-g > toggling of behaviour" incident. Can you specify? Sure, minimal config that exposes this "state-leaking": setopt glob_complete autoload -U compinit compinit zstyle ':completion:*' completer _complete _prefix zstyle ':completion:*' add-space true zstyle ':completion:*' menu select=long-list select=1 zstyle ':completion:*:*:*:*' list-suffixes yes with _no_ "-U" added in _path_files (i.e. "-U" apparently fixes this one). Note the 'add-space' style is optional, but enabled makes the problem more viable ("toggleable"). With list-dirs-first working properly for "middle part ambiguosity" I might simply disable the list-suffixes, however this is suspicious itself to toggle results between consecutive completions. best regards, -- Tomasz Pala