From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10444 invoked from network); 20 Sep 1999 23:58:20 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 20 Sep 1999 23:58:20 -0000 Received: (qmail 10551 invoked by alias); 20 Sep 1999 23:58:13 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7968 Received: (qmail 10543 invoked from network); 20 Sep 1999 23:58:09 -0000 From: "Bart Schaefer" Message-Id: <990920235800.ZM13135@candle.brasslantern.com> Date: Mon, 20 Sep 1999 23:58:00 +0000 In-Reply-To: <19990920124153.A21162@dman.com> Comments: In reply to Clint Adams "PATCH: _mailboxes" (Sep 20, 12:41pm) References: <19990920124153.A21162@dman.com> X-Mailer: Z-Mail Lite (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: _mailboxes MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 20, 12:41pm, Clint Adams wrote: > Subject: PATCH: _mailboxes > Because [[ -f "${~muttrc}" ]] never returns true (the expansion does not > occur when quoted), I changed it to test ${~muttrc} && [[ -f ${~muttrc} ]]. Oops. I still think the extra "test" is wasteful ... > Also, since the special folders ! < > are also used in elm, I added a > check for a ~/.elm directory. Perhaps it would be better to look for > an .elmrc. I can't think of a good way to do this. Running "strings =mutt" on a machine where it's installed indicates that it has some (undocumented?) support for a ~/.mutt/ directory as well. So ... Index: _mailboxes =================================================================== @@ -12,7 +12,7 @@ if (( ! $+_mailbox_cache )) then -test ${~muttrc} && [[ -f ${~muttrc} ]] && muttboxes=( ${$(grep mailboxes ${~muttrc})[2,-1]} ) +[[ -f ${~muttrc:-.} ]] && muttboxes=( ${$(grep mailboxes ${~muttrc})[2,-1]} ) mboxes=( ${~maildirectory}/*(^/) ${~pinedirectory}/**/*(.) ) dirboxes=( ${~maildirectory}/*(/) ) @@ -33,7 +33,7 @@ fi done -[[ -n "$muttboxes" ]] || [[ -d ~/.elm ]] && +[[ -n "$muttboxes" || -d ~/.elm || -d ~/.mutt ]] && _mailbox_cache=(\! \< \> $muttboxes) [[ -n "$mailpath" ]] && _mailbox_cache=($_mailbox_cache ${mailpath//\?*/})