zsh-users
 help / color / mirror / code / Atom feed
* Completion for cd
@ 2017-03-14 17:38 Jesper Nygårds
  2017-03-14 19:07 ` Bart Schaefer
  0 siblings, 1 reply; 27+ messages in thread
From: Jesper Nygårds @ 2017-03-14 17:38 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 2333 bytes --]

I am using zsh 5.3.1. For a long time I've had the following completion
configuration:

zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]}' '+l:|=*'
zstyle ':completion::*:::' completer _expand _complete _prefix _approximate
_ignored
cdpath=(. /opt)

The idea is of course that if something I write is the start of a
completion, I want it to be completed. If such match is _not_ found, I want
completion to the left (prefix completion?) to be attempted. It works well.
If I stand in a directory 'statistics' containing the directories
'stats-lib' and 'stats-web', I can write 'cd web<tab>' and have it
completed to 'stats-web'. That is what I want.

However, I have a slight problem with it. In my '/opt' directory, I have a
directory called 'webcert'. If I stand in the 'statistics' directory,
writing 'cd web<tab>' gives me 'webcert', since '/opt' is in the cdpath
array. This is as expected since I have configured matcher-list to prefer
what is a prefix to what is a suffix, so 'webcert' (in the cdpath) is
found, and therefore 'stats-web' (in the current directory) is never
offered.

I would like to keep the matcher-list configuration, but for the cmpletion
to prefer matches in the current directory over matches in cdpath. I
therefore added the following configuration:

zstyle ':completion:*:*:cd:*:*' completer _expand _complete
_complete:withpath _prefix _approximate _ignored
zstyle ':completion:*:complete:cd:*:*' tag-order local-directories -
zstyle ':completion:*:withpath:cd:*:*' tag-order path-directories

This works as intended: now 'stats-web' in the current directory is
preferred over 'webcert' in cdpath, so typing 'cd web<tab>' completes to
'stats-web'. If I want to go to 'webcert', I can type 'cd webc<tab>' and it
will complete to 'webcert'.

However, now I find a surprising side-effect of this change. I have also
this configuration:

zstyle ':completion:*:*:cd:*:*' ignore-parents parent pwd

But this is broken by my change! If I go to directory 'zsh' in
'/usr/local/Cellar', and then type 'cd ../z<tab>', I am offered 'zsh'
together with 'zsh-completion', whereas before the change, I would only be
offered 'zsh-completion', since I have configured cd to ignore the current
directory.

I can't figure out why my configuration change has caused the
'ignore-parents' style to stop working.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2017-03-14 17:38 Completion for cd Jesper Nygårds
@ 2017-03-14 19:07 ` Bart Schaefer
  2017-03-14 21:50   ` Jesper Nygårds
  0 siblings, 1 reply; 27+ messages in thread
From: Bart Schaefer @ 2017-03-14 19:07 UTC (permalink / raw)
  To: Zsh Users

On Mar 14,  6:38pm, Jesper Nygards wrote:
}
} I can't figure out why my configuration change has caused the
} 'ignore-parents' style to stop working.

I tried trivially to reproduce this in the current master from git,
by copy-pasting your example configuration (with suitable adjustment
to cdpath); ignore-parents seemed to be working for me.

The _complete_debug facility is provided to help with tracking down
this sort of thing.  A typical process I would follow is:

1. Restore the original configuration where ignore-parents works
   and start a new shell.

2. Do a sample completion where ignore-parents should be applied,
   but instead of using TAB to complete, use ctrl-x question-mark
   which invokes _complete_debug.  Note the file name where it
   says it stored the trace output (you may have to up-history to
   see it).

3. Add your new tag-order configurations and start another new shell.

4. Repeat the same completion with _complete_debug and note the file
   name again (it should be similar to the last one, except with the
   PID of the new shell).

5. Invoke a side-by-side diff tool such as meld, or ediff (emacs),
   etc., and compare the two files.  This should give you some clues
   about where the completion is going wrong.

The most likely explanation is that the local-directories tag-order
is causing the completion with ignore-parents to find nothing, so
the default is to show the result without ignore-parents ... but
why that happens for you and not when I try to reproduce may be
the detail that comparing debug traces reveals.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2017-03-14 19:07 ` Bart Schaefer
@ 2017-03-14 21:50   ` Jesper Nygårds
  2017-03-15  3:56     ` Bart Schaefer
  0 siblings, 1 reply; 27+ messages in thread
From: Jesper Nygårds @ 2017-03-14 21:50 UTC (permalink / raw)
  To: Zsh Users


