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

Re: Dynamic named directories and completion



On 2/24/18 3:12 PM, Peter Stephenson wrote:
On Sat, 24 Feb 2018 20:49:14 +0100
Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
I have some patches I was working on related to this, but I assume
there was still some problem, or I would have committed them...
There's two patches in this thread,
http://www.zsh.org/mla/workers/2015/msg01439.html and then I think I
never sent the third one,

This is all quite complicated so I can well believe it's useful; I don't
think it fixes the behaviour I was seeing (but I may be getting
confused).

On the same theme, I think the following is useful for those of us
using the _expand completer, which may well have nothing whatsoever to
do with the original problem.

pws

diff --git a/Completion/Base/Completer/_expand b/Completion/Base/Completer/_expand
index a6e30e8..ee3681b 100644
--- a/Completion/Base/Completer/_expand
+++ b/Completion/Base/Completer/_expand
@@ -43,7 +43,8 @@ zstyle -s ":completion:${curcontext}:" accept-exact tmp ||
if [[ "$tmp" != (yes|true|on|1) ]]; then
    { [[ "$word" = \~(|[-+]) ||
-       ( "$word" = \~[-+][1-9]## && $word[3,-1] -le $#dirstack ) ]] && return 1 }
+	   ( "$word" = \~[-+][1-9]## && $word[3,-1] -le $#dirstack ) ||
+     $word = \~\[*\]/* ]] && return 1 }
    { [[ ( "$word" = \~* && ${#userdirs[(I)${word[2,-1]}*]}+${#nameddirs[(I)${word[2,-1]}*]} -gt 1 ) ||
         ( "$word" = *\$[a-zA-Z0-9_]## &&
           ${#parameters[(I)${word##*\$}*]} -ne 1 ) ]] && continue=1 }


Just this patch does not fix the completion issue (I even upgraded to 5.4.2
just to be sure).  Since M-x complete-word does work, I may try looking at
expand-or-complete to see if I can figure out what is happening.  I'm no
zsh expert though, so I will likely need help not breaking something else.



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