zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <schizo@debian.org>
To: Bart Schaefer <schaefer@candle.brasslantern.com>
Cc: Andy Spiegl <zsh.Andy@spiegl.de>, zsh-workers@sunsite.auc.dk
Subject: PATCH: multiple mailbox lines in muttrc and more
Date: Thu, 22 Jun 2000 00:07:38 -0400	[thread overview]
Message-ID: <20000622000738.C14101@scowler.net> (raw)
In-Reply-To: <20000621222749.A14101@scowler.net>; from schizo@debian.org on Wed, Jun 21, 2000 at 10:27:49PM -0400

> +    _mutt_cache=( ${${(M)${(f)"$(<${~muttrc})"}:#mailboxes *}#mailboxes *} )

Oops, splitting problem.

In other news, this seems to work for completion of

mutt -f+
mutt -f=
mutt -f +

but not

mutt -f \=


Meaning mutt -f \=<TAB> will complete the fake mailboxes I put into a fake
muttrc to test this, but my ~/Mail/components file, for instance, which
is happily completed by the other three forms, much to my annoyance.

I'm sure that there are other problems with this that I've failed to notice.

Index: Completion/User/_mailboxes
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_mailboxes,v
retrieving revision 1.3
diff -u -r1.3 _mailboxes
--- Completion/User/_mailboxes	2000/06/22 02:37:45	1.3
+++ Completion/User/_mailboxes	2000/06/22 04:01:24
@@ -23,6 +23,12 @@
       else
         _tags mailboxes files
       fi;;
+    (*:mutt:*)
+      if [[ "$PREFIX" == (|-f)[+=]* ]]; then
+	_tags mailboxes
+      else
+        _tags mailboxes files
+      fi;;
     (*:pine:*)
       # Files for pine must be absolute paths.
       if [[ "$PREFIX" == (|-f)[/\~]* ]]; then
@@ -43,7 +49,7 @@
     _requested mailboxes expl 'mailbox specification' _mua_mailboxes && ret=0
 
     if _requested files expl 'mailbox file'; then
-      [[ "${curcontext}" != *:(mail|mush|zmail|zmlite):* ]] &&
+      [[ "${curcontext}" != *:(mail|mush|mutt|zmail|zmlite):* ]] &&
 	compset -P -f
       _files "$expl[@]" && ret=0
     fi
@@ -65,7 +71,7 @@
 
 
   [[ -f ${~muttrc:-.} ]] &&
-    _mutt_cache=( ${${(M)${(f)"$(<${~muttrc})"}:#mailboxes *}#mailboxes *} )
+    _mutt_cache=( ${=${(M)${(f)"$(<${~muttrc})"}:#mailboxes *}#mailboxes *} )
 
 
   _mbox_cache=( ${~maildirectory}/*(^/) )
@@ -127,9 +133,16 @@
       fi
       ;;
     (*:mutt:*)
+      if compset -P '='; then
+        mbox_names=( "${_mutt_cache[@]#[+=]}" "${(@)_mbox_cache#$~maildirectory/}" "${(@)_maildir_cache#$~maildirectory/}" "${(@)_mh_cache#$~maildirectory/}")
+      elif compset -P +; then
+        mbox_names=( "${_mutt_cache[@]#[+=]}" "${(@)_mbox_cache#$~maildirectory/}" "${(@)_maildir_cache#$~maildirectory/}" "${(@)_mh_cache#$~maildirectory/}")
+      else
       mbox_names=( "${_mutt_cache[@]}" "${_mailbox_cache[@]}"
-		   "${_maildir_cache[@]}" )
-      mbox_short=( \! \< \> );;
+		   "${_maildir_cache[@]}" "${_mh_cache[@]}" )
+      mbox_short=( \! \< \> )
+      fi
+      ;;
     (*:pine:*)
       # Pine is like mail but with no leading `+' to disambiguate;
       # any files not in $pinedirectory must be absolute paths.


  reply	other threads:[~2000-06-22  4:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20000619211650.A5701@br-online.de>
2000-06-19 20:18 ` bug in _mutt ? Bart Schaefer
2000-06-20 11:28   ` Andy Spiegl
2000-06-20 11:53     ` Peter Stephenson
2000-06-20 13:33       ` Bart Schaefer
2000-06-21 15:24       ` Bart Schaefer
2000-06-22  1:56         ` Clint Adams
2000-06-22  3:55         ` Geoff Wing
2000-06-22  3:59           ` Clint Adams
2000-06-20 14:02     ` Clint Adams
2000-06-20 15:18       ` Andy Spiegl
2000-06-21  7:55         ` Andy Spiegl
2000-06-21 15:21           ` Bart Schaefer
2000-06-21 15:30             ` Bart Schaefer
2000-06-22  1:50             ` Clint Adams
2000-06-22  2:27             ` PATCH: multiple mailbox lines in muttrc Clint Adams
2000-06-22  4:07               ` Clint Adams [this message]
2000-06-26 19:43             ` bug in _mutt ? Andy Spiegl
2000-06-27  0:51               ` 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=20000622000738.C14101@scowler.net \
    --to=schizo@debian.org \
    --cc=schaefer@candle.brasslantern.com \
    --cc=zsh-workers@sunsite.auc.dk \
    --cc=zsh.Andy@spiegl.de \
    /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).