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

Re: PATCH: MH for Mailboxes (TM)



Bart Schaefer wrote:

> On Mar 26, 10:34am, Sven Wischnowsky wrote:
> } 
> } Bart Schaefer wrote:
> } 
> } > By the way (Sven), when I complete after "mutt -f " (with no prefix in
> } > the current word) I -still- get a blank item as the first menu-selection.
> } > I thought we fixed that bug a long time ago?
> } 
> } Yes, sounds very familiar.  I don't remember exactly and since I don't 
> } use anything I could complete with _mailboxes I can't easily try, but
> } normally that's because one of the expansions leaves an empty element
> } in an array.
> 
> I've looked through _complete_debug output and not managed to find any
> cases where `compadd' is called with an array containing an empty element.
> 
> However, at _multi_parts line 164-166, the expression
> 
> 	"${(@)${(@M)matches:#*${sep}}%%${sep}*}"
> 
> expands to the empty string.  Could that be the source of the problem?

Yes, that may be.  Even if it doesn't fix this particular problem, the 
patch below should only make things saver.

Can someone try?


Bye
 Sven

Index: Completion/Core/_multi_parts
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_multi_parts,v
retrieving revision 1.5
diff -u -r1.5 _multi_parts
--- Completion/Core/_multi_parts	2001/02/09 14:01:58	1.5
+++ Completion/Core/_multi_parts	2001/03/28 10:53:10
@@ -163,14 +163,14 @@
 
         compadd "$group[@]" "$expl[@]" -r "$sep" -S "$sep" "$opts[@]" \
 	        -p "$pref" "$tmp2[@]" -M "r:|${sep}=* r:|=* $matcher" - \
-                "${(@)${(@M)matches:#*${sep}}%%${sep}*}" && ret=0
+                "${(@)${(@)${(@M)matches:#*${sep}}%%${sep}*}:#}" && ret=0
         (( $matches[(I)${sep}*] )) &&
             compadd "$group[@]" "$expl[@]" -S '' "$opts[@]" \
 	            -p "$pref" \
                     -M "r:|${sep}=* r:|=* $matcher" - "$sep" && ret=0
         compadd "$group[@]" "$expl[@]" -r "$sep" -S "$sep" "$opts[@]" \
                 -p "$pref" "$tmp2[@]" -M "r:|${sep}=* r:|=* $matcher" - \
-                "${(@)${(@M)matches:#*?${sep}?*}%%${sep}*}" && ret=0
+                "${(@)${(@)${(@M)matches:#*?${sep}?*}%%${sep}*}:#}" && ret=0
         compadd "$group[@]" "$expl[@]" -S '' "$opts[@]" -p "$pref" "$tmp2[@]" \
                 -M "r:|${sep}=* r:|=* $matcher" - \
                 "${(@)matches:#*${sep}*}" && ret=0
@@ -182,7 +182,7 @@
         compadd "$group[@]" "$expl[@]" "$opts[@]" \
 	        -p "$pref" -s "${i#*${sep}}" \
                 -M "r:|${sep}=* r:|=* $matcher" - \
-                "${(@)${(@M)matches:#*${sep}*}%%${sep}*}" && ret=0
+                "${(@)${(@)${(@M)matches:#*${sep}*}%%${sep}*}:#}" && ret=0
         compadd "$group[@]" "$expl[@]" -S '' "$opts[@]" -p "$pref" \
                 -M "r:|${sep}=* r:|=* $matcher" - \
                 "${(@)matches:#*${sep}*}" && ret=0

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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