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

Re: umount /f/b<TAB> -> /foo/bar



Bart Schaefer wrote on Fri, Aug 19, 2016 at 22:35:13 -0700:
> On Aug 19,  3:56pm, Daniel Shahaf wrote:
> }
> } +    # This codepath honours any -M matchspec parameters.
> } +    () {
> } +      local -a tmp_buffer
> } +      compadd -A tmp_buffer "$__gopts[@]" -a files
> } +      matches+=( "${(@)tmp_buffer/$canpref/$origpref}" )
> } +    }
> } +  else
> } +    # ### Ideally, this codepath would do what the 'if' above does,
> } +    # ### but telling compadd to pretend the "word on the command line"
> } +    # ### is ${"the word on the command line"/$origpref/$canpref}.
> } +    matches+=(${${(M)files:#$canpref*}/$canpref/$origpref})
> } +  fi
> 
> Perhaps some variation on
> 
>     compadd -M "B:${(b)origpref}=${(b)canpref}" -a files
> 
> ??  Some cases of mount point names containing unusual characters might
> be a little weird.

I couldn't get that to work.  Neither did assigning to words[CURRENT].

I'm tempted to push the patch as is, though, since it adds matchspecs
honouring to one use-case and doesn't break others.

Thanks,

Daniel



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