From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28632 invoked from network); 22 Jun 2000 04:07:48 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 22 Jun 2000 04:07:48 -0000 Received: (qmail 1133 invoked by alias); 22 Jun 2000 04:07:43 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12027 Received: (qmail 1126 invoked from network); 22 Jun 2000 04:07:42 -0000 Date: Thu, 22 Jun 2000 00:07:38 -0400 From: Clint Adams To: Bart Schaefer Cc: Andy Spiegl , zsh-workers@sunsite.auc.dk Subject: PATCH: multiple mailbox lines in muttrc and more Message-ID: <20000622000738.C14101@scowler.net> References: <20000619211650.A5701@br-online.de> <20000620132829.K23705@br-online.de> <20000620100216.A5814@scowler.net> <20000620171801.C3224@br-online.de> <20000621095529.A27178@br-online.de> <1000621152106.ZM31139@candle.brasslantern.com> <20000621222749.A14101@scowler.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0.1i In-Reply-To: <20000621222749.A14101@scowler.net>; from schizo@debian.org on Wed, Jun 21, 2000 at 10:27:49PM -0400 > + _mutt_cache=( ${${(M)${(f)"$(<${~muttrc})"}:#mailboxes *}#mailboxes *} ) Oops, splitting problem. In other news, this seems to work for completion of mutt -f+ mutt -f= mutt -f + but not mutt -f \= Meaning mutt -f \= will complete the fake mailboxes I put into a fake muttrc to test this, but my ~/Mail/components file, for instance, which is happily completed by the other three forms, much to my annoyance. I'm sure that there are other problems with this that I've failed to notice. Index: Completion/User/_mailboxes =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/User/_mailboxes,v retrieving revision 1.3 diff -u -r1.3 _mailboxes --- Completion/User/_mailboxes 2000/06/22 02:37:45 1.3 +++ Completion/User/_mailboxes 2000/06/22 04:01:24 @@ -23,6 +23,12 @@ else _tags mailboxes files fi;; + (*:mutt:*) + if [[ "$PREFIX" == (|-f)[+=]* ]]; then + _tags mailboxes + else + _tags mailboxes files + fi;; (*:pine:*) # Files for pine must be absolute paths. if [[ "$PREFIX" == (|-f)[/\~]* ]]; then @@ -43,7 +49,7 @@ _requested mailboxes expl 'mailbox specification' _mua_mailboxes && ret=0 if _requested files expl 'mailbox file'; then - [[ "${curcontext}" != *:(mail|mush|zmail|zmlite):* ]] && + [[ "${curcontext}" != *:(mail|mush|mutt|zmail|zmlite):* ]] && compset -P -f _files "$expl[@]" && ret=0 fi @@ -65,7 +71,7 @@ [[ -f ${~muttrc:-.} ]] && - _mutt_cache=( ${${(M)${(f)"$(<${~muttrc})"}:#mailboxes *}#mailboxes *} ) + _mutt_cache=( ${=${(M)${(f)"$(<${~muttrc})"}:#mailboxes *}#mailboxes *} ) _mbox_cache=( ${~maildirectory}/*(^/) ) @@ -127,9 +133,16 @@ fi ;; (*:mutt:*) + if compset -P '='; then + mbox_names=( "${_mutt_cache[@]#[+=]}" "${(@)_mbox_cache#$~maildirectory/}" "${(@)_maildir_cache#$~maildirectory/}" "${(@)_mh_cache#$~maildirectory/}") + elif compset -P +; then + mbox_names=( "${_mutt_cache[@]#[+=]}" "${(@)_mbox_cache#$~maildirectory/}" "${(@)_maildir_cache#$~maildirectory/}" "${(@)_mh_cache#$~maildirectory/}") + else mbox_names=( "${_mutt_cache[@]}" "${_mailbox_cache[@]}" - "${_maildir_cache[@]}" ) - mbox_short=( \! \< \> );; + "${_maildir_cache[@]}" "${_mh_cache[@]}" ) + mbox_short=( \! \< \> ) + fi + ;; (*:pine:*) # Pine is like mail but with no leading `+' to disambiguate; # any files not in $pinedirectory must be absolute paths.