zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: PATCH: Improved _mailboxes
Date: Mon, 21 Feb 2000 17:25:15 +0000	[thread overview]
Message-ID: <1000221172516.ZM1448@candle.brasslantern.com> (raw)
In-Reply-To: <1000221164101.ZM21266@candle.brasslantern.com>

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 /<TAB>
	/home  /usr  /var
	zsh% mutt -f /<TAB>
	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//<TAB>
	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


  reply	other threads:[~2000-02-21 17:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-21 12:30 Sven Wischnowsky
2000-02-21 16:41 ` Bart Schaefer
2000-02-21 17:25   ` Bart Schaefer [this message]
2000-02-21 20:06   ` Peter Stephenson
2000-02-21 21:59     ` Bart Schaefer
2000-02-22  9:10 PATCH: " Sven Wischnowsky

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=1000221172516.ZM1448@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --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).