From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17374 invoked from network); 15 Feb 2000 09:34:05 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 15 Feb 2000 09:34:05 -0000 Received: (qmail 13115 invoked by alias); 15 Feb 2000 09:33:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9734 Received: (qmail 13107 invoked from network); 15 Feb 2000 09:33:58 -0000 Date: Tue, 15 Feb 2000 10:33:57 +0100 (MET) Message-Id: <200002150933.KAA12184@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Bart Schaefer"'s message of Mon, 14 Feb 2000 17:21:10 +0000 Subject: Re: Completion for mutt (with PATCH) Bart Schaefer wrote: > I guess the question is not whether it's right for _mutt to pass the > first -J to _mailboxes, but whether it's right for _mailboxes to pass > both -J along to compadd, given that it doesn't generate anything that > will ever be put in the first group. Remember: for most options, compadd uses the first occurrence if they are given more than once (the exception is -M -- all of them are used). In other words: the arguments given to _mailboxes override the defaults it builds itself. > On the other hand, _mailboxes doesn't know what else may be in "$@" so > it can't just ignore it entirely ... or can it? _files appears to ... Not really. _files parses its arguments and takes all interesting options to give it to _path_files. Some time ago it just did the same as _mailboxes, but with the appearence of tags _files had to learn to modify or ignore some of the things it got (e.g. a -g option). > ... > > } > What IS the compadd equivalent of > } > compctl -x 's[+] c[-1,-f],s[-f+]' -W ~/Mail -f ... > } > } So, the right way to do the same as that compctl would be: > } > } if compset -P '+|-f+' || [[ $words[CURRENT-1] = -f ]]; then > } _files -W ~/Mail > } else > } ... > } fi > > OK ... now a slightly different question: In _mailboxes, we already > have a list of all the mailboxes in ~/Mail. How do I get the equivalent > of "_files -W ~/Mail" with that already-generated list as the starting > point? (Because ~/Mail may contain maildir or MH directories, it's > not sufficient to simply complete files as _files does.) First, I would get rid of the (expansion of) ~/Mail at the beginning of all the strings in the cache. And then just use _multi_parts like _tar does. (I haven't really looked at how the cache looks like because I use a self-written mail reader, but I guess it just contains filenames and stuff, right?) Some doc fixes. Bye Sven diff -ru ../z.old/Doc/Zsh/compwid.yo Doc/Zsh/compwid.yo --- ../z.old/Doc/Zsh/compwid.yo Tue Feb 15 10:04:06 2000 +++ Doc/Zsh/compwid.yo Tue Feb 15 10:25:04 2000 @@ -548,7 +548,7 @@ item(tt(-M) var(match-spec))( This gives local match specifications as described below in noderef(Matching Control). This option may be given more than once. In -this case all var(match-spec)s given are contaneted with speces +this case all var(match-spec)s given are concatenated with spaces between them to form the specification string to use. Note that they will only be used if the tt(-U) option is not given. ) @@ -589,6 +589,9 @@ hyphens. ) enditem() + +Except for the tt(-M) flag, if any of these flags is given more than +once, the first one (and its argument) will be used. ) findex(compset) cindex(completion widgets, modifying special parameters) -- Sven Wischnowsky wischnow@informatik.hu-berlin.de