Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: another file completion problem in 4.3.9-dev-2



On May 2, 12:09am, Greg Klanderman wrote:
}
} Here's another file completion problem in 4.3.9-dev-2:
} 
} | [~] greg@lwm| zsh -f     
} | lwm% echo $ZSH_VERSION
} | 4.3.9-dev-2
} | lwm% echo $ZSH_PATCHLEVEL
} | 1.4662
} | lwm% rm .zcompdump
} | lwm% autoload -U compinit
} | lwm% compinit -u
} | lwm% zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' '+ l:|=* r:|=*'
} | lwm% mkdir temp
} | lwm% cd temp
} | lwm% touch BarBaz
} 
} Now if I try to complete "ls baz", I get nothing.
} 
} But if I complete "ls az", it does correctly complete to "ls BarBaz".

Hmm.  The default completers only include _complete and _ignored.  In
order to get the behavior you want, I also have to allow corrections:

zstyle ':completion:*' completer _complete _ignored _approximate

"baz" is a mismatch in at least two dimensions, both position in the
word (not a prefix) and case.  I suspect the matcher list can adjust
for only one dimension at a time.

On the other hand, the following DOES seem to be a bug, so maybe it
is related somehow:

torch% autoload -U compinit
torch% compinit -D -u
torch% setopt no_case_glob
torch% ls -la    
total 88
drwx------   2 schaefer schaefer  4096 May  2 06:47 .
drwxrwxrwt  27 root     root     69632 May  2 07:15 ..
-rw-rw-r--   1 schaefer schaefer     0 May  2 06:47 BarBaz
torch% ls ba<TAB>

(no result).  Setting no_case_glob is supposed to cause file completion
to be applied case-insensitively even if there is no matcher-list, but
   compfiles -p tmp1 accex '' ' m:{a-zA-Z}={A-Za-z}' '' fake '*'
(line 409 in _path_files) doesn't return any matches in tmp1.

Sigh.  Some documentation (at least in comments) for the functions in
computils.c would really have been helpful.



Messages sorted by: Reverse Date, Date, Thread, Author