From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20740 invoked from network); 21 Feb 2000 17:25:28 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Feb 2000 17:25:28 -0000 Received: (qmail 24889 invoked by alias); 21 Feb 2000 17:25:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9822 Received: (qmail 24880 invoked from network); 21 Feb 2000 17:25:20 -0000 From: "Bart Schaefer" Message-Id: <1000221172516.ZM1448@candle.brasslantern.com> Date: Mon, 21 Feb 2000 17:25:15 +0000 In-Reply-To: <1000221164101.ZM21266@candle.brasslantern.com> Comments: In reply to "Bart Schaefer" "Re: PATCH: Improved _mailboxes" (Feb 21, 4:41pm) References: <200002211230.NAA13030@beta.informatik.hu-berlin.de> <1000221164101.ZM21266@candle.brasslantern.com> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: PATCH: Re: PATCH: Improved _mailboxes MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Feb 21, 4:41pm, Bart Schaefer wrote: } Subject: Re: PATCH: Improved _mailboxes } } The problem is that mutt uses _maildir_cache, pine uses _mbox_cache, and } zmail uses _mh_cache. (Actually now that I think about it, pine can use } _mh_cache too.) This patch adds mush and tkrat, and lets pine complete mh mailboxes. There's one oddment left: When completing the full paths added by _multi_parts under menu completion, one gets things like zsh% mutt -f / /home /usr /var zsh% mutt -f / zsh% mutt -f /home/ Now hitting TAB just cycles /home /usr /var. But if I type a / to continue completing within /home, I get zsh% mutt -f /home// I tried adding -S/ -q to the _multi_parts call but the slash still does not become autoremovable. It does vanish when I next type TAB: zsh% mutt -f /home// zsh% mutt -f /home/schaefer/ This is with Sven's latest _multi_parts patch (9816). Index: Completion/User/_mailboxes =================================================================== RCS file: /extra/cvsroot/zsh/zsh-3.1/Completion/User/_mailboxes,v retrieving revision 1.10 diff -u -r1.10 _mailboxes --- _mailboxes 2000/02/21 16:30:58 1.10 +++ _mailboxes 2000/02/21 16:55:16 @@ -54,7 +54,7 @@ # Files for pine must be absolute paths. if [[ "$PREFIX" != (|-f)+* && - ( "${curcontext}" = *:(mail|zmail|zmlite):* || + ( "${curcontext}" = *:(mail|mush|zmail|zmlite):* || ( "${curcontext}" = *:pine:* && "$PREFIX" = (|-f)[/\~]* ) ) ]]; then _tags mailboxes files else @@ -78,19 +78,35 @@ if compset -P '+|-f+'; then mbox_names=( "${(@)_mbox_cache#$~maildirectory/}" ) else - mbox_names=( +"${(@)^_mbox_cache#$~maildirectory/}" "${_mailbox_cache[@]}" ) + mbox_names=( +"${(@)^_mbox_cache#$~maildirectory/}" + "${_mailbox_cache[@]}" ) fi ;; (*:mh:*) # I've probably got this wrong, or at least incomplete (( $#_mh_cache )) && _multi_parts "${expl[@]}" / _mh_cache ;; + (*:mush:*) + if compset -P '+|-f+'; then + mbox_names=( "${(@)_mbox_cache#$~maildirectory/}" ) + else + mbox_names=( +"${(@)^_mbox_cache#$~maildirectory/}" + "${_mailbox_cache[@]}" ) + mbox_short=( % \& ) + fi + ;; (*:mutt:*) - mbox_names=( "${_mutt_cache[@]}" "${_mailbox_cache[@]}" "${_maildir_cache[@]}" ) + mbox_names=( "${_mutt_cache[@]}" "${_mailbox_cache[@]}" + "${_maildir_cache[@]}" ) mbox_short=( \! \< \> );; (*:pine:*) # Pine is like mail but with no leading `+' to disambiguate; # any files not in $pinedirectory must be absolute paths. - mbox_names=( "${(@)_pine_cache#$~pinedirectory/}" "${_mbox_cache[@]}" ) + mbox_names=( "${(@)_pine_cache#$~pinedirectory/}" "${_mbox_cache[@]}" + "${_mailbox_cache[@]}" "${_mh_cache[@]}" ) + ;; + (*:tkrat:*) # Has a couple of custom formats I haven't programmed for. + mbox_names=( "${_mbox_cache[@]}" + "${_mailbox_cache[@]}" "${_mh_cache[@]}" ) ;; (*:(zmail|zmlite):*) if compset -P '+|-f+'; then -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com