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

Re: PATCH: MH for Mailboxes (TM)



Bart Schaefer wrote:

> On Mar 28, 12:55pm, Sven Wischnowsky wrote:
> } Subject: Re: PATCH: MH for Mailboxes (TM)
> }
> } > 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?
> 
> I still get the blank item in the list after your patch.  I think maybe
> the problem is that tmp1 gets an empty element at line 94, which then
> gets added as a match at line 120, but I tried duplicating your change
> at line 94 without any better result.

Hm.  After setting up some parameters I was able to reproduce it.  But 
for me changing lines 94 and 97 fixed it.  So I'll commit the patch
below anyway.

> Does `compadd -a array' where the array is empty have a bad effect?

No, that works nicely (having tried it with a simple test completion
function).


That _mailboxes function... there are some wrongly indented parts in
it.  And the `pinedirectory', `maildirectory' and `mailpath'
parameters don't seem to be documented.  Are these standard names?
(In particular, mailpath even isn't a local.)

Bye
 Sven

Index: Completion/Core/_multi_parts
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_multi_parts,v
retrieving revision 1.6
diff -u -r1.6 _multi_parts
--- Completion/Core/_multi_parts	2001/03/28 10:58:02	1.6
+++ Completion/Core/_multi_parts	2001/03/29 08:31:28
@@ -91,10 +91,10 @@
   else
     # No exact match, see how many strings match what's on the line.
 
-    builtin compadd -O tmp1 - "${(@)matches%%${sep}*}"
+    builtin compadd -O tmp1 - "${(@)${(@)matches%%${sep}*}:#}"
 
     [[ $#tmp1 -eq 0 && -n "$_comp_correct" ]] &&
-      compadd -O tmp1 - "${(@)matches%%${sep}*}"
+      compadd -O tmp1 - "${(@)${(@)matches%%${sep}*}:#}"
 
     if [[ $#tmp1 -eq 1 ]]; then
 

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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