Subject: Re: umount /f/b<TAB> -> /foo/bar
From: Bart Schaefer <[email-masked]>
To: [email-masked]
Date: Fri, 19 Aug 2016 22:35:13 -0700
List-Id: Zsh Workers List <zsh-workers.zsh.org>

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.