zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <schizo@debian.org>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: _mailboxes
Date: Mon, 20 Sep 1999 12:41:53 -0400	[thread overview]
Message-ID: <19990920124153.A21162@dman.com> (raw)

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


             reply	other threads:[~1999-09-20 16:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-20 16:41 Clint Adams [this message]
1999-09-20 23:58 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19990920124153.A21162@dman.com \
    --to=schizo@debian.org \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).