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

Re: Something else wrong with _multi_parts



On Feb 21, 11:01am, Sven Wischnowsky wrote:
} Subject: Re: Something else wrong with _multi_parts
}
} Bart Schaefer wrote:
} 
} > 	names=( foo bar home/test /usr/tmp /tmp/foo )
} > 	_multi_parts / names
} > 
} > Only (/usr/tmp /tmp/foo) make it into the `matches' array in _multi_parts.
} 
} At one point while building this patch I got (with /<TAB>) the matches 
} `/' and `home'. Somehow, this is correct, but I think the behaviour
} this shows now is more intuitive.

Hmm, using the _mailboxes that I just sent, I get offered two matches at
this point:

zagzig[152] mail -f /usr<TAB>
/usr/
usr/

That certainly can't be right.  Looking at a fragment of an xtrace:

[...]

+_multi_parts:84> tmp1=( usr/mail/schaefer usr/spool/mail/schaefer ) 
+_multi_parts:89> ((  2  ))
+_multi_parts:90> npref=usr/ 
+_multi_parts:216> matches=( mail/schaefer spool/mail/schaefer ) 
+_multi_parts:217> pref=/usr/ 
+_multi_parts:221> [[ usr == */* ]]
+_multi_parts:224> [[  == */* ]]
+_multi_parts:233> PREFIX=/usr 
+_multi_parts:234> SUFFIX= 
+_multi_parts:236> [[ -n /usr/ && /usr != /usr/ ]]
+_multi_parts:237> compadd -J -default- -S  -M r:|/=* r:|=*  - /usr/
+_multi_parts:240> return

[...]

+_path_files:517> compadd -Qf -J all-files -F _comp_ignore -p / -W / -M r:|/=* r:|=* - usr

It appears that _multi_parts is compadding "/usr/" and _path_files is
compadding "usr".  I expected them both to "compadd ... usr".

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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