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

Re: PATCH 3/5: _imagemagick: complete all files if image files didn't match



On Wed, Aug 12, 2015 at 8:59 PM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Aug 12,  8:12pm, Mikael Magnusson wrote:
> } Subject: Re: PATCH 3/5: _imagemagick: complete all files if image files di
> }
> } > You might want to instead check your file-patterns styles to see what
> } > you've configured that broke this.
> }
> } You're right that it works in zsh -f, however, I don't have any
> } file-patterns styles set and it still doesn't work in my setup.
> }
> } This is the line that breaks the desired behaviour,
> } zstyle ':completion:*' list-dirs-first true
> }
> } Which I find to be somewhat unexpected.
>
> I'd swear a similar conversation went by on the list sometime in the
> past, but I can't find it now.
>
> } This seems to fix it, and brings the l-d-f case in line with the
> } default case below it.
>
> I don't know that I feel strongly about this one way or another, but
> according to http://www.zsh.org/mla/workers/2008/msg01119.html you are
> not supposed to get an all-files tag when using list-dirs-first.
> Instead you're always supposed to get "directories" and "other-files".
>
> So instead of
>
> pats=( " *(-/):directories:directories ${glob//:/\\:}:globbed-files" '*:all-files' )
>
> (which BTW had a stray line break in the patch you sent) it should be
> at most
>
> pats=( " *(-/):directories:directories ${glob//:/\\:}:globbed-files" '*(-^/):other-files' )

I just went to send a new patch with this change, and noticed that the
existing else case for */* does this (under list-dirs-first),

  elif [[ "$type" = */* ]] then
    pats=( '*(-/):directories ' '*:all-files ' )

should this not be other-files too? (It has been all-files since the
original 2008 patch).

-- 
Mikael Magnusson



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