[-- Attachment #1.1: Type: text/plain, Size: 1723 bytes --]

Thank you for your help, Bart. I tried your suggestion, but I'm afraid I'm
a little overwhelmed by the amount of debug info.

Here is the complete ~/.zshrc that I use to test this:

# =========================================

autoload -U compinit

cdpath=(. /tmp/opt)

compinit

zstyle ':completion:*' matcher-list 'm:{[:lower:]}={[:upper:]}' '+l:|=*'
zstyle ':completion::*:::' completer _expand _complete _prefix _approximate
_ignored

zstyle ':completion:*:*:cd:*:*' completer _expand _complete
_complete:withpath _prefix _approximate _ignored
zstyle ':completion:*:complete:cd:*:*' tag-order local-directories -
zstyle ':completion:*:withpath:cd:*:*' tag-order path-directories

zstyle ':completion:*:*:cd:*:*' ignore-parents parent pwd

mkdir -p /tmp/{zaa,zbb,zcc,stats,opt}
mkdir -p /tmp/stats/{stats-lib,stats-web}
mkdir -p /tmp/opt/webcert

# =========================================

I then go to '/tmp/zaa' and write 'cd ../z<tab>'. The result is that 'zaa',
'zbb' and 'zcc' are all offered as alternatives, although I want 'zaa' to
be filtered out.

If I remove the trailing hyphen on this line: 'zstyle
':completion:*:complete:cd:*:*' tag-order local-directories -', the
ignore-parents style works: only 'zbb' and 'zcc' are offered when doing 'cd
../z<tab>' from '/tmp/zaa'. But without the hyphen, the problem that I was
originally trying to solve is still there. I.e. if I go to '/tmp/stats' and
type 'cd web<tab>', I am offered 'webcert', although I want to be offered
'stats-web'.

I attach the debug logs from the two different versions, 'file-1.txt' is
the run _without_ hyphen, where 'zaa' is not offered. 'file-2.txt' is the
run _with_ hyphen, where 'zaa' is offered despite the ignore-parents style.

[-- Attachment #1.2: Type: text/html, Size: 2394 bytes --]

[-- Attachment #2: file-1.txt --]
[-- Type: text/plain, Size: 29962 bytes --]

+_complete_debug:20> : zsh 5.3.1
+_complete_debug:21> _main_complete
+_main_complete:11> local IFS=$' \t\n\C-@'
+_main_complete:25> eval $'local -A _comp_caller_options;\n             _comp_caller_options=(${(kv)options[@]});\n             setopt localoptions localtraps localpatterns ${_comp_options[@]};\n             local IFS=$\' \t\r\n\0\';\n             builtin enable -p \| \~ \( \? \* \[ \< \^ \# 2>/dev/null;\n             exec </dev/null;\n             trap - ZERR;\n             local -a reply;\n             local REPLY'
 +(eval):1> local -A _comp_caller_options
 +(eval):2> _comp_caller_options=( posixargzero off autolist on printexitvalue off kshzerosubscript off histreduceblanks off chaselinks off extendedglob on localloops off histnostore off automenu on globcomplete off unset on listpacked off promptsubst off shwordsplit off pathdirs off kshtypeset off listtypes on warncreateglobal off promptbang off dotglob off braceexpand on listbeep on correctall off privileged off numericglobsort off histverify off trackall on histsubstpattern off globstarshort off cbases off rcquotes off posixaliases off histfindnodups off bashautolist off sharehistory off overstrike off kshautoload off incappendhistory off appendcreate off promptcr on mailwarn off pushdignoredups off interactive on ignoreeof off globsubst off rematchpcre off monitor on histsavebycopy on histbeep on debugbeforecmd on magicequalsubst off rmstarsilent off posixjobs off hashcmds on posixtraps off extendedhistory off notify on kshoptionprint off histexpiredupsfirst off glob on posixcd off braceccl off badpattern on longlistjobs off banghist on dvorak off alwaystoend off hashall on globalexport on ksharrays off correct off autonamedirs off histexpand on typesetsilent off rmstarwait off histnofunctions off autoparamslash on trapsasync off sunkeyboardhack off promptsp on histsavenodups off autocd off allexport off posixidentifiers off cshjunkiehistory off autopushd off completeinword off completealiases off aliases off autocontinue off appendhistory on singlelinezle off hashlistall on ignoreclosebraces off recexact off localoptions on interactivecomments off errexit off cshjunkiequotes off markdirs off hashdirs on cdablevars off rcexpandparam on vi off printeightbit off multifuncdef on xtrace on login on cshjunkieloops off histappend on histignorespace off evallineno on shfileexpansion off rcs on functionargzero on errreturn off combiningchars off histignoredups off histfcntllock off beep on autoremoveslash on hup on globdots off autoparamkeys on shnullcmd off multibyte on zle on promptpercent on flowcontrol on continueonerror off incappendhistorytime off autoresume off globassign off caseglob on shortloops on bsdecho off cprecedences off log on transientrprompt off verbose off localpatterns on ignorebraces off pipefail off equals on menucomplete off cshnullglob off casematch on promptvars off histallowclobber off bareglobqual on shinstdin on restricted off pushdminus off nullglob on chasedots off mailwarning off listambiguous on cshnullcmd off bashrematch off octalzeroes off forcefloat off exec on multios on emacs off nomatch on pathscript off localtraps on stdin on onecmd off kshglob off clobber on posixbuiltins off alwayslastprompt on pushdtohome off histignorealldups off hashexecutablesonly off pushdsilent off shoptionletters off physical off sourcetrace off histlexwords off bgnice on globalrcs on posixstrings off checkjobs on shglob off singlecommand off listrowsfirst off ) 
 +(eval):3> setopt localoptions localtraps localpatterns bareglobqual extendedglob glob multibyte multifuncdef nullglob rcexpandparam unset NO_allexport NO_aliases NO_cshnullglob NO_cshjunkiequotes NO_errexit NO_globassign NO_globsubst NO_histsubstpattern NO_ignorebraces NO_ignoreclosebraces NO_kshglob NO_ksharrays NO_kshtypeset NO_markdirs NO_octalzeroes NO_posixbuiltins NO_shwordsplit NO_shglob NO_warncreateglobal
 +(eval):4> local IFS=$' \t\C-M\n\C-@'
 +(eval):5> enable -p '|' '~' '(' '?' '*' '[' '<' '^' '#'
 +(eval):7> trap - ZERR
 +(eval):8> local -a reply
 +(eval):9> local REPLY
+_main_complete:27> local func funcs ret=1 tmp _compskip format nm call match min max i num _completers _completer _completer_num curtag _comp_force_list _matchers _matcher _c_matcher _matcher_num _comp_tags _comp_mesg mesg str context state state_descr line opt_args val_args curcontext='' _last_nmatches=-1 _last_menu_style _def_menu_style _menu_style sel _tags_level=0 _saved_exact='' _saved_lastprompt=yes _saved_list=ambiguous _saved_insert=automenu-unambiguous _saved_colors='' _saved_colors_set=0 _ambiguous_color=''
+_main_complete:42> local _comp_priv_prefix
+_main_complete:43> unset _comp_priv_prefix
+_main_complete:46> local -a precommands
+_main_complete:48> typeset -U _lastdescr _comp_ignore _comp_colors
+_main_complete:52> [[ -z '' ]]
+_main_complete:52> curcontext=::: 
+_main_complete:54> zstyle -s :completion::::: insert-tab tmp
+_main_complete:54> tmp=yes 
+_main_complete:56> [[ yes = *pending(|[[:blank:]]*) || yes = *pending=(#b)([0-9]##)(|[[:blank:]]*) ]]
+_main_complete:64> [[ automenu-unambiguous = tab* ]]
+_main_complete:77> [[ '' = \* ]]
+_main_complete:87> [[ -z '' ]]
+_main_complete:88> [[ -o equals ]]
+_main_complete:88> compset -P 1 '='
+_main_complete:90> [[ ../z != */* ]]
+_main_complete:98> _setup default
 +_setup:3> local val nm=0
 +_setup:5> [[ 1 -eq 1 ]]
 +_setup:5> 2=default 
 +_setup:7> zstyle -a :completion:::::default list-colors val
 +_setup:21> [[ default = default ]]
 +_setup:22> unset ZLS_COLORS ZLS_COLOURS
 +_setup:27> zstyle -s :completion:::::default show-ambiguity val
 +_setup:32> zstyle -t :completion:::::default list-packed
 +_setup:34> [[ 2 -eq 1 ]]
 +_setup:37> compstate[list]=ambiguous 
 +_setup:40> zstyle -t :completion:::::default list-rows-first
 +_setup:42> [[ 2 -eq 1 ]]
 +_setup:45> compstate[list]=ambiguous 
 +_setup:48> zstyle -t :completion:::::default last-prompt
 +_setup:50> [[ 2 -eq 1 ]]
 +_setup:53> compstate[last_prompt]=yes 
 +_setup:56> zstyle -t :completion:::::default accept-exact
 +_setup:58> [[ 2 -eq 1 ]]
 +_setup:61> compstate[exact]='' 
 +_setup:64> [[ _last_nmatches -ge 0 ]]
 +_setup:67> zstyle -a :completion:::::default menu val
 +_setup:71> _last_nmatches=-1 
 +_setup:74> [[ '' != always ]]
 +_setup:75> zstyle -s :completion:::::default force-list val
+_main_complete:99> _def_menu_style=( '' ) 
+_main_complete:108> _last_menu_style=( ) 
+_main_complete:110> zstyle -s :completion:::::default list-prompt tmp
+_main_complete:114> zstyle -s :completion:::::default select-prompt tmp
+_main_complete:118> zstyle -s :completion:::::default select-scroll tmp
+_main_complete:125> ((  0  ))
+_main_complete:137> zstyle -a :completion::::: completer _completers
+_main_complete:143> _completer_num=1 
+_main_complete:146> integer SECONDS=0
+_main_complete:160> funcs=( ) 
+_main_complete:161> compprefuncs=( ) 
+_main_complete:166> tmp=_expand
+_main_complete:168> [[ -n '' ]]
+_main_complete:170> [[ _expand = *:-* ]]
+_main_complete:173> [[ _expand = *:* ]]
+_main_complete:177> _completer=expand 
+_main_complete:180> curcontext=:expand:: 
+_main_complete:181> zstyle -t :completion::expand::: show-completer
+_main_complete:184> zstyle -a :completion::expand::: matcher-list _matchers
+_main_complete:187> _matcher_num=1 
+_main_complete:188> _matcher='' 
+_main_complete:189> _c_matcher=m:{[:lower:]}={[:upper:]}
+_main_complete:190> [[ 'm:{[:lower:]}={[:upper:]}' == +* ]]
+_main_complete:193> _matcher='m:{[:lower:]}={[:upper:]}' 
+_main_complete:196> _comp_mesg='' 
+_main_complete:197> [[ -n '' ]]
+_main_complete:202> _expand
 +_expand:10> setopt localoptions nonomatch
 +_expand:12> [[ _matcher_num -gt 1 ]]
 +_expand:14> local exp word sort expr expl subd suf=' ' force opt asp tmp opre pre epre
 +_expand:15> local continue=0
 +_expand:17> ((  0  ))
 +_expand:22> [[ _main_complete = _prefix ]]
 +_expand:25> word=../z 
 +_expand:28> [[ ../z = *\$(|{[^}]#) || ../z = *\$[a-zA-Z0-9_]## ]]
 +_expand:36> zstyle -T :completion::expand::: suffix
 +_expand:37> [[ ../z = (\~*/*|*\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|*\${*}?) ]]
 +_expand:41> zstyle -s :completion::expand::: accept-exact tmp
 +_expand:42> [[ ! -o recexact ]]
 +_expand:44> [[ '' != (yes|true|on|1) ]]
 +_expand:45> [[ ../z = \~(|[-+]) || ../z = \~[-+][1-9]## ]]
 +_expand:47> [[ ../z = \~* || ../z = *\$[a-zA-Z0-9_]## ]]
 +_expand:50> [[ continue -eq 1 ]]
 +_expand:55> exp=( ../z ) 
 +_expand:61> [[ '' = *s* ]]
 +_expand:62> zstyle -T :completion::expand::: substitute
 +_expand:73> [[ ! off == on && 0 = 0 ]]
 +_expand:74> local otmp
 +_expand:76> tmp=../z 
 +_expand:77> [[ 4 != 0 ]]
 +_expand:78> otmp=../z 
 +_expand:79> tmp=../z 
 +_expand:77> [[ 4 != 4 ]]
 +_expand:81> eval 'exp=(' ../z ')'
  +(eval):1> exp=( ../z ) 
 +_expand:88> setopt aliases
 +_expand:89> eval $'exp=( ${${(e)exp//\\[ \t\n]/ }//(#b)([ \t\n])/\\$match[1]} )'
  +(eval):1> exp=( ../z ) 
 +_expand:92> setopt NO_aliases
 +_expand:99> [[ -z ../z ]]
 +_expand:101> subd=( ../z ) 
 +_expand:105> [[ '' = *g* ]]
 +_expand:105> zstyle -T :completion::expand::: glob
 +_expand:106> eval $'exp=( ${~exp//(#b)\\([ \t\"\\'\n])/$match[1]} ); exp=( ${(q)exp} )'
  +(eval):1> exp=( ../z ) 
  +(eval):2> exp=( ../z ) 
 +_expand:115> ((  1  ))
 +_expand:117> [[ 1 -eq 1 && ../z = ../z(|\(N\)) ]]
 +_expand:117> return 1
+_main_complete:206> ((  _matcher_num++  ))
+_main_complete:189> _c_matcher=+l:|=*
+_main_complete:190> [[ '+l:|=*' == +* ]]
+_main_complete:191> _matcher='m:{[:lower:]}={[:upper:]} l:|=*' 
+_main_complete:196> _comp_mesg='' 
+_main_complete:197> [[ -n '' ]]
+_main_complete:202> _expand
 +_expand:10> setopt localoptions nonomatch
 +_expand:12> [[ _matcher_num -gt 1 ]]
 +_expand:12> return 1
+_main_complete:206> ((  _matcher_num++  ))
+_main_complete:208> [[ -n '' ]]
+_main_complete:210> ((  _completer_num++  ))
+_main_complete:166> tmp=_complete
+_main_complete:168> [[ -n '' ]]
+_main_complete:170> [[ _complete = *:-* ]]
+_main_complete:173> [[ _complete = *:* ]]
+_main_complete:177> _completer=complete 
+_main_complete:180> curcontext=:complete:: 
+_main_complete:181> zstyle -t :completion::complete::: show-completer
+_main_complete:184> zstyle -a :completion::complete::: matcher-list _matchers
+_main_complete:187> _matcher_num=1 
+_main_complete:188> _matcher='' 
+_main_complete:189> _c_matcher=m:{[:lower:]}={[:upper:]}
+_main_complete:190> [[ 'm:{[:lower:]}={[:upper:]}' == +* ]]
+_main_complete:193> _matcher='m:{[:lower:]}={[:upper:]}' 
+_main_complete:196> _comp_mesg='' 
+_main_complete:197> [[ -n '' ]]
+_main_complete:202> _complete
 +_complete:7> local comp name oldcontext ret=1 service
 +_complete:8> typeset -T curcontext=:complete:: ccarray
 +_complete:10> oldcontext=:complete:: 
 +_complete:14> [[ -n '' ]]
 +_complete:96> comp=_first 
 +_complete:97> [[ -n _first ]]
 +_complete:98> service=-first- 
 +_complete:99> ccarray[3]=-first- 
 +_complete:100> eval _first
  +(eval):1> _first
 +_complete:100> ret=0 
 +_complete:101> [[ '' = all ]]
 +_complete:110> [[ -n '' ]]
 +_complete:114> ret=1 
 +_complete:115> [[ command = command ]]
 +_complete:116> curcontext=:complete:: 
 +_complete:117> _normal -s
  +_normal:3> local _comp_command1 _comp_command2 _comp_command skip
  +_normal:5> [[ -s = -s ]]
  +_normal:6> skip=( -s ) 
  +_normal:16> [[ -o BANG_HIST && ../z = !*: || ../z = "!*: ]]
  +_normal:29> [[ CURRENT -eq 1 ]]
  +_normal:38> _set_command
   +_set_command:6> local command
   +_set_command:8> command=cd 
   +_set_command:10> [[ -z cd ]]
   +_set_command:12> ((  1 + 0  ))
   +_set_command:13> _comp_command1=cd 
   +_set_command:14> _comp_command=cd 
  +_normal:40> _dispatch -s cd cd '' -default-
   +_dispatch:3> local comp pat val name i ret=1 _compskip=''
   +_dispatch:4> local curcontext=:complete:: service str noskip
   +_dispatch:5> local -a match mbegin mend
   +_dispatch:9> [[ -s = -s ]]
   +_dispatch:10> noskip=yes 
   +_dispatch:11> shift
   +_dispatch:14> [[ -z yes ]]
   +_dispatch:16> curcontext=:complete:cd: 
   +_dispatch:18> shift
   +_dispatch:22> [[ '' != (all|*patterns*) ]]
   +_dispatch:24> str=cd
   +_dispatch:25> [[ -n cd ]]
   +_dispatch:26> service=cd 
   +_dispatch:24> str=
   +_dispatch:25> [[ -n '' ]]
   +_dispatch:25> continue
   +_dispatch:24> str=-default-
   +_dispatch:25> [[ -n -default- ]]
   +_dispatch:26> service=-default- 
   +_dispatch:45> ret=1 
   +_dispatch:46> str=cd
   +_dispatch:47> [[ -n cd ]]
   +_dispatch:51> str=cd 
   +_dispatch:52> name=cd 
   +_dispatch:53> comp=_cd 
   +_dispatch:54> service=cd 
   +_dispatch:56> [[ -z _cd ]]
   +_dispatch:56> break
   +_dispatch:61> [[ -n _cd && cd != -default- ]]
   +_dispatch:62> _compskip=patterns 
   +_dispatch:63> eval _cd
    +(eval):1> _cd
     +_cd:22> setopt localoptions nonomatch
     +_cd:24> local expl ret=1 curarg
     +_cd:25> integer argstart=2 noopts
     +_cd:27> ((  CURRENT > 1  ))
     +_cd:30> [[ ../z = -* ]]
     +_cd:38> [[ CURRENT -eq 3 ]]
     +_cd:49> [[ ../z == (#b)(\~|)[^/]# ]]
     +_cd:54> local -a tmpWpath
     +_cd:55> [[ ../z = (|*/)../* ]]
     +_cd:56> local tmpprefix
     +_cd:58> tmpprefix=     +_cd:58> cd ..
     +_cd:58> print /tmp
     +_cd:58> tmpprefix=/tmp 
     +_cd:59> [[ -n /tmp ]]
     +_cd:60> tmpWpath=( -W /tmp ) 
     +_cd:61> IPREFIX=../ 
     +_cd:62> PREFIX=z 
     +_cd:66> [[ z != (\~|/|./|../)* && ../ != ../* ]]
     +_cd:114> [[ CURRENT -ne 1 ]]
     +_cd:114> _wanted directories expl directory _path_files -W /tmp -/
      +_wanted:3> local -a __targs __gopt
      +_wanted:5> zparseopts -D -a __gopt 1 2 V J x 'C:=__targs'
      +_wanted:7> _tags directories
       +_tags:3> local prev
       +_tags:10> [[ directories = -- ]]
       +_tags:15> ((  1  ))
       +_tags:19> local curcontext=:complete:cd: order tag nodef tmp
       +_tags:21> [[ directories = -C?* ]]
       +_tags:24> [[ directories = -C ]]
       +_tags:29> [[ directories = -(|-) ]]
       +_tags:31> zstyle -a :completion::complete:cd:: group-order order
       +_tags:36> comptags -i :complete:cd: directories
       +_tags:40> [[ -n '' ]]
       +_tags:43> zstyle -a :completion::complete:cd:: tag-order order
       +_tags:47> tag=local-directories
       +_tags:48> case local-directories (-)
       +_tags:48> case local-directories (!*)
       +_tags:48> case local-directories (?*)
       +_tags:51> comptry -m local-directories
       +_tags:55> [[ -z '' ]]
       +_tags:55> comptry directories
       +_tags:60> comptags -T
       +_tags:62> return
      +_wanted:9> _tags
       +_tags:3> local prev
       +_tags:10> [[ '' = -- ]]
       +_tags:15> ((  0  ))
       +_tags:67> comptags -N
      +_wanted:10> _all_labels directories expl directory _path_files -W /tmp -/
       +_all_labels:3> local __gopt __len __tmp __pre __suf __ret=1 __descr __spec __prev
       +_all_labels:5> [[ directories = - ]]
       +_all_labels:10> __gopt=( ) 
       +_all_labels:11> zparseopts -D -a __gopt 1 2 V J x
       +_all_labels:13> __tmp=8 
       +_all_labels:14> __len=7 
       +_all_labels:15> [[ __tmp -lt __len ]]
       +_all_labels:18> [[ __tmp -eq 7 ]]
       +_all_labels:22> __pre=4 
       +_all_labels:23> __suf=5 
       +_all_labels:26> comptags -A directories curtag __spec
       +_all_labels:27> ((  9 > _tags_level  ))
       +_all_labels:27> _comp_tags='' 
       +_all_labels:28> _tags_level=9 
       +_all_labels:29> _comp_tags=' directories ' 
       +_all_labels:30> [[ directories = *[^\\]:* ]]
       +_all_labels:37> _description directories expl directory
        +_description:3> local name gropt nopt xopt format gname hidden hide match opts tag sort
        +_description:5> opts=( ) 
        +_description:7> gropt=( -J ) 
        +_description:8> xopt=( -X ) 
        +_description:9> nopt=( ) 
        +_description:10> zparseopts -K -D -a nopt 1 2 'V=gropt' 'J=gropt' 'x=xopt'
        +_description:12> 3=directory 
        +_description:13> [[ -n directory ]]
        +_description:13> _lastdescr=( '' directory ) 
        +_description:15> zstyle -s :completion::complete:cd::directories group-name gname
        +_description:18> _setup directories -default-
         +_setup:3> local val nm=0
         +_setup:5> [[ 2 -eq 1 ]]
         +_setup:7> zstyle -a :completion::complete:cd::directories list-colors val
         +_setup:21> [[ directories = default ]]
         +_setup:27> zstyle -s :completion::complete:cd::directories show-ambiguity val
         +_setup:32> zstyle -t :completion::complete:cd::directories list-packed
         +_setup:34> [[ 2 -eq 1 ]]
         +_setup:37> compstate[list]=ambiguous 
         +_setup:40> zstyle -t :completion::complete:cd::directories list-rows-first
         +_setup:42> [[ 2 -eq 1 ]]
         +_setup:45> compstate[list]=ambiguous 
         +_setup:48> zstyle -t :completion::complete:cd::directories last-prompt
         +_setup:50> [[ 2 -eq 1 ]]
         +_setup:53> compstate[last_prompt]=yes 
         +_setup:56> zstyle -t :completion::complete:cd::directories accept-exact
         +_setup:58> [[ 2 -eq 1 ]]
         +_setup:61> compstate[exact]='' 
         +_setup:64> [[ _last_nmatches -ge 0 ]]
         +_setup:67> zstyle -a :completion::complete:cd::directories menu val
         +_setup:71> _last_nmatches=-1 
         +_setup:74> [[ '' != always ]]
         +_setup:75> zstyle -s :completion::complete:cd::directories force-list val
        +_description:20> name=expl 
        +_description:22> zstyle -s :completion::complete:cd::directories format format
        +_description:23> zstyle -s :completion::complete:cd::descriptions format format
        +_description:25> zstyle -s :completion::complete:cd::directories hidden hidden
        +_description:30> zstyle -s :completion::complete:cd::directories matcher match
        +_description:32> [[ -n 'm:{[:lower:]}={[:upper:]}' ]]
        +_description:32> opts=( -M 'm:{[:lower:]}={[:upper:]}' ) 
        +_description:36> zstyle -s :completion::complete:cd::directories sort sort
        +_description:37> zstyle -s :completion::complete:cd:: sort sort
        +_description:46> [[ -z '' ]]
        +_description:47> zstyle -a :completion::complete:cd::directories ignored-patterns _comp_ignore
        +_description:48> _comp_ignore=( ) 
        +_description:50> zstyle -s :completion::complete:cd::directories ignore-line hidden
        +_description:66> ((  0  ))
        +_description:71> tag=directories 
        +_description:73> shift 2
        +_description:74> [[ -z directory ]]
        +_description:76> [[ -n '' ]]
        +_description:80> [[ -n '' ]]
        +_description:87> [[ -n '' ]]
        +_description:90> set -A expl -M 'm:{[:lower:]}={[:upper:]}' -J -default-
        +_description:94> ((  0  ))
        +_description:95> local fakestyle descr
        +_description:96> fakestyle=fake
        +_description:97> zstyle -a :completion::complete:cd::directories fake match
        +_description:98> continue
        +_description:96> fakestyle=fake-always
        +_description:97> zstyle -a :completion::complete:cd::directories fake-always match
        +_description:98> continue
        +_description:111> return 0
       +_all_labels:39> _path_files -M 'm:{[:lower:]}={[:upper:]}' -J -default- -W /tmp -/
        +_path_files:3> local -a match mbegin mend
        +_path_files:17> _have_glob_qual z
         +_have_glob_qual:14> local complete
         +_have_glob_qual:16> [[ '' = complete ]]
         +_have_glob_qual:18> [[ -z '' && on == on && z = (#b)(((*[^\\\$]|)(\\\\)#)\()([^\)\|\~]#) || on == on && z = (#b)(((*[^\\\$]|)(\\\\)#)\(\#q)([^\)]#) ]]
        +_path_files:39> local linepath realpath donepath prepath testpath exppath skips skipped
        +_path_files:40> local tmp1 tmp2 tmp3 tmp4 i orig eorig pre suf tpre tsuf opre osuf cpre
        +_path_files:41> local pats haspats ignore pfx pfxsfx sopt gopt opt sdirs ignpar cfopt listsfx
        +_path_files:42> local nm=0 menu matcher mopts sort mid accex fake
        +_path_files:43> local listfiles listopts tmpdisp origtmp1 Uopt
        +_path_files:44> local accept_exact_dirs path_completion
        +_path_files:45> integer npathcheck
        +_path_files:46> local -a Mopts
        +_path_files:48> typeset -U prepaths exppaths
        +_path_files:50> exppaths=( ) 
        +_path_files:54> zparseopts -a mopts 'P:=pfx' 'S:=pfxsfx' 'q=pfxsfx' 'r:=pfxsfx' 'R:=pfxsfx' 'W:=prepaths' 'F:=ignore' 'M+:=matcher' J+: V+: X+: 1 2 n 'f=tmp1' '/=tmp1' 'g+:-=tmp1'
        +_path_files:59> sopt=-/ 
        +_path_files:60> ((  1  ))
        +_path_files:60> haspats=yes 
        +_path_files:61> ((  0  ))
        +_path_files:62> ((  1  ))
        +_path_files:63> pats='' 
        +_path_files:64> pats=( '*(-/)' ) 
        +_path_files:69> pats=( '*(-/)' ) 
        +_path_files:71> ((  0  ))
        +_path_files:75> ((  2  ))
        +_path_files:76> tmp1=/tmp 
        +_path_files:77> [[ / = \( ]]
        +_path_files:79> [[ / = / ]]
        +_path_files:80> prepaths=( /tmp/ ) 
        +_path_files:85> ((  ! 1  ))
        +_path_files:90> ((  0  ))
        +_path_files:101> [[ -/ = -(f|) ]]
        +_path_files:110> ((  ! 1  ))
        +_path_files:131> [[ -z '' && 0 -eq 0 && -z '' && -n '' ]]
        +_path_files:135> ((  0  ))
        +_path_files:140> [[ 2 -eq 0 ]]
        +_path_files:146> ((  2  ))
        +_path_files:148> mopts=( -J -default- -M 'm:{[:lower:]}={[:upper:]}' ) 
        +_path_files:151> zstyle -s :completion::complete:cd:: file-sort tmp1
        +_path_files:186> zstyle -t :completion::complete:cd::paths squeeze-slashes
        +_path_files:189> skips='((.|..)/)##' 
        +_path_files:192> zstyle -s :completion::complete:cd::paths special-dirs sdirs
        +_path_files:193> zstyle -t :completion::complete:cd::paths list-suffixes
        +_path_files:196> [[ '*(-/)' = ((|*[[:blank:]])\*(|[[:blank:]]*|\([^[:blank:]]##\))|*\([^[:blank:]]#/[^[:blank:]]#\)*) ]]
        +_path_files:197> sopt=-// 
        +_path_files:199> zstyle -a :completion::complete:cd::paths accept-exact accex
        +_path_files:200> zstyle -a :completion::complete:cd:: fake-files fake
        +_path_files:202> zstyle -s :completion::complete:cd:: ignore-parents ignpar
        +_path_files:204> zstyle -t :completion::complete:cd::paths accept-exact-dirs
        +_path_files:206> zstyle -T :completion::complete:cd::paths path-completion
        +_path_files:207> path_completion=1 
        +_path_files:209> [[ -n '' ]]
        +_path_files:237> pre=z 
        +_path_files:238> suf='' 
        +_path_files:239> opre=z 
        +_path_files:240> osuf='' 
        +_path_files:241> orig=z 
        +_path_files:242> eorig=z 
        +_path_files:244> [[ automenu-unambiguous = (*menu|[0-9]*) || -n '' || -n '' ]]
        +_path_files:247> [[ -n '' ]]
        +_path_files:251> Mopts=( -M 'r:|/=* r:|=*' ) 
        +_path_files:256> [[ z = [^][*?#^\|\<\>\\]#(`[^`]#`|\$)*/* ]]
        +_path_files:277> [[ z = \~ ]]
        +_path_files:327> linepath='' 
        +_path_files:328> realpath='' 
        +_path_files:330> zstyle -s :completion::complete:cd:: preserve-prefix tmp1
        +_path_files:338> [[ z = / ]]
        +_path_files:351> [[ z = (.|..)/* ]]
        +_path_files:352> donepath='' 
        +_path_files:359> prepath=/tmp/
        +_path_files:365> skipped='' 
        +_path_files:366> cpre='' 
        +_path_files:368> [[ -n '' || -z 1 ]]
        +_path_files:407> tpre=z 
        +_path_files:408> tsuf='' 
        +_path_files:416> testpath='' 
        +_path_files:418> tmp2='' 
        +_path_files:419> tpre=z 
        +_path_files:421> tmp1=( /tmp/ ) 
        +_path_files:424> ((  npathcheck = 0  ))
        +_path_files:425> true
        +_path_files:427> origtmp1=( /tmp/ ) 
        +_path_files:430> [[ z = */* ]]
        +_path_files:434> PREFIX=z 
        +_path_files:435> SUFFIX='' 
        +_path_files:447> tmp2=( /tmp/ ) 
        +_path_files:449> [[ z = (#b)*/(*) ]]
        +_path_files:462> [[ -// = *[/f]* ]]
        +_path_files:463> compfiles -p tmp1 accex '' 'm:{[:lower:]}={[:upper:]} m:{[:lower:]}={[:upper:]}' '' fake '*(-/)'
        +_path_files:467> tmp1=( /tmp/com.apple.launchd.O1QCaefF6l /tmp/com.apple.launchd.Ya84Wdpn4w /tmp/com.apple.launchd.wWcKhD0JAo /tmp/cvcd /tmp/devio_semaphore_devio_0xb013 /tmp/opt /tmp/stats /tmp/zaa /tmp/zbb /tmp/zcc ) 
        +_path_files:469> [[ -n z ]]
        +_path_files:482> ((  ! 10 && npathcheck == 0  ))
        +_path_files:499> ((  ! 10  ))
        +_path_files:501> [[ /tmp/com.apple.launchd.O1QCaefF6l = */* ]]
        +_path_files:502> [[ -n '' ]]
        +_path_files:511> tmp2=( /tmp/com.apple.launchd.O1QCaefF6l /tmp/com.apple.launchd.Ya84Wdpn4w /tmp/com.apple.launchd.wWcKhD0JAo /tmp/cvcd /tmp/devio_semaphore_devio_0xb013 /tmp/opt /tmp/stats /tmp/zaa /tmp/zbb /tmp/zcc ) 
        +_path_files:512> compadd -D tmp1 -M 'm:{[:lower:]}={[:upper:]}' - com.apple.launchd.O1QCaefF6l com.apple.launchd.Ya84Wdpn4w com.apple.launchd.wWcKhD0JAo cvcd devio_semaphore_devio_0xb013 opt stats zaa zbb zcc
        +_path_files:522> ((  ! 3  ))
        +_path_files:570> [[ -n 'parent pwd' && -z '' && z != */* && 3 -ne 0 && 'parent pwd' != *dir* && 'parent pwd' != *..* ]]
        +_path_files:575> compfiles -i tmp1 ignore 'parent pwd' /tmp/
        +_path_files:576> _comp_ignore+=( zaa ) 
        +_path_files:578> ((  1 && ! 0  ))
        +_path_files:579> mopts=( -J -default- -M 'm:{[:lower:]}={[:upper:]}' -F _comp_ignore ) 
        +_path_files:584> [[ z = */* ]]
        +_path_files:586> [[ '' = */* ]]
        +_path_files:590> break
        +_path_files:609> tmp3=z 
        +_path_files:610> tpre=z 
        +_path_files:611> tsuf='' 
        +_path_files:612> [[ -n /tmp/ ]]
        +_path_files:614> [[ -o nocaseglob ]]
        +_path_files:618> tmp1=( zaa zbb zcc ) 
        +_path_files:622> true
        +_path_files:629> compfiles -r tmp1 z
        +_path_files:630> tmp4=1 
        +_path_files:632> [[ z = */* ]]
        +_path_files:637> tmp2=z 
        +_path_files:638> PREFIX=z 
        +_path_files:639> SUFFIX='' 
        +_path_files:646> ((  tmp4  ))
        +_path_files:655> tmp2='' 
        +_path_files:656> [[ -n '' ]]
        +_path_files:658> [[ -n '' ]]
        +_path_files:662> compquote tmp1 tmp2
        +_path_files:665> [[ -z '' && '' = \* ]]
        +_path_files:675> [[ -z automenu-unambiguous ]]
        +_path_files:676> zstyle -t :completion::complete:cd::paths expand suffix
        +_path_files:677> [[ -z '' && -n '' || -z '' ]]
        +_path_files:683> ((  tmp4  ))
        +_path_files:683> zstyle -t :completion::complete:cd::paths ambiguous
        +_path_files:685> [[ z = */* ]]
        +_path_files:711> _list_files tmp1 /tmp/
         +_list_files:11> local stat f elt what dir
         +_list_files:12> local -a stylevals
         +_list_files:13> integer ok
         +_list_files:15> listfiles=( ) 
         +_list_files:16> listopts=( ) 
         +_list_files:18> zstyle -a :completion::complete:cd:: file-list stylevals
         +_list_files:18> return 1
        +_path_files:712> compadd -Qf -J -default- -M 'm:{[:lower:]}={[:upper:]}' -F _comp_ignore -p '' -s '' -W /tmp/ -M 'r:|/=* r:|=*' -a tmp1
        +_path_files:749> tmp4=- 
        +_path_files:751> break
        +_path_files:795> [[ -z - ]]
        +_path_files:881> [[ _matcher_num -eq 2 ]]
        +_path_files:890> [[ nm -ne 'compstate[nmatches]' ]]
       +_all_labels:39> __ret=0 
       +_all_labels:26> comptags -A directories curtag __spec
       +_all_labels:43> return __ret
      +_wanted:10> return 0
     +_cd:115> ret=0 
     +_cd:117> return ret
   +_dispatch:63> ret=0 
   +_dispatch:64> [[ patterns = (all|*patterns*) ]]
   +_dispatch:64> return ret
 +_complete:117> ret=0 
 +_complete:142> _compskip='' 
 +_complete:144> return ret
+_main_complete:203> ret=0 
+_main_complete:204> break 2
+_main_complete:213> curcontext=::: 
+_main_complete:214> [[ '' = keep ]]
+_main_complete:220> nm=2 
+_main_complete:223> [[ '' = keep || nm -gt 1 ]]
+_main_complete:224> [[ _last_nmatches -ge 0 ]]
+_main_complete:227> tmp=3 
+_main_complete:229> _menu_style=( '' '' ) 
+_main_complete:231> [[ ambiguous = *list ]]
+_main_complete:235> [[ automenu-unambiguous = automenu-unambiguous ]]
+_main_complete:236> [[ -n automenu-unambiguous && -n '' ]]
+_main_complete:240> sel=( ) 
+_main_complete:242> ((  0  ))
+_main_complete:258> sel=( ) 
+_main_complete:260> ((  0  ))
+_main_complete:276> [[ -n '' || -n '' ]]
+_main_complete:280> [[ -n '' ]]
+_main_complete:282> [[ -n '' ]]
+_main_complete:289> [[ automenu-unambiguous = *menu* ]]
+_main_complete:290> [[ '' = 00 ]]
+_main_complete:291> [[ -n '' ]]
+_main_complete:293> [[ -n '' ]]
+_main_complete:299> [[ '' != 00 ]]
+_main_complete:300> sel=( ) 
+_main_complete:302> ((  0  ))
+_main_complete:321> unset MENUSELECT
+_main_complete:324> [[ -n '' ]]
+_main_complete:361> [[ -n '' ]]
+_main_complete:368> [[ '' = always || '' = ?* ]]
+_main_complete:374> [[ '' = keep ]]
+_main_complete:380> ((  0  ))
+_main_complete:383> unset ZLS_COLORS
+_main_complete:389> funcs=( ) 
+_main_complete:390> comppostfuncs=( ) 
+_main_complete:395> _lastcomp=( list_lines 1 all_quotes '\' nmatches 2 restore auto context command vared '' unambiguous ../z list_max 100 unambiguous_cursor 5 list ambiguous insert_positions 7 unambiguous_positions 4 exact '' to_end match last_prompt yes pattern_insert menu ignored 1 insert automenu-unambiguous ) 
+_main_complete:396> _lastcomp[nmatches]=2 
+_main_complete:397> _lastcomp[completer]=complete 
+_main_complete:398> _lastcomp[prefix]=../z 
+_main_complete:399> _lastcomp[suffix]='' 
+_main_complete:400> _lastcomp[iprefix]='' 
+_main_complete:401> _lastcomp[isuffix]='' 
+_main_complete:402> _lastcomp[qiprefix]='' 
+_main_complete:403> _lastcomp[qisuffix]='' 
+_main_complete:404> _lastcomp[tags]=' directories ' 
+_main_complete:406> return ret
+_complete_debug:22> integer ret=0
+_complete_debug:23> unsetopt xtrace

[-- Attachment #3: file-2.txt --]
[-- Type: text/plain, Size: 51788 bytes --]

+_complete_debug:20> : zsh 5.3.1
+_complete_debug:21> _main_complete
+_main_complete:11> local IFS=$' \t\n\C-@'
+_main_complete:25> eval $'local -A _comp_caller_options;\n             _comp_caller_options=(${(kv)options[@]});\n             setopt localoptions localtraps localpatterns ${_comp_options[@]};\n             local IFS=$\' \t\r\n\0\';\n             builtin enable -p \| \~ \( \? \* \[ \< \^ \# 2>/dev/null;\n             exec </dev/null;\n             trap - ZERR;\n             local -a reply;\n             local REPLY'
 +(eval):1> local -A _comp_caller_options
 +(eval):2> _comp_caller_options=( posixargzero off autolist on printexitvalue off kshzerosubscript off histreduceblanks off chaselinks off extendedglob on localloops off histnostore off automenu on globcomplete off unset on listpacked off promptsubst off shwordsplit off pathdirs off kshtypeset off listtypes on warncreateglobal off promptbang off dotglob off braceexpand on listbeep on correctall off privileged off numericglobsort off histverify off trackall on histsubstpattern off globstarshort off cbases off rcquotes off posixaliases off histfindnodups off bashautolist off sharehistory off overstrike off kshautoload off incappendhistory off appendcreate off promptcr on mailwarn off pushdignoredups off interactive on ignoreeof off globsubst off rematchpcre off monitor on histsavebycopy on histbeep on debugbeforecmd on magicequalsubst off rmstarsilent off posixjobs off hashcmds on posixtraps off extendedhistory off notify on kshoptionprint off histexpiredupsfirst off glob on posixcd off braceccl off badpattern on longlistjobs off banghist on dvorak off alwaystoend off hashall on globalexport on ksharrays off correct off autonamedirs off histexpand on typesetsilent off rmstarwait off histnofunctions off autoparamslash on trapsasync off sunkeyboardhack off promptsp on histsavenodups off autocd off allexport off posixidentifiers off cshjunkiehistory off autopushd off completeinword off completealiases off aliases off autocontinue off appendhistory on singlelinezle off hashlistall on ignoreclosebraces off recexact off localoptions on interactivecomments off errexit off cshjunkiequotes off markdirs off hashdirs on cdablevars off rcexpandparam on vi off printeightbit off multifuncdef on xtrace on login on cshjunkieloops off histappend on histignorespace off evallineno on shfileexpansion off rcs on functionargzero on errreturn off combiningchars off histignoredups off histfcntllock off beep on autoremoveslash on hup on globdots off autoparamkeys on shnullcmd off multibyte on zle on promptpercent on flowcontrol on continueonerror off incappendhistorytime off autoresume off globassign off caseglob on shortloops on bsdecho off cprecedences off log on transientrprompt off verbose off localpatterns on ignorebraces off pipefail off equals on menucomplete off cshnullglob off casematch on promptvars off histallowclobber off bareglobqual on shinstdin on restricted off pushdminus off nullglob on chasedots off mailwarning off listambiguous on cshnullcmd off bashrematch off octalzeroes off forcefloat off exec on multios on emacs off nomatch on pathscript off localtraps on stdin on onecmd off kshglob off clobber on posixbuiltins off alwayslastprompt on pushdtohome off histignorealldups off hashexecutablesonly off pushdsilent off shoptionletters off physical off sourcetrace off histlexwords off bgnice on globalrcs on posixstrings off checkjobs on shglob off singlecommand off listrowsfirst off ) 
 +(eval):3> setopt localoptions localtraps localpatterns bareglobqual extendedglob glob multibyte multifuncdef nullglob rcexpandparam unset NO_allexport NO_aliases NO_cshnullglob NO_cshjunkiequotes NO_errexit NO_globassign NO_globsubst NO_histsubstpattern NO_ignorebraces NO_ignoreclosebraces NO_kshglob NO_ksharrays NO_kshtypeset NO_markdirs NO_octalzeroes NO_posixbuiltins NO_shwordsplit NO_shglob NO_warncreateglobal
 +(eval):4> local IFS=$' \t\C-M\n\C-@'
 +(eval):5> enable -p '|' '~' '(' '?' '*' '[' '<' '^' '#'
 +(eval):7> trap - ZERR
 +(eval):8> local -a reply
 +(eval):9> local REPLY
+_main_complete:27> local func funcs ret=1 tmp _compskip format nm call match min max i num _completers _completer _completer_num curtag _comp_force_list _matchers _matcher _c_matcher _matcher_num _comp_tags _comp_mesg mesg str context state state_descr line opt_args val_args curcontext='' _last_nmatches=-1 _last_menu_style _def_menu_style _menu_style sel _tags_level=0 _saved_exact='' _saved_lastprompt=yes _saved_list=ambiguous _saved_insert=automenu-unambiguous _saved_colors='' _saved_colors_set=0 _ambiguous_color=''
+_main_complete:42> local _comp_priv_prefix
+_main_complete:43> unset _comp_priv_prefix
+_main_complete:46> local -a precommands
+_main_complete:48> typeset -U _lastdescr _comp_ignore _comp_colors
+_main_complete:52> [[ -z '' ]]
+_main_complete:52> curcontext=::: 
+_main_complete:54> zstyle -s :completion::::: insert-tab tmp
+_main_complete:54> tmp=yes 
+_main_complete:56> [[ yes = *pending(|[[:blank:]]*) || yes = *pending=(#b)([0-9]##)(|[[:blank:]]*) ]]
+_main_complete:64> [[ automenu-unambiguous = tab* ]]
+_main_complete:77> [[ '' = \* ]]
+_main_complete:87> [[ -z '' ]]
+_main_complete:88> [[ -o equals ]]
+_main_complete:88> compset -P 1 '='
+_main_complete:90> [[ ../z != */* ]]
+_main_complete:98> _setup default
 +_setup:3> local val nm=0
 +_setup:5> [[ 1 -eq 1 ]]
 +_setup:5> 2=default 
 +_setup:7> zstyle -a :completion:::::default list-colors val
 +_setup:21> [[ default = default ]]
 +_setup:22> unset ZLS_COLORS ZLS_COLOURS
 +_setup:27> zstyle -s :completion:::::default show-ambiguity val
 +_setup:32> zstyle -t :completion:::::default list-packed
 +_setup:34> [[ 2 -eq 1 ]]
 +_setup:37> compstate[list]=ambiguous 
 +_setup:40> zstyle -t :completion:::::default list-rows-first
 +_setup:42> [[ 2 -eq 1 ]]
 +_setup:45> compstate[list]=ambiguous 
 +_setup:48> zstyle -t :completion:::::default last-prompt
 +_setup:50> [[ 2 -eq 1 ]]
 +_setup:53> compstate[last_prompt]=yes 
 +_setup:56> zstyle -t :completion:::::default accept-exact
 +_setup:58> [[ 2 -eq 1 ]]
 +_setup:61> compstate[exact]='' 
 +_setup:64> [[ _last_nmatches -ge 0 ]]
 +_setup:67> zstyle -a :completion:::::default menu val
 +_setup:71> _last_nmatches=-1 
 +_setup:74> [[ '' != always ]]
 +_setup:75> zstyle -s :completion:::::default force-list val
+_main_complete:99> _def_menu_style=( '' ) 
+_main_complete:108> _last_menu_style=( ) 
+_main_complete:110> zstyle -s :completion:::::default list-prompt tmp
+_main_complete:114> zstyle -s :completion:::::default select-prompt tmp
+_main_complete:118> zstyle -s :completion:::::default select-scroll tmp
+_main_complete:125> ((  0  ))
+_main_complete:137> zstyle -a :completion::::: completer _completers
+_main_complete:143> _completer_num=1 
+_main_complete:146> integer SECONDS=0
+_main_complete:160> funcs=( ) 
+_main_complete:161> compprefuncs=( ) 
+_main_complete:166> tmp=_expand
+_main_complete:168> [[ -n '' ]]
+_main_complete:170> [[ _expand = *:-* ]]
+_main_complete:173> [[ _expand = *:* ]]
+_main_complete:177> _completer=expand 
+_main_complete:180> curcontext=:expand:: 
+_main_complete:181> zstyle -t :completion::expand::: show-completer
+_main_complete:184> zstyle -a :completion::expand::: matcher-list _matchers
+_main_complete:187> _matcher_num=1 
+_main_complete:188> _matcher='' 
+_main_complete:189> _c_matcher=m:{[:lower:]}={[:upper:]}
+_main_complete:190> [[ 'm:{[:lower:]}={[:upper:]}' == +* ]]
+_main_complete:193> _matcher='m:{[:lower:]}={[:upper:]}' 
+_main_complete:196> _comp_mesg='' 
+_main_complete:197> [[ -n '' ]]
+_main_complete:202> _expand
 +_expand:10> setopt localoptions nonomatch
 +_expand:12> [[ _matcher_num -gt 1 ]]
 +_expand:14> local exp word sort expr expl subd suf=' ' force opt asp tmp opre pre epre
 +_expand:15> local continue=0
 +_expand:17> ((  0  ))
 +_expand:22> [[ _main_complete = _prefix ]]
 +_expand:25> word=../z 
 +_expand:28> [[ ../z = *\$(|{[^}]#) || ../z = *\$[a-zA-Z0-9_]## ]]
 +_expand:36> zstyle -T :completion::expand::: suffix
 +_expand:37> [[ ../z = (\~*/*|*\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|*\${*}?) ]]
 +_expand:41> zstyle -s :completion::expand::: accept-exact tmp
 +_expand:42> [[ ! -o recexact ]]
 +_expand:44> [[ '' != (yes|true|on|1) ]]
 +_expand:45> [[ ../z = \~(|[-+]) || ../z = \~[-+][1-9]## ]]
 +_expand:47> [[ ../z = \~* || ../z = *\$[a-zA-Z0-9_]## ]]
 +_expand:50> [[ continue -eq 1 ]]
 +_expand:55> exp=( ../z ) 
 +_expand:61> [[ '' = *s* ]]
 +_expand:62> zstyle -T :completion::expand::: substitute
 +_expand:73> [[ ! off == on && 0 = 0 ]]
 +_expand:74> local otmp
 +_expand:76> tmp=../z 
 +_expand:77> [[ 4 != 0 ]]
 +_expand:78> otmp=../z 
 +_expand:79> tmp=../z 
 +_expand:77> [[ 4 != 4 ]]
 +_expand:81> eval 'exp=(' ../z ')'
  +(eval):1> exp=( ../z ) 
 +_expand:88> setopt aliases
 +_expand:89> eval $'exp=( ${${(e)exp//\\[ \t\n]/ }//(#b)([ \t\n])/\\$match[1]} )'
  +(eval):1> exp=( ../z ) 
 +_expand:92> setopt NO_aliases
 +_expand:99> [[ -z ../z ]]
 +_expand:101> subd=( ../z ) 
 +_expand:105> [[ '' = *g* ]]
 +_expand:105> zstyle -T :completion::expand::: glob
 +_expand:106> eval $'exp=( ${~exp//(#b)\\([ \t\"\\'\n])/$match[1]} ); exp=( ${(q)exp} )'
  +(eval):1> exp=( ../z ) 
  +(eval):2> exp=( ../z ) 
 +_expand:115> ((  1  ))
 +_expand:117> [[ 1 -eq 1 && ../z = ../z(|\(N\)) ]]
 +_expand:117> return 1
+_main_complete:206> ((  _matcher_num++  ))
+_main_complete:189> _c_matcher=+l:|=*
+_main_complete:190> [[ '+l:|=*' == +* ]]
+_main_complete:191> _matcher='m:{[:lower:]}={[:upper:]} l:|=*' 
+_main_complete:196> _comp_mesg='' 
+_main_complete:197> [[ -n '' ]]
+_main_complete:202> _expand
 +_expand:10> setopt localoptions nonomatch
 +_expand:12> [[ _matcher_num -gt 1 ]]
 +_expand:12> return 1
+_main_complete:206> ((  _matcher_num++  ))
+_main_complete:208> [[ -n '' ]]
+_main_complete:210> ((  _completer_num++  ))
+_main_complete:166> tmp=_complete
+_main_complete:168> [[ -n '' ]]
+_main_complete:170> [[ _complete = *:-* ]]
+_main_complete:173> [[ _complete = *:* ]]
+_main_complete:177> _completer=complete 
+_main_complete:180> curcontext=:complete:: 
+_main_complete:181> zstyle -t :completion::complete::: show-completer
+_main_complete:184> zstyle -a :completion::complete::: matcher-list _matchers
+_main_complete:187> _matcher_num=1 
+_main_complete:188> _matcher='' 
+_main_complete:189> _c_matcher=m:{[:lower:]}={[:upper:]}
+_main_complete:190> [[ 'm:{[:lower:]}={[:upper:]}' == +* ]]
+_main_complete:193> _matcher='m:{[:lower:]}={[:upper:]}' 
+_main_complete:196> _comp_mesg='' 
+_main_complete:197> [[ -n '' ]]
+_main_complete:202> _complete
 +_complete:7> local comp name oldcontext ret=1 service
 +_complete:8> typeset -T curcontext=:complete:: ccarray
 +_complete:10> oldcontext=:complete:: 
 +_complete:14> [[ -n '' ]]
 +_complete:96> comp=_first 
 +_complete:97> [[ -n _first ]]
 +_complete:98> service=-first- 
 +_complete:99> ccarray[3]=-first- 
 +_complete:100> eval _first
  +(eval):1> _first
 +_complete:100> ret=0 
 +_complete:101> [[ '' = all ]]
 +_complete:110> [[ -n '' ]]
 +_complete:114> ret=1 
 +_complete:115> [[ command = command ]]
 +_complete:116> curcontext=:complete:: 
 +_complete:117> _normal -s
  +_normal:3> local _comp_command1 _comp_command2 _comp_command skip
  +_normal:5> [[ -s = -s ]]
  +_normal:6> skip=( -s ) 
  +_normal:16> [[ -o BANG_HIST && ../z = !*: || ../z = "!*: ]]
  +_normal:29> [[ CURRENT -eq 1 ]]
  +_normal:38> _set_command
   +_set_command:6> local command
   +_set_command:8> command=cd 
   +_set_command:10> [[ -z cd ]]
   +_set_command:12> ((  1 + 0  ))
   +_set_command:13> _comp_command1=cd 
   +_set_command:14> _comp_command=cd 
  +_normal:40> _dispatch -s cd cd '' -default-
   +_dispatch:3> local comp pat val name i ret=1 _compskip=''
   +_dispatch:4> local curcontext=:complete:: service str noskip
   +_dispatch:5> local -a match mbegin mend
   +_dispatch:9> [[ -s = -s ]]
   +_dispatch:10> noskip=yes 
   +_dispatch:11> shift
   +_dispatch:14> [[ -z yes ]]
   +_dispatch:16> curcontext=:complete:cd: 
   +_dispatch:18> shift
   +_dispatch:22> [[ '' != (all|*patterns*) ]]
   +_dispatch:24> str=cd
   +_dispatch:25> [[ -n cd ]]
   +_dispatch:26> service=cd 
   +_dispatch:24> str=
   +_dispatch:25> [[ -n '' ]]
   +_dispatch:25> continue
   +_dispatch:24> str=-default-
   +_dispatch:25> [[ -n -default- ]]
   +_dispatch:26> service=-default- 
   +_dispatch:45> ret=1 
   +_dispatch:46> str=cd
   +_dispatch:47> [[ -n cd ]]
   +_dispatch:51> str=cd 
   +_dispatch:52> name=cd 
   +_dispatch:53> comp=_cd 
   +_dispatch:54> service=cd 
   +_dispatch:56> [[ -z _cd ]]
   +_dispatch:56> break
   +_dispatch:61> [[ -n _cd && cd != -default- ]]
   +_dispatch:62> _compskip=patterns 
   +_dispatch:63> eval _cd
    +(eval):1> _cd
     +_cd:22> setopt localoptions nonomatch
     +_cd:24> local expl ret=1 curarg
     +_cd:25> integer argstart=2 noopts
     +_cd:27> ((  CURRENT > 1  ))
     +_cd:30> [[ ../z = -* ]]
     +_cd:38> [[ CURRENT -eq 3 ]]
     +_cd:49> [[ ../z == (#b)(\~|)[^/]# ]]
     +_cd:54> local -a tmpWpath
     +_cd:55> [[ ../z = (|*/)../* ]]
     +_cd:56> local tmpprefix
     +_cd:58> tmpprefix=     +_cd:58> cd ..
     +_cd:58> print /tmp
     +_cd:58> tmpprefix=/tmp 
     +_cd:59> [[ -n /tmp ]]
     +_cd:60> tmpWpath=( -W /tmp ) 
     +_cd:61> IPREFIX=../ 
     +_cd:62> PREFIX=z 
     +_cd:66> [[ z != (\~|/|./|../)* && ../ != ../* ]]
     +_cd:114> [[ CURRENT -ne 1 ]]
     +_cd:114> _wanted directories expl directory _path_files -W /tmp -/
      +_wanted:3> local -a __targs __gopt
      +_wanted:5> zparseopts -D -a __gopt 1 2 V J x 'C:=__targs'
      +_wanted:7> _tags directories
       +_tags:3> local prev
       +_tags:10> [[ directories = -- ]]
       +_tags:15> ((  1  ))
       +_tags:19> local curcontext=:complete:cd: order tag nodef tmp
       +_tags:21> [[ directories = -C?* ]]
       +_tags:24> [[ directories = -C ]]
       +_tags:29> [[ directories = -(|-) ]]
       +_tags:31> zstyle -a :completion::complete:cd:: group-order order
       +_tags:36> comptags -i :complete:cd: directories
       +_tags:40> [[ -n '' ]]
       +_tags:43> zstyle -a :completion::complete:cd:: tag-order order
       +_tags:47> tag=local-directories
       +_tags:48> case local-directories (-)
       +_tags:48> case local-directories (!*)
       +_tags:48> case local-directories (?*)
       +_tags:51> comptry -m local-directories
       +_tags:47> tag=-
       +_tags:48> case - (-)
       +_tags:49> nodef=yes 
       +_tags:55> [[ -z yes ]]
       +_tags:60> comptags -T
       +_tags:62> return
      +_wanted:9> _tags
       +_tags:3> local prev
       +_tags:10> [[ '' = -- ]]
       +_tags:15> ((  0  ))
       +_tags:67> comptags -N
      +_wanted:13> return 1
     +_cd:117> return ret
   +_dispatch:64> [[ patterns = (all|*patterns*) ]]
   +_dispatch:64> return ret
 +_complete:142> _compskip='' 
 +_complete:144> return ret
+_main_complete:206> ((  _matcher_num++  ))
+_main_complete:189> _c_matcher=+l:|=*
+_main_complete:190> [[ '+l:|=*' == +* ]]
+_main_complete:191> _matcher='m:{[:lower:]}={[:upper:]} l:|=*' 
+_main_complete:196> _comp_mesg='' 
+_main_complete:197> [[ -n '' ]]
+_main_complete:202> _complete
 +_complete:7> local comp name oldcontext ret=1 service
 +_complete:8> typeset -T curcontext=:complete:: ccarray
 +_complete:10> oldcontext=:complete:: 
 +_complete:14> [[ -n '' ]]
 +_complete:96> comp=_first 
 +_complete:97> [[ -n _first ]]
 +_complete:98> service=-first- 
 +_complete:99> ccarray[3]=-first- 
 +_complete:100> eval _first
  +(eval):1> _first
 +_complete:100> ret=0 
 +_complete:101> [[ '' = all ]]
 +_complete:110> [[ -n '' ]]
 +_complete:114> ret=1 
 +_complete:115> [[ command = command ]]
 +_complete:116> curcontext=:complete:: 
 +_complete:117> _normal -s
  +_normal:3> local _comp_command1 _comp_command2 _comp_command skip
  +_normal:5> [[ -s = -s ]]
  +_normal:6> skip=( -s ) 
  +_normal:16> [[ -o BANG_HIST && ../z = !*: || ../z = "!*: ]]
  +_normal:29> [[ CURRENT -eq 1 ]]
  +_normal:38> _set_command
   +_set_command:6> local command
   +_set_command:8> command=cd 
   +_set_command:10> [[ -z cd ]]
   +_set_command:12> ((  1 + 0  ))
   +_set_command:13> _comp_command1=cd 
   +_set_command:14> _comp_command=cd 
  +_normal:40> _dispatch -s cd cd '' -default-
   +_dispatch:3> local comp pat val name i ret=1 _compskip=''
   +_dispatch:4> local curcontext=:complete:: service str noskip
   +_dispatch:5> local -a match mbegin mend
   +_dispatch:9> [[ -s = -s ]]
   +_dispatch:10> noskip=yes 
   +_dispatch:11> shift
   +_dispatch:14> [[ -z yes ]]
   +_dispatch:16> curcontext=:complete:cd: 
   +_dispatch:18> shift
   +_dispatch:22> [[ '' != (all|*patterns*) ]]
   +_dispatch:24> str=cd
   +_dispatch:25> [[ -n cd ]]
   +_dispatch:26> service=cd 
   +_dispatch:24> str=
   +_dispatch:25> [[ -n '' ]]
   +_dispatch:25> continue
   +_dispatch:24> str=-default-
   +_dispatch:25> [[ -n -default- ]]
   +_dispatch:26> service=-default- 
   +_dispatch:45> ret=1 
   +_dispatch:46> str=cd
   +_dispatch:47> [[ -n cd ]]
   +_dispatch:51> str=cd 
   +_dispatch:52> name=cd 
   +_dispatch:53> comp=_cd 
   +_dispatch:54> service=cd 
   +_dispatch:56> [[ -z _cd ]]
   +_dispatch:56> break
   +_dispatch:61> [[ -n _cd && cd != -default- ]]
   +_dispatch:62> _compskip=patterns 
   +_dispatch:63> eval _cd
    +(eval):1> _cd
     +_cd:22> setopt localoptions nonomatch
     +_cd:24> local expl ret=1 curarg
     +_cd:25> integer argstart=2 noopts
     +_cd:27> ((  CURRENT > 1  ))
     +_cd:30> [[ ../z = -* ]]
     +_cd:38> [[ CURRENT -eq 3 ]]
     +_cd:49> [[ ../z == (#b)(\~|)[^/]# ]]
     +_cd:54> local -a tmpWpath
     +_cd:55> [[ ../z = (|*/)../* ]]
     +_cd:56> local tmpprefix
     +_cd:58> tmpprefix=     +_cd:58> cd ..
     +_cd:58> print /tmp
     +_cd:58> tmpprefix=/tmp 
     +_cd:59> [[ -n /tmp ]]
     +_cd:60> tmpWpath=( -W /tmp ) 
     +_cd:61> IPREFIX=../ 
     +_cd:62> PREFIX=z 
     +_cd:66> [[ z != (\~|/|./|../)* && ../ != ../* ]]
     +_cd:114> [[ CURRENT -ne 1 ]]
     +_cd:114> _wanted directories expl directory _path_files -W /tmp -/
      +_wanted:3> local -a __targs __gopt
      +_wanted:5> zparseopts -D -a __gopt 1 2 V J x 'C:=__targs'
      +_wanted:7> _tags directories
       +_tags:3> local prev
       +_tags:10> [[ directories = -- ]]
       +_tags:15> ((  1  ))
       +_tags:19> local curcontext=:complete:cd: order tag nodef tmp
       +_tags:21> [[ directories = -C?* ]]
       +_tags:24> [[ directories = -C ]]
       +_tags:29> [[ directories = -(|-) ]]
       +_tags:31> zstyle -a :completion::complete:cd:: group-order order
       +_tags:36> comptags -i :complete:cd: directories
       +_tags:40> [[ -n '' ]]
       +_tags:43> zstyle -a :completion::complete:cd:: tag-order order
       +_tags:47> tag=local-directories
       +_tags:48> case local-directories (-)
       +_tags:48> case local-directories (!*)
       +_tags:48> case local-directories (?*)
       +_tags:51> comptry -m local-directories
       +_tags:47> tag=-
       +_tags:48> case - (-)
       +_tags:49> nodef=yes 
       +_tags:55> [[ -z yes ]]
       +_tags:60> comptags -T
       +_tags:62> return
      +_wanted:9> _tags
       +_tags:3> local prev
       +_tags:10> [[ '' = -- ]]
       +_tags:15> ((  0  ))
       +_tags:67> comptags -N
      +_wanted:13> return 1
     +_cd:117> return ret
   +_dispatch:64> [[ patterns = (all|*patterns*) ]]
   +_dispatch:64> return ret
 +_complete:142> _compskip='' 
 +_complete:144> return ret
+_main_complete:206> ((  _matcher_num++  ))
+_main_complete:208> [[ -n '' ]]
+_main_complete:210> ((  _completer_num++  ))
+_main_complete:166> tmp=_prefix
+_main_complete:168> [[ -n '' ]]
+_main_complete:170> [[ _prefix = *:-* ]]
+_main_complete:173> [[ _prefix = *:* ]]
+_main_complete:177> _completer=prefix 
+_main_complete:180> curcontext=:prefix:: 
+_main_complete:181> zstyle -t :completion::prefix::: show-completer
+_main_complete:184> zstyle -a :completion::prefix::: matcher-list _matchers
+_main_complete:187> _matcher_num=1 
+_main_complete:188> _matcher='' 
+_main_complete:189> _c_matcher=m:{[:lower:]}={[:upper:]}
+_main_complete:190> [[ 'm:{[:lower:]}={[:upper:]}' == +* ]]
+_main_complete:193> _matcher='m:{[:lower:]}={[:upper:]}' 
+_main_complete:196> _comp_mesg='' 
+_main_complete:197> [[ -n '' ]]
+_main_complete:202> _prefix
 +_prefix:5> [[ _matcher_num -gt 1 || -z '' ]]
 +_prefix:5> return 1
+_main_complete:206> ((  _matcher_num++  ))
+_main_complete:189> _c_matcher=+l:|=*
+_main_complete:190> [[ '+l:|=*' == +* ]]
+_main_complete:191> _matcher='m:{[:lower:]}={[:upper:]} l:|=*' 
+_main_complete:196> _comp_mesg='' 
+_main_complete:197> [[ -n '' ]]
+_main_complete:202> _prefix
 +_prefix:5> [[ _matcher_num -gt 1 ]]
 +_prefix:5> return 1
+_main_complete:206> ((  _matcher_num++  ))
+_main_complete:208> [[ -n '' ]]
+_main_complete:210> ((  _completer_num++  ))
+_main_complete:166> tmp=_approximate
+_main_complete:168> [[ -n '' ]]
+_main_complete:170> [[ _approximate = *:-* ]]
+_main_complete:173> [[ _approximate = *:* ]]
+_main_complete:177> _completer=approximate 
+_main_complete:180> curcontext=:approximate:: 
+_main_complete:181> zstyle -t :completion::approximate::: show-completer
+_main_complete:184> zstyle -a :completion::approximate::: matcher-list _matchers
+_main_complete:187> _matcher_num=1 
+_main_complete:188> _matcher='' 
+_main_complete:189> _c_matcher=m:{[:lower:]}={[:upper:]}
+_main_complete:190> [[ 'm:{[:lower:]}={[:upper:]}' == +* ]]
+_main_complete:193> _matcher='m:{[:lower:]}={[:upper:]}' 
+_main_complete:196> _comp_mesg='' 
+_main_complete:197> [[ -n '' ]]
+_main_complete:202> _approximate
 +_approximate:11> [[ _matcher_num -gt 1 || 4 -le 1 ]]
 +_approximate:13> local _comp_correct _correct_expl _correct_group comax cfgacc match
 +_approximate:14> local oldcontext=:approximate:: opm=''
 +_approximate:15> local dounfunction
 +_approximate:16> integer ret=1
 +_approximate:18> [[ '' = -a* ]]
 +_approximate:20> [[ '' = -a ]]
 +_approximate:23> zstyle -s :completion::approximate::: max-errors cfgacc
 +_approximate:24> cfgacc='2 numeric' 
 +_approximate:29> [[ '2 numeric' = *numeric* && 1 -ne 1 ]]
 +_approximate:38> comax=2 
 +_approximate:43> [[ 2 -lt 1 ]]
 +_approximate:45> _tags corrections original
  +_tags:3> local prev
  +_tags:10> [[ corrections = -- ]]
  +_tags:15> ((  2  ))
  +_tags:19> local curcontext=:approximate:: order tag nodef tmp
  +_tags:21> [[ corrections = -C?* ]]
  +_tags:24> [[ corrections = -C ]]
  +_tags:29> [[ corrections = -(|-) ]]
  +_tags:31> zstyle -a :completion::approximate::: group-order order
  +_tags:36> comptags -i :approximate:: corrections original
  +_tags:40> [[ -n '' ]]
  +_tags:43> zstyle -a :completion::approximate::: tag-order order
  +_tags:44> ((  ! 0  ))
  +_tags:55> [[ -z '' ]]
  +_tags:55> comptry corrections original
  +_tags:60> comptags -T
  +_tags:62> return
 +_approximate:55> ((  ! 0  ))
 +_approximate:56> dounfunction=1 
 +_approximate:76> _comp_correct=1 
 +_approximate:78> [[ -z '' ]]
 +_approximate:78> compstate[pattern_match]='*' 
 +_approximate:80> [[ _comp_correct -le comax ]]
 +_approximate:81> curcontext=:approximate-1:: 
 +_approximate:83> _description corrections _correct_expl corrections e:1 o:../z
  +_description:3> local name gropt nopt xopt format gname hidden hide match opts tag sort
  +_description:5> opts=( ) 
  +_description:7> gropt=( -J ) 
  +_description:8> xopt=( -X ) 
  +_description:9> nopt=( ) 
  +_description:10> zparseopts -K -D -a nopt 1 2 'V=gropt' 'J=gropt' 'x=xopt'
  +_description:12> 3=corrections 
  +_description:13> [[ -n corrections ]]
  +_description:13> _lastdescr=( '' corrections ) 
  +_description:15> zstyle -s :completion::approximate-1:::corrections group-name gname
  +_description:18> _setup corrections -default-
   +_setup:3> local val nm=0
   +_setup:5> [[ 2 -eq 1 ]]
   +_setup:7> zstyle -a :completion::approximate-1:::corrections list-colors val
   +_setup:21> [[ corrections = default ]]
   +_setup:27> zstyle -s :completion::approximate-1:::corrections show-ambiguity val
   +_setup:32> zstyle -t :completion::approximate-1:::corrections list-packed
   +_setup:34> [[ 2 -eq 1 ]]
   +_setup:37> compstate[list]=ambiguous 
   +_setup:40> zstyle -t :completion::approximate-1:::corrections list-rows-first
   +_setup:42> [[ 2 -eq 1 ]]
   +_setup:45> compstate[list]=ambiguous 
   +_setup:48> zstyle -t :completion::approximate-1:::corrections last-prompt
   +_setup:50> [[ 2 -eq 1 ]]
   +_setup:53> compstate[last_prompt]=yes 
   +_setup:56> zstyle -t :completion::approximate-1:::corrections accept-exact
   +_setup:58> [[ 2 -eq 1 ]]
   +_setup:61> compstate[exact]='' 
   +_setup:64> [[ _last_nmatches -ge 0 ]]
   +_setup:67> zstyle -a :completion::approximate-1:::corrections menu val
   +_setup:71> _last_nmatches=-1 
   +_setup:74> [[ '' != always ]]
   +_setup:75> zstyle -s :completion::approximate-1:::corrections force-list val
  +_description:20> name=_correct_expl 
  +_description:22> zstyle -s :completion::approximate-1:::corrections format format
  +_description:23> zstyle -s :completion::approximate-1:::descriptions format format
  +_description:25> zstyle -s :completion::approximate-1:::corrections hidden hidden
  +_description:30> zstyle -s :completion::approximate-1:::corrections matcher match
  +_description:32> [[ -n 'm:{[:lower:]}={[:upper:]}' ]]
  +_description:32> opts=( -M 'm:{[:lower:]}={[:upper:]}' ) 
  +_description:36> zstyle -s :completion::approximate-1:::corrections sort sort
  +_description:37> zstyle -s :completion::approximate-1::: sort sort
  +_description:46> [[ -z '' ]]
  +_description:47> zstyle -a :completion::approximate-1:::corrections ignored-patterns _comp_ignore
  +_description:48> _comp_ignore=( ) 
  +_description:50> zstyle -s :completion::approximate-1:::corrections ignore-line hidden
  +_description:66> ((  0  ))
  +_description:71> tag=corrections 
  +_description:73> shift 2
  +_description:74> [[ -z corrections ]]
  +_description:76> [[ -n '' ]]
  +_description:80> [[ -n '' ]]
  +_description:87> [[ -n '' ]]
  +_description:90> set -A _correct_expl -M 'm:{[:lower:]}={[:upper:]}' -J -default-
  +_description:94> ((  0  ))
  +_description:95> local fakestyle descr
  +_description:96> fakestyle=fake
  +_description:97> zstyle -a :completion::approximate-1:::corrections fake match
  +_description:98> continue
  +_description:96> fakestyle=fake-always
  +_description:97> zstyle -a :completion::approximate-1:::corrections fake-always match
  +_description:98> continue
  +_description:111> return 0
 +_approximate:86> _correct_group=3 
 +_approximate:88> _complete
  +_complete:7> local comp name oldcontext ret=1 service
  +_complete:8> typeset -T curcontext=:approximate-1:: ccarray
  +_complete:10> oldcontext=:approximate-1:: 
  +_complete:14> [[ -n '' ]]
  +_complete:96> comp=_first 
  +_complete:97> [[ -n _first ]]
  +_complete:98> service=-first- 
  +_complete:99> ccarray[3]=-first- 
  +_complete:100> eval _first
   +(eval):1> _first
  +_complete:100> ret=0 
  +_complete:101> [[ '' = all ]]
  +_complete:110> [[ -n '' ]]
  +_complete:114> ret=1 
  +_complete:115> [[ command = command ]]
  +_complete:116> curcontext=:approximate-1:: 
  +_complete:117> _normal -s
   +_normal:3> local _comp_command1 _comp_command2 _comp_command skip
   +_normal:5> [[ -s = -s ]]
   +_normal:6> skip=( -s ) 
   +_normal:16> [[ -o BANG_HIST && ../z = !*: || ../z = "!*: ]]
   +_normal:29> [[ CURRENT -eq 1 ]]
   +_normal:38> _set_command
    +_set_command:6> local command
    +_set_command:8> command=cd 
    +_set_command:10> [[ -z cd ]]
    +_set_command:12> ((  1 + 0  ))
    +_set_command:13> _comp_command1=cd 
    +_set_command:14> _comp_command=cd 
   +_normal:40> _dispatch -s cd cd '' -default-
    +_dispatch:3> local comp pat val name i ret=1 _compskip=''
    +_dispatch:4> local curcontext=:approximate-1:: service str noskip
    +_dispatch:5> local -a match mbegin mend
    +_dispatch:9> [[ -s = -s ]]
    +_dispatch:10> noskip=yes 
    +_dispatch:11> shift
    +_dispatch:14> [[ -z yes ]]
    +_dispatch:16> curcontext=:approximate-1:cd: 
    +_dispatch:18> shift
    +_dispatch:22> [[ '' != (all|*patterns*) ]]
    +_dispatch:24> str=cd
    +_dispatch:25> [[ -n cd ]]
    +_dispatch:26> service=cd 
    +_dispatch:24> str=
    +_dispatch:25> [[ -n '' ]]
    +_dispatch:25> continue
    +_dispatch:24> str=-default-
    +_dispatch:25> [[ -n -default- ]]
    +_dispatch:26> service=-default- 
    +_dispatch:45> ret=1 
    +_dispatch:46> str=cd
    +_dispatch:47> [[ -n cd ]]
    +_dispatch:51> str=cd 
    +_dispatch:52> name=cd 
    +_dispatch:53> comp=_cd 
    +_dispatch:54> service=cd 
    +_dispatch:56> [[ -z _cd ]]
    +_dispatch:56> break
    +_dispatch:61> [[ -n _cd && cd != -default- ]]
    +_dispatch:62> _compskip=patterns 
    +_dispatch:63> eval _cd
     +(eval):1> _cd
      +_cd:22> setopt localoptions nonomatch
      +_cd:24> local expl ret=1 curarg
      +_cd:25> integer argstart=2 noopts
      +_cd:27> ((  CURRENT > 1  ))
      +_cd:30> [[ ../z = -* ]]
      +_cd:38> [[ CURRENT -eq 3 ]]
      +_cd:49> [[ ../z == (#b)(\~|)[^/]# ]]
      +_cd:54> local -a tmpWpath
      +_cd:55> [[ ../z = (|*/)../* ]]
      +_cd:56> local tmpprefix
      +_cd:58> tmpprefix=      +_cd:58> cd ..
      +_cd:58> print /tmp
      +_cd:58> tmpprefix=/tmp 
      +_cd:59> [[ -n /tmp ]]
      +_cd:60> tmpWpath=( -W /tmp ) 
      +_cd:61> IPREFIX=../ 
      +_cd:62> PREFIX=z 
      +_cd:66> [[ z != (\~|/|./|../)* && ../ != ../* ]]
      +_cd:114> [[ CURRENT -ne 1 ]]
      +_cd:114> _wanted directories expl directory _path_files -W /tmp -/
       +_wanted:3> local -a __targs __gopt
       +_wanted:5> zparseopts -D -a __gopt 1 2 V J x 'C:=__targs'
       +_wanted:7> _tags directories
        +_tags:3> local prev
        +_tags:10> [[ directories = -- ]]
        +_tags:15> ((  1  ))
        +_tags:19> local curcontext=:approximate-1:cd: order tag nodef tmp
        +_tags:21> [[ directories = -C?* ]]
        +_tags:24> [[ directories = -C ]]
        +_tags:29> [[ directories = -(|-) ]]
        +_tags:31> zstyle -a :completion::approximate-1:cd:: group-order order
        +_tags:36> comptags -i :approximate-1:cd: directories
        +_tags:40> [[ -n '' ]]
        +_tags:43> zstyle -a :completion::approximate-1:cd:: tag-order order
        +_tags:44> ((  ! 0  ))
        +_tags:55> [[ -z '' ]]
        +_tags:55> comptry directories
        +_tags:60> comptags -T
        +_tags:62> return
       +_wanted:9> _tags
        +_tags:3> local prev
        +_tags:10> [[ '' = -- ]]
        +_tags:15> ((  0  ))
        +_tags:67> comptags -N
       +_wanted:10> _all_labels directories expl directory _path_files -W /tmp -/
        +_all_labels:3> local __gopt __len __tmp __pre __suf __ret=1 __descr __spec __prev
        +_all_labels:5> [[ directories = - ]]
        +_all_labels:10> __gopt=( ) 
        +_all_labels:11> zparseopts -D -a __gopt 1 2 V J x
        +_all_labels:13> __tmp=8 
        +_all_labels:14> __len=7 
        +_all_labels:15> [[ __tmp -lt __len ]]
        +_all_labels:18> [[ __tmp -eq 7 ]]
        +_all_labels:22> __pre=4 
        +_all_labels:23> __suf=5 
        +_all_labels:26> comptags -A directories curtag __spec
        +_all_labels:27> ((  10 > _tags_level  ))
        +_all_labels:27> _comp_tags='' 
        +_all_labels:28> _tags_level=10 
        +_all_labels:29> _comp_tags=' directories ' 
        +_all_labels:30> [[ directories = *[^\\]:* ]]
        +_all_labels:37> _description directories expl directory
         +_description:3> local name gropt nopt xopt format gname hidden hide match opts tag sort
         +_description:5> opts=( ) 
         +_description:7> gropt=( -J ) 
         +_description:8> xopt=( -X ) 
         +_description:9> nopt=( ) 
         +_description:10> zparseopts -K -D -a nopt 1 2 'V=gropt' 'J=gropt' 'x=xopt'
         +_description:12> 3=directory 
         +_description:13> [[ -n directory ]]
         +_description:13> _lastdescr=( '' corrections directory ) 
         +_description:15> zstyle -s :completion::approximate-1:cd::directories group-name gname
         +_description:18> _setup directories -default-
          +_setup:3> local val nm=0
          +_setup:5> [[ 2 -eq 1 ]]
          +_setup:7> zstyle -a :completion::approximate-1:cd::directories list-colors val
          +_setup:21> [[ directories = default ]]
          +_setup:27> zstyle -s :completion::approximate-1:cd::directories show-ambiguity val
          +_setup:32> zstyle -t :completion::approximate-1:cd::directories list-packed
          +_setup:34> [[ 2 -eq 1 ]]
          +_setup:37> compstate[list]=ambiguous 
          +_setup:40> zstyle -t :completion::approximate-1:cd::directories list-rows-first
          +_setup:42> [[ 2 -eq 1 ]]
          +_setup:45> compstate[list]=ambiguous 
          +_setup:48> zstyle -t :completion::approximate-1:cd::directories last-prompt
          +_setup:50> [[ 2 -eq 1 ]]
          +_setup:53> compstate[last_prompt]=yes 
          +_setup:56> zstyle -t :completion::approximate-1:cd::directories accept-exact
          +_setup:58> [[ 2 -eq 1 ]]
          +_setup:61> compstate[exact]='' 
          +_setup:64> [[ _last_nmatches -ge 0 ]]
          +_setup:67> zstyle -a :completion::approximate-1:cd::directories menu val
          +_setup:71> _last_nmatches=-1 
          +_setup:74> [[ '' != always ]]
          +_setup:75> zstyle -s :completion::approximate-1:cd::directories force-list val
         +_description:20> name=expl 
         +_description:22> zstyle -s :completion::approximate-1:cd::directories format format
         +_description:23> zstyle -s :completion::approximate-1:cd::descriptions format format
         +_description:25> zstyle -s :completion::approximate-1:cd::directories hidden hidden
         +_description:30> zstyle -s :completion::approximate-1:cd::directories matcher match
         +_description:32> [[ -n 'm:{[:lower:]}={[:upper:]}' ]]
         +_description:32> opts=( -M 'm:{[:lower:]}={[:upper:]}' ) 
         +_description:36> zstyle -s :completion::approximate-1:cd::directories sort sort
         +_description:37> zstyle -s :completion::approximate-1:cd:: sort sort
         +_description:46> [[ -z '' ]]
         +_description:47> zstyle -a :completion::approximate-1:cd::directories ignored-patterns _comp_ignore
         +_description:48> _comp_ignore=( ) 
         +_description:50> zstyle -s :completion::approximate-1:cd::directories ignore-line hidden
         +_description:66> ((  0  ))
         +_description:71> tag=directories 
         +_description:73> shift 2
         +_description:74> [[ -z directory ]]
         +_description:76> [[ -n '' ]]
         +_description:80> [[ -n '' ]]
         +_description:87> [[ -n '' ]]
         +_description:90> set -A expl -M 'm:{[:lower:]}={[:upper:]}' -J -default-
         +_description:94> ((  0  ))
         +_description:95> local fakestyle descr
         +_description:96> fakestyle=fake
         +_description:97> zstyle -a :completion::approximate-1:cd::directories fake match
         +_description:98> continue
         +_description:96> fakestyle=fake-always
         +_description:97> zstyle -a :completion::approximate-1:cd::directories fake-always match
         +_description:98> continue
         +_description:111> return 0
        +_all_labels:39> _path_files -M 'm:{[:lower:]}={[:upper:]}' -J -default- -W /tmp -/
         +_path_files:3> local -a match mbegin mend
         +_path_files:17> _have_glob_qual z
          +_have_glob_qual:14> local complete
          +_have_glob_qual:16> [[ '' = complete ]]
          +_have_glob_qual:18> [[ -z '' && on == on && z = (#b)(((*[^\\\$]|)(\\\\)#)\()([^\)\|\~]#) || on == on && z = (#b)(((*[^\\\$]|)(\\\\)#)\(\#q)([^\)]#) ]]
         +_path_files:39> local linepath realpath donepath prepath testpath exppath skips skipped
         +_path_files:40> local tmp1 tmp2 tmp3 tmp4 i orig eorig pre suf tpre tsuf opre osuf cpre
         +_path_files:41> local pats haspats ignore pfx pfxsfx sopt gopt opt sdirs ignpar cfopt listsfx
         +_path_files:42> local nm=0 menu matcher mopts sort mid accex fake
         +_path_files:43> local listfiles listopts tmpdisp origtmp1 Uopt
         +_path_files:44> local accept_exact_dirs path_completion
         +_path_files:45> integer npathcheck
         +_path_files:46> local -a Mopts
         +_path_files:48> typeset -U prepaths exppaths
         +_path_files:50> exppaths=( ) 
         +_path_files:54> zparseopts -a mopts 'P:=pfx' 'S:=pfxsfx' 'q=pfxsfx' 'r:=pfxsfx' 'R:=pfxsfx' 'W:=prepaths' 'F:=ignore' 'M+:=matcher' J+: V+: X+: 1 2 n 'f=tmp1' '/=tmp1' 'g+:-=tmp1'
         +_path_files:59> sopt=-/ 
         +_path_files:60> ((  1  ))
         +_path_files:60> haspats=yes 
         +_path_files:61> ((  0  ))
         +_path_files:62> ((  1  ))
         +_path_files:63> pats='' 
         +_path_files:64> pats=( '*(-/)' ) 
         +_path_files:69> pats=( '*(-/)' ) 
         +_path_files:71> ((  0  ))
         +_path_files:75> ((  2  ))
         +_path_files:76> tmp1=/tmp 
         +_path_files:77> [[ / = \( ]]
         +_path_files:79> [[ / = / ]]
         +_path_files:80> prepaths=( /tmp/ ) 
         +_path_files:85> ((  ! 1  ))
         +_path_files:90> ((  0  ))
         +_path_files:101> [[ -/ = -(f|) ]]
         +_path_files:110> ((  ! 1  ))
         +_path_files:131> [[ -z '' && 0 -eq 0 && -z '' && -n '' ]]
         +_path_files:135> ((  0  ))
         +_path_files:140> [[ 2 -eq 0 ]]
         +_path_files:146> ((  2  ))
         +_path_files:148> mopts=( -J -default- -M 'm:{[:lower:]}={[:upper:]}' ) 
         +_path_files:151> zstyle -s :completion::approximate-1:cd:: file-sort tmp1
         +_path_files:186> zstyle -t :completion::approximate-1:cd::paths squeeze-slashes
         +_path_files:189> skips='((.|..)/)##' 
         +_path_files:192> zstyle -s :completion::approximate-1:cd::paths special-dirs sdirs
         +_path_files:193> zstyle -t :completion::approximate-1:cd::paths list-suffixes
         +_path_files:196> [[ '*(-/)' = ((|*[[:blank:]])\*(|[[:blank:]]*|\([^[:blank:]]##\))|*\([^[:blank:]]#/[^[:blank:]]#\)*) ]]
         +_path_files:197> sopt=-// 
         +_path_files:199> zstyle -a :completion::approximate-1:cd::paths accept-exact accex
         +_path_files:200> zstyle -a :completion::approximate-1:cd:: fake-files fake
         +_path_files:202> zstyle -s :completion::approximate-1:cd:: ignore-parents ignpar
         +_path_files:204> zstyle -t :completion::approximate-1:cd::paths accept-exact-dirs
         +_path_files:206> zstyle -T :completion::approximate-1:cd::paths path-completion
         +_path_files:207> path_completion=1 
         +_path_files:209> [[ -n '*' ]]
         +_path_files:210> [[ -z '' ]]
         +_path_files:210> _have_glob_qual z complete
          +_have_glob_qual:14> local complete
          +_have_glob_qual:16> [[ complete = complete ]]
          +_have_glob_qual:16> complete=')' 
          +_have_glob_qual:18> [[ -z '' && on == on && z = (#b)(((*[^\\\$]|)(\\\\)#)\()([^\)\|\~]#)\) || on == on && z = (#b)(((*[^\\\$]|)(\\\\)#)\(\#q)([^\)]#)\) ]]
         +_path_files:211> _have_glob_qual '' complete
          +_have_glob_qual:14> local complete
          +_have_glob_qual:16> [[ complete = complete ]]
          +_have_glob_qual:16> complete=')' 
          +_have_glob_qual:18> [[ -z '' && on == on && '' = (#b)(((*[^\\\$]|)(\\\\)#)\()([^\)\|\~]#)\) || on == on && '' = (#b)(((*[^\\\$]|)(\\\\)#)\(\#q)([^\)]#)\) ]]
         +_path_files:237> pre=z 
         +_path_files:238> suf='' 
         +_path_files:239> opre=z 
         +_path_files:240> osuf='' 
         +_path_files:241> orig=z 
         +_path_files:242> eorig=z 
         +_path_files:244> [[ automenu-unambiguous = (*menu|[0-9]*) || -n 1 ]]
         +_path_files:246> menu=yes 
         +_path_files:247> [[ -n 1 ]]
         +_path_files:248> cfopt=- 
         +_path_files:249> Uopt=-U 
         +_path_files:256> [[ z = [^][*?#^\|\<\>\\]#(`[^`]#`|\$)*/* ]]
         +_path_files:277> [[ z = \~ ]]
         +_path_files:327> linepath='' 
         +_path_files:328> realpath='' 
         +_path_files:330> zstyle -s :completion::approximate-1:cd:: preserve-prefix tmp1
         +_path_files:338> [[ z = / ]]
         +_path_files:351> [[ z = (.|..)/* ]]
         +_path_files:352> donepath='' 
         +_path_files:359> prepath=/tmp/
         +_path_files:365> skipped='' 
         +_path_files:366> cpre='' 
         +_path_files:368> [[ -n '' || -z 1 ]]
         +_path_files:407> tpre=z 
         +_path_files:408> tsuf='' 
         +_path_files:416> testpath='' 
         +_path_files:418> tmp2='' 
         +_path_files:419> tpre=z 
         +_path_files:421> tmp1=( /tmp/ ) 
         +_path_files:424> ((  npathcheck = 0  ))
         +_path_files:425> true
         +_path_files:427> origtmp1=( /tmp/ ) 
         +_path_files:430> [[ z = */* ]]
         +_path_files:434> PREFIX=z 
         +_path_files:435> SUFFIX='' 
         +_path_files:447> tmp2=( /tmp/ ) 
         +_path_files:449> [[ z = (#b)*/(*) ]]
         +_path_files:462> [[ -// = *[/f]* ]]
         +_path_files:463> compfiles -p- tmp1 accex '' 'm:{[:lower:]}={[:upper:]} m:{[:lower:]}={[:upper:]}' '' fake '*(-/)'
         +_path_files:467> tmp1=( /tmp/com.apple.launchd.O1QCaefF6l /tmp/com.apple.launchd.Ya84Wdpn4w /tmp/com.apple.launchd.wWcKhD0JAo /tmp/cvcd /tmp/devio_semaphore_devio_0xb013 /tmp/opt /tmp/stats /tmp/zaa /tmp/zbb /tmp/zcc ) 
         +_path_files:469> [[ -n z ]]
         +_path_files:482> ((  ! 10 && npathcheck == 0  ))
         +_path_files:499> ((  ! 10  ))
         +_path_files:501> [[ /tmp/com.apple.launchd.O1QCaefF6l = */* ]]
         +_path_files:502> [[ -n 1 ]]
         +_path_files:503> tmp2=( /tmp/com.apple.launchd.O1QCaefF6l /tmp/com.apple.launchd.Ya84Wdpn4w /tmp/com.apple.launchd.wWcKhD0JAo /tmp/cvcd /tmp/devio_semaphore_devio_0xb013 /tmp/opt /tmp/stats /tmp/zaa /tmp/zbb /tmp/zcc ) 
         +_path_files:504> compadd -D tmp1 -M 'm:{[:lower:]}={[:upper:]}' - com.apple.launchd.O1QCaefF6l com.apple.launchd.Ya84Wdpn4w com.apple.launchd.wWcKhD0JAo cvcd devio_semaphore_devio_0xb013 opt stats zaa zbb zcc
         +_path_files:506> [[ 3 -eq 0 ]]
         +_path_files:522> ((  ! 3  ))
         +_path_files:570> [[ -n 'parent pwd' && -z '' && z != */* && 3 -ne 0 && 'parent pwd' != *dir* && 'parent pwd' != *..* ]]
         +_path_files:575> compfiles -i tmp1 ignore 'parent pwd' /tmp/
         +_path_files:576> _comp_ignore+=( zaa ) 
         +_path_files:578> ((  1 && ! 0  ))
         +_path_files:579> mopts=( -J -default- -M 'm:{[:lower:]}={[:upper:]}' -F _comp_ignore ) 
         +_path_files:584> [[ z = */* ]]
         +_path_files:586> [[ '' = */* ]]
         +_path_files:590> break
         +_path_files:609> tmp3=z 
         +_path_files:610> tpre=z 
         +_path_files:611> tsuf='' 
         +_path_files:612> [[ -n /tmp/ ]]
         +_path_files:614> [[ -o nocaseglob ]]
         +_path_files:618> tmp1=( zaa zbb zcc ) 
         +_path_files:622> true
         +_path_files:629> compfiles -r tmp1 z
         +_path_files:630> tmp4=1 
         +_path_files:632> [[ z = */* ]]
         +_path_files:637> tmp2=z 
         +_path_files:638> PREFIX=z 
         +_path_files:639> SUFFIX='' 
         +_path_files:646> ((  tmp4  ))
         +_path_files:655> tmp2='' 
         +_path_files:656> [[ -n '' ]]
         +_path_files:658> [[ -n '' ]]
         +_path_files:662> compquote tmp1 tmp2
         +_path_files:665> [[ -z 1 ]]
         +_path_files:675> [[ -z automenu-unambiguous ]]
         +_path_files:676> zstyle -t :completion::approximate-1:cd::paths expand suffix
         +_path_files:677> [[ -z '' && -n 1 ]]
         +_path_files:683> ((  tmp4  ))
         +_path_files:683> zstyle -t :completion::approximate-1:cd::paths ambiguous
         +_path_files:685> [[ z = */* ]]
         +_path_files:711> _list_files tmp1 /tmp/
          +_list_files:11> local stat f elt what dir
          +_list_files:12> local -a stylevals
          +_list_files:13> integer ok
          +_list_files:15> listfiles=( ) 
          +_list_files:16> listopts=( ) 
          +_list_files:18> zstyle -a :completion::approximate-1:cd:: file-list stylevals
          +_list_files:18> return 1
         +_path_files:712> compadd -U -Qf -J -default- -M 'm:{[:lower:]}={[:upper:]}' -F _comp_ignore -p ../ -s '' -W /tmp/ -a tmp1
          +compadd:1> local ppre=9
          +compadd:3> [[ 1 -eq 0 ]]
          +compadd:6> [[ z = \~* ]]
          +compadd:9> PREFIX='(#a1)z' 
          +compadd:12> ((  3 && 8  ))
          +compadd:13> _correct_expl[_correct_group]=-J 
          +compadd:15> compadd -M 'm:{[:lower:]}={[:upper:]}' -J -default- -U -Qf -J -default- -M 'm:{[:lower:]}={[:upper:]}' -F _comp_ignore -p ../ -s '' -W /tmp/ -a tmp1
         +_path_files:749> tmp4=- 
         +_path_files:751> break
         +_path_files:795> [[ -z - ]]
         +_path_files:881> [[ _matcher_num -eq 2 ]]
         +_path_files:890> [[ nm -ne 'compstate[nmatches]' ]]
        +_all_labels:39> __ret=0 
        +_all_labels:26> comptags -A directories curtag __spec
        +_all_labels:43> return __ret
       +_wanted:10> return 0
      +_cd:115> ret=0 
      +_cd:117> return ret
    +_dispatch:63> ret=0 
    +_dispatch:64> [[ patterns = (all|*patterns*) ]]
    +_dispatch:64> return ret
  +_complete:117> ret=0 
  +_complete:142> _compskip='' 
  +_complete:144> return ret
 +_approximate:89> zstyle -t :completion::approximate-1::: insert-unambiguous
 +_approximate:92> _requested original
  +_requested:3> local __gopt
  +_requested:5> __gopt=( ) 
  +_requested:6> zparseopts -D -a __gopt 1 2 V J x
  +_requested:8> comptags -R original
  +_requested:9> [[ 1 -gt 3 ]]
  +_requested:11> [[ 1 -gt 1 ]]
  +_requested:14> return 0
 +_approximate:93> [[ 'compstate[nmatches]' -gt 1 ]]
 +_approximate:95> local expl
 +_approximate:97> _description -V original expl original
  +_description:3> local name gropt nopt xopt format gname hidden hide match opts tag sort
  +_description:5> opts=( ) 
  +_description:7> gropt=( -J ) 
  +_description:8> xopt=( -X ) 
  +_description:9> nopt=( ) 
  +_description:10> zparseopts -K -D -a nopt 1 2 'V=gropt' 'J=gropt' 'x=xopt'
  +_description:12> 3=original 
  +_description:13> [[ -n original ]]
  +_description:13> _lastdescr=( '' corrections directory original ) 
  +_description:15> zstyle -s :completion::approximate-1:::original group-name gname
  +_description:18> _setup original -default-
   +_setup:3> local val nm=3
   +_setup:5> [[ 2 -eq 1 ]]
   +_setup:7> zstyle -a :completion::approximate-1:::original list-colors val
   +_setup:21> [[ original = default ]]
   +_setup:27> zstyle -s :completion::approximate-1:::original show-ambiguity val
   +_setup:32> zstyle -t :completion::approximate-1:::original list-packed
   +_setup:34> [[ 2 -eq 1 ]]
   +_setup:37> compstate[list]=ambiguous 
   +_setup:40> zstyle -t :completion::approximate-1:::original list-rows-first
   +_setup:42> [[ 2 -eq 1 ]]
   +_setup:45> compstate[list]=ambiguous 
   +_setup:48> zstyle -t :completion::approximate-1:::original last-prompt
   +_setup:50> [[ 2 -eq 1 ]]
   +_setup:53> compstate[last_prompt]=yes 
   +_setup:56> zstyle -t :completion::approximate-1:::original accept-exact
   +_setup:58> [[ 2 -eq 1 ]]
   +_setup:61> compstate[exact]='' 
   +_setup:64> [[ _last_nmatches -ge 0 ]]
   +_setup:67> zstyle -a :completion::approximate-1:::original menu val
   +_setup:71> _last_nmatches=-1 
   +_setup:74> [[ '' != always ]]
   +_setup:75> zstyle -s :completion::approximate-1:::original force-list val
  +_description:20> name=expl 
  +_description:22> zstyle -s :completion::approximate-1:::original format format
  +_description:23> zstyle -s :completion::approximate-1:::descriptions format format
  +_description:25> zstyle -s :completion::approximate-1:::original hidden hidden
  +_description:30> zstyle -s :completion::approximate-1:::original matcher match
  +_description:32> [[ -n 'm:{[:lower:]}={[:upper:]}' ]]
  +_description:32> opts=( -M 'm:{[:lower:]}={[:upper:]}' ) 
  +_description:36> zstyle -s :completion::approximate-1:::original sort sort
  +_description:37> zstyle -s :completion::approximate-1::: sort sort
  +_description:46> [[ -z '' ]]
  +_description:47> zstyle -a :completion::approximate-1:::original ignored-patterns _comp_ignore
  +_description:48> _comp_ignore=( ) 
  +_description:50> zstyle -s :completion::approximate-1:::original ignore-line hidden
  +_description:66> ((  0  ))
  +_description:71> tag=original 
  +_description:73> shift 2
  +_description:74> [[ -z original ]]
  +_description:76> [[ -n '' ]]
  +_description:80> [[ -n '' ]]
  +_description:87> [[ -n '' ]]
  +_description:90> set -A expl -M 'm:{[:lower:]}={[:upper:]}' -V -default-
  +_description:94> ((  0  ))
  +_description:95> local fakestyle descr
  +_description:96> fakestyle=fake
  +_description:97> zstyle -a :completion::approximate-1:::original fake match
  +_description:98> continue
  +_description:96> fakestyle=fake-always
  +_description:97> zstyle -a :completion::approximate-1:::original fake-always match
  +_description:98> continue
  +_description:111> return 0
 +_approximate:99> compadd -M 'm:{[:lower:]}={[:upper:]}' -V -default- -U -Q - ../z
 +_approximate:104> [[ ambiguous != list* ]]
 +_approximate:105> compstate[list]='ambiguous force' 
 +_approximate:107> compstate[pattern_match]='' 
 +_approximate:109> ret=0 
 +_approximate:110> break
 +_approximate:118> [[ -n 1 ]]
 +_approximate:118> ((  1  ))
 +_approximate:118> unfunction compadd
 +_approximate:121> ((  ret == 0  ))
 +_approximate:121> return 0
+_main_complete:203> ret=0 
+_main_complete:204> break 2
+_main_complete:213> curcontext=::: 
+_main_complete:214> [[ '' = keep ]]
+_main_complete:220> nm=4 
+_main_complete:223> [[ '' = keep || nm -gt 1 ]]
+_main_complete:224> [[ _last_nmatches -ge 0 ]]
+_main_complete:227> tmp=4 
+_main_complete:229> _menu_style=( '' '' ) 
+_main_complete:231> [[ 'ambiguous force' = *list ]]
+_main_complete:235> [[ automenu-unambiguous = automenu-unambiguous ]]
+_main_complete:236> [[ -n automenu-unambiguous && -n '' ]]
+_main_complete:240> sel=( ) 
+_main_complete:242> ((  0  ))
+_main_complete:258> sel=( ) 
+_main_complete:260> ((  0  ))
+_main_complete:276> [[ -n '' || -n '' ]]
+_main_complete:280> [[ -n '' ]]
+_main_complete:282> [[ -n '' ]]
+_main_complete:289> [[ automenu-unambiguous = *menu* ]]
+_main_complete:290> [[ '' = 00 ]]
+_main_complete:291> [[ -n '' ]]
+_main_complete:293> [[ -n '' ]]
+_main_complete:299> [[ '' != 00 ]]
+_main_complete:300> sel=( ) 
+_main_complete:302> ((  0  ))
+_main_complete:321> unset MENUSELECT
+_main_complete:324> [[ -n '' ]]
+_main_complete:361> [[ -n '' ]]
+_main_complete:368> [[ '' = always || '' = ?* ]]
+_main_complete:374> [[ '' = keep ]]
+_main_complete:380> ((  0  ))
+_main_complete:383> unset ZLS_COLORS
+_main_complete:389> funcs=( ) 
+_main_complete:390> comppostfuncs=( ) 
+_main_complete:395> _lastcomp=( list_lines 2 all_quotes '\' nmatches 4 pattern_match '' restore auto context command vared '' unambiguous ../z list_max 100 unambiguous_cursor 5 list 'ambiguous force' insert_positions 7 unambiguous_positions 4 exact '' to_end match last_prompt yes pattern_insert menu ignored 0 insert automenu-unambiguous ) 
+_main_complete:396> _lastcomp[nmatches]=4 
+_main_complete:397> _lastcomp[completer]=approximate 
+_main_complete:398> _lastcomp[prefix]=../z 
+_main_complete:399> _lastcomp[suffix]='' 
+_main_complete:400> _lastcomp[iprefix]='' 
+_main_complete:401> _lastcomp[isuffix]='' 
+_main_complete:402> _lastcomp[qiprefix]='' 
+_main_complete:403> _lastcomp[qisuffix]='' 
+_main_complete:404> _lastcomp[tags]=' directories ' 
+_main_complete:406> return ret
+_complete_debug:22> integer ret=0
+_complete_debug:23> unsetopt xtrace

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2017-03-14 21:50   ` Jesper Nygårds
@ 2017-03-15  3:56     ` Bart Schaefer
  2017-03-15  7:22       ` Jesper Nygårds
  0 siblings, 1 reply; 27+ messages in thread
From: Bart Schaefer @ 2017-03-15  3:56 UTC (permalink / raw)
  To: Jesper Nygårds; +Cc: Zsh Users

On Tue, Mar 14, 2017 at 2:50 PM, Jesper Nygårds
<jesper.nygards@gmail.com> wrote:
> Thank you for your help, Bart. I tried your suggestion, but I'm afraid I'm a
> little overwhelmed by the amount of debug info.

The clue is at the very end of each file:  In the first case [that
ignores parents as expected], the _complete function generated the
matches, but in the second case the _approximate function generated
them.

The path search correctly excludes "zaa" but then _approximate puts it
back because it is similar enough to the string on the command line.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2017-03-15  3:56     ` Bart Schaefer
@ 2017-03-15  7:22       ` Jesper Nygårds
  2017-03-15 17:00         ` Bart Schaefer
  0 siblings, 1 reply; 27+ messages in thread
From: Jesper Nygårds @ 2017-03-15  7:22 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 2105 bytes --]

On Wed, Mar 15, 2017 at 4:56 AM, Bart Schaefer <schaefer@brasslantern.com>
wrote:

> The clue is at the very end of each file:  In the first case [that
> ignores parents as expected], the _complete function generated the
> matches, but in the second case the _approximate function generated
> them.
>
> The path search correctly excludes "zaa" but then _approximate puts it
> back because it is similar enough to the string on the command line.
>

Thanks to your help, I managed to find a working solution, changing the
critical lines to this:
zstyle ':completion:*:complete:cd:*:*' tag-order local-directories
directories -
zstyle ':completion:*:withpath:cd:*:*' tag-order path-directories

In other words,  I have added 'directories' to the first line.

However, I still don't fully understand what is going on. As per your
findings, it's the _approximate function that adds 'zaa'. But that must
mean that none of the previous completers have found any match, doesn't it?
If _complete or  _complete:withpath had found even _one_ match,
_approximate would never have been called, right?

The documentation for the local-directories tag says that it and
path-directories are used if cdpath is set, instead of the 'directories'
tag. I had interpreted this to mean that the 'directories' tag does not
come into play when doing cd completion whenever cdpath is set, as in my
case.

Furthermore, as I read the documentation of tag-order, all tags are in play
after the explicitly mentioned tags, _unless_ the list ends with a hyphen.
However, the tag-order of the second completer, 'withpath', doesn't end
with a hyphen, and I would thus have expected the 'directories' tag to be
tried even though it is not explicitly mentioned.

In short, I would have thought that 'directories' was uninteresting tag
when cdpath was set, and when it actually was in play, I would have thought
it would be tried by the withpath-completer since there is no hyphen at the
end of the tag-order. But obviously I have misunderstood something here,
since it works. I'm just curious to know where the fault in my
understanding is.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2017-03-15  7:22       ` Jesper Nygårds
@ 2017-03-15 17:00         ` Bart Schaefer
  2017-03-15 20:33           ` Jesper Nygårds
  0 siblings, 1 reply; 27+ messages in thread
From: Bart Schaefer @ 2017-03-15 17:00 UTC (permalink / raw)
  To: Zsh Users

On Mar 15,  8:22am, Jesper Nygards wrote:
}
} Thanks to your help, I managed to find a working solution, changing the
} critical lines to this:
} zstyle ':completion:*:complete:cd:*:*' tag-order local-directories
} directories -
} zstyle ':completion:*:withpath:cd:*:*' tag-order path-directories
} 
} In other words,  I have added 'directories' to the first line.
} 
} However, I still don't fully understand what is going on.

I believe your style settings are wrong.  You have:

zstyle ':completion:*:*:cd:*:*' completer _expand _complete \
    _complete:withpath _prefix _approximate _ignored
zstyle ':completion:*:withpath:cd:*:*' tag-order path-directories

But _complete:withpath sets the context to "completewithpath" not
to "withpath" so the path-directories tag-order will never match.
(This is why the example uses _complete:-foo so that the context
is complete-foo with the hyphen.)

In light of that --

>> I then go to '/tmp/zaa' and write 'cd ../z<tab>'.

"../z" is not a prefix of a local directory, so the local-directories
tag finds nothing.  (Anything starting with "/" or "../" is treated
as a non-local path.)

So it falls on through to _approximate.

When you add back "directories", _complete finds candidates in "../"
and ignore-parents kicks in.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2017-03-15 17:00         ` Bart Schaefer
@ 2017-03-15 20:33           ` Jesper Nygårds
  0 siblings, 0 replies; 27+ messages in thread
From: Jesper Nygårds @ 2017-03-15 20:33 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 443 bytes --]

On Wed, Mar 15, 2017 at 6:00 PM, Bart Schaefer <schaefer@brasslantern.com>
wrote:
>
> I believe your style settings are wrong.  You have:
>

Ah yes, now I see it. Thank you very much!

I am amazed how far I got it to work while still being wrong. I will make a
mental note to never have _approximate nor _ignored turned on while trying
out new things: In this case _approximate saved me enough times that I
never noticed what was the problem.

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-04-05  0:04                           ` Bart Schaefer
@ 2004-04-05  3:50                             ` Clint Adams
  0 siblings, 0 replies; 27+ messages in thread
From: Clint Adams @ 2004-04-05  3:50 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-users

> Isn't this a job for the ignore-parents zstyle?  I don't recall if I've
> seen bug #240624, so maybe I'm unaware of some detail.

The specific complaint is that if you cd to a named directory, then try
to complete an argument to cd when CDABLE_VARS is set, the named
directory which is the same as $PWD will be offered for completion
(in addition to usernames which are invalid arguments at this point;
this facet is bug #240618).

> zstyle :completion::complete:cd:: ignore-parents pwd

This works if I do something like

% cd ../<TAB>

$PWD will be excluded.

But if I do

% cd
% zstyle :completion::complete:cd:: ignore-parents pwd
% cdpath=(..)
% cd c<TAB>

or

% cd
% zstyle :completion::complete:cd:: ignore-parents pwd
% setopt cdablevars
% cd c<TAB>

"clint" will be completed in either case.  I believe that the latter
behavior illustrates Thorsten's complaint.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-04-04 16:39                         ` Clint Adams
@ 2004-04-05  0:04                           ` Bart Schaefer
  2004-04-05  3:50                             ` Clint Adams
  0 siblings, 1 reply; 27+ messages in thread
From: Bart Schaefer @ 2004-04-05  0:04 UTC (permalink / raw)
  To: zsh-users

On Apr 4, 12:39pm, Clint Adams wrote:
}
} > I don't think #240624 is affected by the workaround. It still fires
} > when inside the directory named by the variable.
} 
} This isn't specific to CDABLE_VARS; If you set cdpath=(..), for example,
} it will offer to complete the current directory.

Isn't this a job for the ignore-parents zstyle?  I don't recall if I've
seen bug #240624, so maybe I'm unaware of some detail.

E.g.

zstyle :completion::complete:cd:: ignore-parents pwd


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-04-04 15:26                       ` Thorsten Haude
@ 2004-04-04 16:39                         ` Clint Adams
  2004-04-05  0:04                           ` Bart Schaefer
  0 siblings, 1 reply; 27+ messages in thread
From: Clint Adams @ 2004-04-04 16:39 UTC (permalink / raw)
  To: zsh-users

> I don't think #240624 is affected by the workaround. It still fires
> when inside the directory named by the variable.

This isn't specific to CDABLE_VARS; If you set cdpath=(..), for example,
it will offer to complete the current directory.

> I just send a mail for #240618, thanks for reminding me.

I'm going to retitle it to indicate that the problem occurs only when
CDABLE_VARS is set.

> BTW, what does 'pending' and your question "Wrong number?" mean?

That means I suspect that Alastair McKinstry typed the wrong number when
he marked that pending.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-04-04 15:14                     ` Clint Adams
@ 2004-04-04 15:26                       ` Thorsten Haude
  2004-04-04 16:39                         ` Clint Adams
  0 siblings, 1 reply; 27+ messages in thread
From: Thorsten Haude @ 2004-04-04 15:26 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 455 bytes --]

Hi,

* Clint Adams wrote (2004-04-04 17:14):
>> It does! Thank you very much!
>
>Please amend your two Debian bug reports accordingly.

I don't think #240624 is affected by the workaround. It still fires
when inside the directory named by the variable.


I just send a mail for #240618, thanks for reminding me.

BTW, what does 'pending' and your question "Wrong number?" mean?


Thorsten
-- 
Quidquid latine dictum sit, altum viditur.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-04-04 14:43                   ` Thorsten Haude
@ 2004-04-04 15:14                     ` Clint Adams
  2004-04-04 15:26                       ` Thorsten Haude
  0 siblings, 1 reply; 27+ messages in thread
From: Clint Adams @ 2004-04-04 15:14 UTC (permalink / raw)
  To: zsh-users

> It does! Thank you very much!

Please amend your two Debian bug reports accordingly.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-04-02 16:11                 ` Bart Schaefer
@ 2004-04-04 14:43                   ` Thorsten Haude
  2004-04-04 15:14                     ` Clint Adams
  0 siblings, 1 reply; 27+ messages in thread
From: Thorsten Haude @ 2004-04-04 14:43 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 718 bytes --]

Hi,

* Bart Schaefer wrote (2004-04-02 18:11):
>On Apr 2,  8:52am, Thorsten Haude wrote:
>> yooden@eumel % cd n
>> tags in context :completion::complete:cd::
>>     local-directories named-directories      (_alternative _cd) 
>>     users named-directories directory-stack  (_tilde _alternative _cd) 
>>     users                                    (_users _tilde _alternative _cd)
>> 
>> Well, there are users. How to remove them?
>
>zstyle ':completion::complete:cd::' tag-order '! users' -
>
>Should do it.

It does! Thank you very much!


Thorsten
-- 
There are two major products that come out of Berkeley: LSD and UNIX.
We don't believe this to be a coincidence.
    - Jeremy S. Anderson

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-04-02  6:52               ` Thorsten Haude
@ 2004-04-02 16:11                 ` Bart Schaefer
  2004-04-04 14:43                   ` Thorsten Haude
  0 siblings, 1 reply; 27+ messages in thread
From: Bart Schaefer @ 2004-04-02 16:11 UTC (permalink / raw)
  To: zsh-users

On Apr 2,  8:52am, Thorsten Haude wrote:
> 
> yooden@eumel % cd n
> tags in context :completion::complete:cd::
>     local-directories named-directories      (_alternative _cd) 
>     users named-directories directory-stack  (_tilde _alternative _cd) 
>     users                                    (_users _tilde _alternative _cd)
> 
> Well, there are users. How to remove them?

zstyle ':completion::complete:cd::' tag-order '! users' -

Should do it.  If you want it to complete users if and only if it can't
complete anything else, drop the trailing "-".  (Note that "users" won't
be removed from the <C-x h> output, but you should find that it doesn't
complete them any more.)

You might want to use ':completion:*:complete:cd:*' in case cd is used in
some other context, but that's "less specific" than the version without
the "*" for purposes of compsys selecting the most specific style.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-04-02  4:38             ` Bart Schaefer
@ 2004-04-02  6:52               ` Thorsten Haude
  2004-04-02 16:11                 ` Bart Schaefer
  0 siblings, 1 reply; 27+ messages in thread
From: Thorsten Haude @ 2004-04-02  6:52 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 894 bytes --]

Moin,

* Bart Schaefer wrote (2004-04-02 06:38):
>On Apr 1, 10:44pm, Thorsten Haude wrote:
>} 
>} yooden@eumel % cd n<tab>
>} nedit   news    nobody
>} 
>} The first is a named directory (good), the other two are users (bad).
>
>I wish you'd shown this example sooner.  It would have clarified a lot.

Sorry, I treid my best to explain the situation.


>What "tags in context" output do you get from
>
>yooden@eumel % cd n<C-x h>
>
>?? 

yooden@eumel % cd n
tags in context :completion::complete:cd::
    local-directories named-directories      (_alternative _cd) 
    users named-directories directory-stack  (_tilde _alternative _cd) 
    users                                    (_users _tilde _alternative _cd)

Well, there are users. How to remove them?


Thorsten
-- 
Most people would sooner die than think; in fact, they do so.
    - Bertrand Russell

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-04-01 20:44           ` Thorsten Haude
@ 2004-04-02  4:38             ` Bart Schaefer
  2004-04-02  6:52               ` Thorsten Haude
  0 siblings, 1 reply; 27+ messages in thread
From: Bart Schaefer @ 2004-04-02  4:38 UTC (permalink / raw)
  To: zsh-users

On Apr 1, 10:44pm, Thorsten Haude wrote:
} 
} yooden@eumel % cd n<tab>
} nedit   news    nobody
} 
} The first is a named directory (good), the other two are users (bad).

I wish you'd shown this example sooner.  It would have clarified a lot.

What "tags in context" output do you get from

yooden@eumel % cd n<C-x h>

?? 

I no longer think the _expand completer is involved.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-04-01 18:24     ` Bart Schaefer
@ 2004-04-01 20:52       ` Thorsten Haude
  0 siblings, 0 replies; 27+ messages in thread
From: Thorsten Haude @ 2004-04-01 20:52 UTC (permalink / raw)
  To: Zsh User ML

[-- Attachment #1: Type: text/plain, Size: 1042 bytes --]

Hi,

* Bart Schaefer wrote (2004-04-01 20:24):
>On Mar 31, 10:22pm, Thorsten Haude wrote:
>> * Bart Schaefer wrote (2004-03-28 21:56):
>> >You should see something like:
>> >
>> >    tags in context :completion::complete:-tilde-::
>> 
>> Well, something seems to be *very* wrong because I see this:
>> 
>> tags in context :completion::expand:::
>
>Aha!  You're using the _expand completer.

Do I?


>Various styles you can experiment with (you probably don't want to start
>with all of them at once):
>
>zstyle ':completion:*:expand:*' keep-prefix true
>zstyle ':completion:*:expand:*' accept-exact continue
>zstyle ':completion:*:expand:*' subst-globs-only true
>
>I find the accept-exact one to be the most useful.

Ok, I will try them out, read up a bit and come back if anything is
still unclear. Thank you for your help!


Thorsten
-- 
Sometimes it seems things go by too quickly. We are so busy watching out for
what's just ahead of us that we don't take the time to enjoy where we are.
    - Calvin

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-04-01 18:04         ` Bart Schaefer
@ 2004-04-01 20:44           ` Thorsten Haude
  2004-04-02  4:38             ` Bart Schaefer
  0 siblings, 1 reply; 27+ messages in thread
From: Thorsten Haude @ 2004-04-01 20:44 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 791 bytes --]

Moin,

* Bart Schaefer wrote (2004-04-01 20:04):
>I think we've got some communications crossed here.
>
>Do you mean that if you type "cd " (note trailing space) and then TAB, zsh
>lists user home directories?

Yep. Annoying as hell, even with only application user beside myself.
yooden@eumel % cd n<tab>
nedit   news    nobody

The first is a named directory (good), the other two are users (bad).


>The other Thorsten (this is becoming confusing :-) means that you should
>need to type "cd ~" (trailing tilde) and then TAB to get home directories
>completed.

That is understood, but not what I see on my box.



Thorsten
-- 
Man will occasionally stumble over the truth, but most
of the time he will pick himself up and continue on.
    - Winston Churchill 

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-03-31 20:22   ` Thorsten Haude
@ 2004-04-01 18:24     ` Bart Schaefer
  2004-04-01 20:52       ` Thorsten Haude
  0 siblings, 1 reply; 27+ messages in thread
From: Bart Schaefer @ 2004-04-01 18:24 UTC (permalink / raw)
  To: Zsh User ML

On Mar 31, 10:22pm, Thorsten Haude wrote:
> 
> * Bart Schaefer wrote (2004-03-28 21:56):
> >
> >    zsh% cd ~
> >
> >Now type ctrl+x and then h.
> 
> Ok, what are these? What to search for in the manual to read up on
> these things?

They're the contexts and tags used for setting completion styles.

"man zshcompsys" or the equivalent info doc pages.
 
> >You should see something like:
> >
> >    tags in context :completion::complete:-tilde-::
> 
> Well, something seems to be *very* wrong because I see this:
> 
> tags in context :completion::expand:::

Aha!  You're using the _expand completer.  That's where those home
directories are coming from.

Various styles you can experiment with (you probably don't want to start
with all of them at once):

zstyle ':completion:*:expand:*' keep-prefix true
zstyle ':completion:*:expand:*' accept-exact continue
zstyle ':completion:*:expand:*' subst-globs-only true

I find the accept-exact one to be the most useful.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-03-31 20:19       ` Thorsten Haude
@ 2004-04-01 18:04         ` Bart Schaefer
  2004-04-01 20:44           ` Thorsten Haude
  0 siblings, 1 reply; 27+ messages in thread
From: Bart Schaefer @ 2004-04-01 18:04 UTC (permalink / raw)
  To: zsh-users

[Thorsten Kampe wrote:]
> 
> >If you mean the completion of named directories I already told you
> >that zsh doesn't do that unless you explicitly type a "~".

On Mar 31, 10:19pm, Thorsten Haude wrote:
> 
> Well, it does on my system.

I think we've got some communications crossed here.

Do you mean that if you type "cd " (note trailing space) and then TAB, zsh
lists user home directories?

The other Thorsten (this is becoming confusing :-) means that you should
need to type "cd ~" (trailing tilde) and then TAB to get home directories
completed.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-03-28 19:56 ` Bart Schaefer
@ 2004-03-31 20:22   ` Thorsten Haude
  2004-04-01 18:24     ` Bart Schaefer
  0 siblings, 1 reply; 27+ messages in thread
From: Thorsten Haude @ 2004-03-31 20:22 UTC (permalink / raw)
  To: Zsh User ML

[-- Attachment #1: Type: text/plain, Size: 1652 bytes --]

Hi,

* Bart Schaefer wrote (2004-03-28 21:56):
>On Mar 28, 12:42pm, Thorsten Haude wrote:
>} one of the last upgrades of Zsh in Debian Sarge changed the way
>} directory names for cd are completed. With the current set of
>} functions, user's home directories are completed, which is a nuisance.
>[...]
>} 2. I would like to do the change in a way that does not interfere with
>} future updates from Debian's package management system. Any ideas?
>
>This should all be controllable by styles.
>
>Start by typing (where "zsh% " represents your prompt);
>
>    zsh% cd ~
>
>Now type ctrl+x and then h.

Ok, what are these? What to search for in the manual to read up on
these things?


>You should see something like:
>
>    tags in context :completion::complete:-tilde-::
>	users named-directories directory-stack  (_tilde) 
>	users                                    (_users _tilde)
>
>If instead you see
>
>    tags in context :completion::complete:cd::
>
>(followed by some list of tags), then something is wrong, because the
>"# Note we need a tilde because ..." code that you quoted should be
>effectively dead now -- it's there only as a failsafe and I can't find
>a way to force the _wanted call in that branch to be executed.  (Maybe
>Oliver or PWS can?)

Well, something seems to be *very* wrong because I see this:

tags in context :completion::expand:::
    all-expansions expansions original  (_expand)


>Assuming you've got the -tilde- context, (...)

Nope, sorry.


Thorsten
-- 
Fear leads to anger. Anger leads to hate. Hate leads to
using Windows for mission-critical applications.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-03-30  1:15     ` Thorsten Kampe
@ 2004-03-31 20:19       ` Thorsten Haude
  2004-04-01 18:04         ` Bart Schaefer
  0 siblings, 1 reply; 27+ messages in thread
From: Thorsten Haude @ 2004-03-31 20:19 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 998 bytes --]

Hi,

* Thorsten Kampe wrote (2004-03-30 03:15):
>* Thorsten Haude (2004-03-28 22:34 +0100)
>> Well, that's what I wanted to do. In this case, I wanted to rip out
>> home completion since I don't need it.
>
>Sorry, I have no idea what you mean by "home dir completion".

The completion of user's home directories. These look very much like
named directories, one is ~username, the other is ~whatever.


>If you mean the completion of named directories I already told you
>that zsh doesn't do that unless you explicitly type a "~".

Well, it does on my system.


>>>Have a look at the users' guide for "tag-order"...
>> 
>> Have done, but I couldn't make head or tails from it. What would I
>> have to do to remove home completion?
>
>zstyle ':completion:*:cd:*' tag-order !named-directories

Hm, this looks like it would affect named directories, something which
I don't want.


Thorsten
-- 
A: Top posters
Q: What's the most annoying thing about email these days?

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-03-28 20:34   ` Thorsten Haude
@ 2004-03-30  1:15     ` Thorsten Kampe
  2004-03-31 20:19       ` Thorsten Haude
  0 siblings, 1 reply; 27+ messages in thread
From: Thorsten Kampe @ 2004-03-30  1:15 UTC (permalink / raw)
  To: zsh-users

* Thorsten Haude (2004-03-28 22:34 +0100)
> * Thorsten Kampe wrote (2004-03-28 14:03):
>>* Thorsten Haude (2004-03-28 12:42 +0100)
>>> one of the last upgrades of Zsh in Debian Sarge changed the way
>>> directory names for cd are completed. With the current set of
>>> functions, user's home directories are completed, which is a nuisance.
>>> 
>>> I think I have found the file to change:
>>> /usr/share/zsh/4.1.1/functions/Completion/Zsh/_cd
>>> 
>>> Now, there are some problems:
>>> 1. I don't understand enough of the code to reliably remove user's
>>> home directories from completion. I could fall back to an older
>>> version of the file, but would loose completion of cdable vars.
>>> 
>>> The code in question is probably this part:
>>> [...]
>>> 
>>> How to rip out home dir completion without affecting cdable vars?
>>
>>Just don't "rip out" and modify the completion code. zsh isn't bash - 
>>use the possibility to modify the way zsh completes.
> 
> Well, that's what I wanted to do. In this case, I wanted to rip out
> home completion since I don't need it.

Sorry, I have no idea what you mean by "home dir completion". If you
mean the completion of named directories I already told you that zsh
doesn't do that unless you explicitly type a "~".

>>Have a look at the users' guide for "tag-order"...
> 
> Have done, but I couldn't make head or tails from it. What would I
> have to do to remove home completion?

zstyle ':completion:*:cd:*' tag-order !named-directories


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-03-28 12:03 ` Thorsten Kampe
@ 2004-03-28 20:34   ` Thorsten Haude
  2004-03-30  1:15     ` Thorsten Kampe
  0 siblings, 1 reply; 27+ messages in thread
From: Thorsten Haude @ 2004-03-28 20:34 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1514 bytes --]

Moin,

* Thorsten Kampe wrote (2004-03-28 14:03):
>* Thorsten Haude (2004-03-28 12:42 +0100)
>> one of the last upgrades of Zsh in Debian Sarge changed the way
>> directory names for cd are completed. With the current set of
>> functions, user's home directories are completed, which is a nuisance.
>> 
>> I think I have found the file to change:
>> /usr/share/zsh/4.1.1/functions/Completion/Zsh/_cd
>> 
>> Now, there are some problems:
>> 1. I don't understand enough of the code to reliably remove user's
>> home directories from completion. I could fall back to an older
>> version of the file, but would loose completion of cdable vars.
>> 
>> The code in question is probably this part:
>> [...]
>> 
>> How to rip out home dir completion without affecting cdable vars?
>
>Just don't "rip out" and modify the completion code. zsh isn't bash - 
>use the possibility to modify the way zsh completes.

Well, that's what I wanted to do. In this case, I wanted to rip out
home completion since I don't need it.


>Have a look at the users' guide for "tag-order"...

Have done, but I couldn't make head or tails from it. What would I
have to do to remove home completion?


Thorsten
-- 
I fear that Digital Rights Management today is Political Rights Management
tomorrow. That embedding these kinds of technological controls into the very
architecture of computing has the capacity to become a form of political
control in the not so distant future.
    -  John Perry Barlow

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-03-28 10:42 Thorsten Haude
  2004-03-28 12:03 ` Thorsten Kampe
@ 2004-03-28 19:56 ` Bart Schaefer
  2004-03-31 20:22   ` Thorsten Haude
  1 sibling, 1 reply; 27+ messages in thread
From: Bart Schaefer @ 2004-03-28 19:56 UTC (permalink / raw)
  To: Zsh User ML

On Mar 28, 12:42pm, Thorsten Haude wrote:
}
} one of the last upgrades of Zsh in Debian Sarge changed the way
} directory names for cd are completed. With the current set of
} functions, user's home directories are completed, which is a nuisance.
[...]
} 2. I would like to do the change in a way that does not interfere with
} future updates from Debian's package management system. Any ideas?

This should all be controllable by styles.

Start by typing (where "zsh% " represents your prompt);

    zsh% cd ~

Now type ctrl+x and then h.  You should see something like:

    tags in context :completion::complete:-tilde-::
	users named-directories directory-stack  (_tilde) 
	users                                    (_users _tilde)

If instead you see

    tags in context :completion::complete:cd::

(followed by some list of tags), then something is wrong, because the
"# Note we need a tilde because ..." code that you quoted should be
effectively dead now -- it's there only as a failsafe and I can't find
a way to force the _wanted call in that branch to be executed.  (Maybe
Oliver or PWS can?)

Assuming you've got the -tilde- context, you can just set the tag-order
style to omit the users tag:

    zstyle ':completion:*:complete:-tilde-:*' tag-order '! users'

Et voila.


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Completion for cd
  2004-03-28 10:42 Thorsten Haude
@ 2004-03-28 12:03 ` Thorsten Kampe
  2004-03-28 20:34   ` Thorsten Haude
  2004-03-28 19:56 ` Bart Schaefer
  1 sibling, 1 reply; 27+ messages in thread
From: Thorsten Kampe @ 2004-03-28 12:03 UTC (permalink / raw)
  To: zsh-users

* Thorsten Haude (2004-03-28 12:42 +0100)
> one of the last upgrades of Zsh in Debian Sarge changed the way
> directory names for cd are completed. With the current set of
> functions, user's home directories are completed, which is a nuisance.
> 
> I think I have found the file to change:
> /usr/share/zsh/4.1.1/functions/Completion/Zsh/_cd
> 
> Now, there are some problems:
> 1. I don't understand enough of the code to reliably remove user's
> home directories from completion. I could fall back to an older
> version of the file, but would loose completion of cdable vars.
> 
> The code in question is probably this part:
> [...]
> 
> How to rip out home dir completion without affecting cdable vars?

Just don't "rip out" and modify the completion code. zsh isn't bash - 
use the possibility to modify the way zsh completes. Completing named 
directories is already a change from the default behaviour because zsh 
completes by default only the directories in the current directory and 
the CDPATH.

Have a look at the users' guide for "tag-order"...

Thorsten
-- 
 Content-Type: text/explicit; charset=ISO-8859-666 (Parental Advisory)
 Content-Transfer-Warning: message contains innuendos not suited for
 children under the age of 18


^ permalink raw reply	[flat|nested] 27+ messages in thread

* Completion for cd
@ 2004-03-28 10:42 Thorsten Haude
  2004-03-28 12:03 ` Thorsten Kampe
  2004-03-28 19:56 ` Bart Schaefer
  0 siblings, 2 replies; 27+ messages in thread
From: Thorsten Haude @ 2004-03-28 10:42 UTC (permalink / raw)
  To: Zsh User ML

[-- Attachment #1: Type: text/plain, Size: 2016 bytes --]

Hi,

one of the last upgrades of Zsh in Debian Sarge changed the way
directory names for cd are completed. With the current set of
functions, user's home directories are completed, which is a nuisance.

I think I have found the file to change:
/usr/share/zsh/4.1.1/functions/Completion/Zsh/_cd

Now, there are some problems:
1. I don't understand enough of the code to reliably remove user's
home directories from completion. I could fall back to an older
version of the file, but would loose completion of cdable vars.

The code in question is probably this part:
- - - Schnipp - - -
    # With cdablevars, we can complete foo as if ~foo/
    if [[ -o cdablevars && -n "$PREFIX" && "$PREFIX" != <-> ]]; then
      if [[ "$PREFIX" != */* ]]; then
        alt=( "$alt[@]" 'named-directories: : _tilde' )
      else
        local oipre="$IPREFIX" opre="$PREFIX" dirpre dir

        # Note we need a tilde because cdablevars also allows user home
        # directories, hence nonomatch (above) to suppress error messages.

        dirpre="${PREFIX%%/*}/"
        IPREFIX="$IPREFIX$dirpre"
        eval "dir=( ~$dirpre )"
        PREFIX="${PREFIX#*/}"

        [[ $#dir -eq 1 && "$dir[1]" != "~$dirpre" ]] &&
          _wanted named-directories expl 'directory after cdablevar' \
              _path_files -W dir -/ && ret=0

        PREFIX="$opre"
        IPREFIX="$oipre"
      fi
    fi
- - - Schnapp - - -

How to rip out home dir completion without affecting cdable vars?


2. I would like to do the change in a way that does not interfere with
future updates from Debian's package management system. Any ideas?


I'm not sure whether the change in behavior is the idea of the Zsh
team or of the Debian maintainer. I reported this as a bug to Debian,
but if someone here is closer to the source he might want to revert
this change in Zsh itself.


tia,

Thorsten
-- 
Don't let your sense of morals prevent you from doing what is right.
    - Isaac Asimov

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2017-03-15 20:33 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-14 17:38 Completion for cd Jesper Nygårds
2017-03-14 19:07 ` Bart Schaefer
2017-03-14 21:50   ` Jesper Nygårds
2017-03-15  3:56     ` Bart Schaefer
2017-03-15  7:22       ` Jesper Nygårds
2017-03-15 17:00         ` Bart Schaefer
2017-03-15 20:33           ` Jesper Nygårds
  -- strict thread matches above, loose matches on Subject: below --
2004-03-28 10:42 Thorsten Haude
2004-03-28 12:03 ` Thorsten Kampe
2004-03-28 20:34   ` Thorsten Haude
2004-03-30  1:15     ` Thorsten Kampe
2004-03-31 20:19       ` Thorsten Haude
2004-04-01 18:04         ` Bart Schaefer
2004-04-01 20:44           ` Thorsten Haude
2004-04-02  4:38             ` Bart Schaefer
2004-04-02  6:52               ` Thorsten Haude
2004-04-02 16:11                 ` Bart Schaefer
2004-04-04 14:43                   ` Thorsten Haude
2004-04-04 15:14                     ` Clint Adams
2004-04-04 15:26                       ` Thorsten Haude
2004-04-04 16:39                         ` Clint Adams
2004-04-05  0:04                           ` Bart Schaefer
2004-04-05  3:50                             ` Clint Adams
2004-03-28 19:56 ` Bart Schaefer
2004-03-31 20:22   ` Thorsten Haude
2004-04-01 18:24     ` Bart Schaefer
2004-04-01 20:52       ` Thorsten Haude

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).