From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11310 invoked from network); 20 Sep 1999 16:42:09 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 20 Sep 1999 16:42:09 -0000 Received: (qmail 6148 invoked by alias); 20 Sep 1999 16:41:54 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7961 Received: (qmail 6140 invoked from network); 20 Sep 1999 16:41:54 -0000 Date: Mon, 20 Sep 1999 12:41:53 -0400 From: Clint Adams To: zsh-workers@sunsite.auc.dk Subject: PATCH: _mailboxes Message-ID: <19990920124153.A21162@dman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0pre2i Because [[ -f "${~muttrc}" ]] never returns true (the expansion does not occur when quoted), I changed it to test ${~muttrc} && [[ -f ${~muttrc} ]]. 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. Also, the check for muttboxes should probably be replaced by a check for a muttrc, since it is possible that a user will have a muttrc without specifying mailboxes but impossible to specify mailboxes without a muttrc (I hope), though I would guess that a substantial chunk of users have neither. Finally, I included $mailpath, since it seems like a good place to find mailboxes that a user cares about. This reminds me that the mailcheck functionality is still not comprehensive. I wonder if it would be beneficial for the mailbox detection we're using in _mailboxes to be moved elsewhere and used by both the completion system and checkmailpath. *** Completion/User/_mailboxes.old Mon Sep 20 05:06:27 1999 --- Completion/User/_mailboxes Mon Sep 20 12:25:10 1999 *************** *** 12,18 **** if (( ! $+_mailbox_cache )) then ! [[ -f "${~muttrc}" ]] && muttboxes=( ${$(grep mailboxes ${~muttrc})[2,-1]} ) mboxes=( ${~maildirectory}/*(^/) ${~pinedirectory}/**/*(.) ) dirboxes=( ${~maildirectory}/*(/) ) --- 12,18 ---- if (( ! $+_mailbox_cache )) then ! test ${~muttrc} && [[ -f ${~muttrc} ]] && muttboxes=( ${$(grep mailboxes ${~muttrc})[2,-1]} ) mboxes=( ${~maildirectory}/*(^/) ${~pinedirectory}/**/*(.) ) dirboxes=( ${~maildirectory}/*(/) ) *************** *** 33,40 **** fi done ! [[ -n "$muttboxes" ]] && _mailbox_cache=(\! \< \> $muttboxes) _mailbox_cache=($_mailbox_cache $mboxes $maildirboxes $MHboxes) fi --- 33,43 ---- fi done ! [[ -n "$muttboxes" ]] || [[ -d ~/.elm ]] && _mailbox_cache=(\! \< \> $muttboxes) + [[ -n "$mailpath" ]] && + _mailbox_cache=($_mailbox_cache ${mailpath//\?*/}) + _mailbox_cache=($_mailbox_cache $mboxes $maildirboxes $MHboxes) fi