From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8144 invoked from network); 14 Feb 2000 17:21:43 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Feb 2000 17:21:43 -0000 Received: (qmail 19363 invoked by alias); 14 Feb 2000 17:21:38 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9726 Received: (qmail 19348 invoked from network); 14 Feb 2000 17:21:36 -0000 From: "Bart Schaefer" Message-Id: <1000214172110.ZM25955@candle.brasslantern.com> Date: Mon, 14 Feb 2000 17:21:10 +0000 In-Reply-To: <200002141156.MAA10295@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: completion but extra options allowed" (Feb 14, 12:56pm) References: <200002141156.MAA10295@beta.informatik.hu-berlin.de> <20000210153411.A27005@fruitcom.com> <1000210175857.ZM6927@candle.brasslantern.com> <20000210195143.A26109@br-online.de> <1000211175555.ZM32309@candle.brasslantern.com> <20000214150010.B17427@br-online.de> <20000214161129.B58230@caerdonn.eurocontrol.fr> In-Reply-To: <20000214150010.B17427@br-online.de> Comments: In reply to Andy Spiegl "Re: completion but extra options allowed" (Feb 14, 3:00pm) In-Reply-To: <20000214161129.B58230@caerdonn.eurocontrol.fr> Comments: In reply to Ollivier Robert "Completion for mutt" (Feb 14, 4:11pm) X-Mailer: Z-Mail (5.0.0 30July97) To: Andy Spiegl , Ollivier Robert , Sven Wischnowsky , zsh-workers@sunsite.auc.dk Subject: Re: Completion for mutt MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Feb 14, 12:56pm, Sven Wischnowsky wrote: } Subject: Re: completion but extra options allowed } } [ moved to zsh-workers ] } } Bart Schaefer wrote: } } > _mailboxes then calls "compadd -J -default- -J -default- - ..." which } > seems a bit odd. The first -J -default- is from "$@" and the second is } > of course "$expl[@]". Is that really doing the right thing? } } 3) Depending on the implementors preferences, he may or may not change } the '-f+:mailbox:_mailboxes' to '-f+:mailbox: _mailboxes', which will } make _arguments *not* give a description to _mailboxes (i.e., then you } only get the second one). 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. 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 ... } In another message: } } > compadd -i + -f -W ~/Mail } > } > directly does not accomplish what I expected it to. Is this a bug, or am } > I missing something? } } -i just *adds* some string to IPREFIX. It is really only useful when } used with -U Ah, of course. } > 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.) On Feb 14, 3:00pm, Andy Spiegl wrote: } Subject: Re: completion but extra options allowed } } > } And it doesn't expand local filenames either: } > } eule:~>cd Mail } > } eule:~/Mail>mutt -f a } > } > I think that's intentional on the grounds that files not in the mail } > directory are not likely to be mail files. It should probably be set } > by a style, if the 'mailbox' style won't already work. } I wasn't able to find anything about the mailbox-style in the docs. :-( } What can I set with it? My mistake, there isn't any mailbox style. There probably should be, implemented by _mailboxes. } > You don't need to edit _mailboxes, you just need } > set muttrc=~/.mutt/local } But of course that doesn't work for the aliases, which are in ~/.mutt/aliases. } Hm, while just looking at _mutt I see that mailaddresses are taken from } 'recipient:->userhost', which I don't understand. Where is that info } being set? Or in other words: how can I influence the list of addressees? The ->userhost means that it will call the _users completer until the current word contains an @, and then it will call the _hosts completer. The _users completer reads the list of user names from the *:users style, and the _hosts completer does the same for the *:hosts style. _mutt is currently not clever about completing mail aliases. On Feb 14, 4:11pm, Ollivier Robert wrote: } Subject: Completion for mutt } } When we switched from compctl to completion widgets, we lost something in } the Mutt frompltion. I used to be able to complete on '+' (which represents } ~/Mail generally) after a '-f'. Now it is trying to expand only full path } behind "-f"... The _mailboxes completion function is very rudimentary at this point. It tries to understand spool files, maildir boxes, MH folders, pine mail files, and mutt mail files, but it throws them all together into the same big cache of mailbox names and then supplies those as the completions. They really should be broken out by context (i.e. it's no use completing maildirs for pine, it won't read them), put into different completion groups, etc. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com