From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19381 invoked from network); 27 Jun 2006 09:45:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 27 Jun 2006 09:45:25 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 77284 invoked from network); 27 Jun 2006 09:45:17 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 27 Jun 2006 09:45:17 -0000 Received: (qmail 21077 invoked by alias); 27 Jun 2006 09:45:09 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 10449 Received: (qmail 21068 invoked from network); 27 Jun 2006 09:45:08 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 27 Jun 2006 09:45:08 -0000 Received: (qmail 76185 invoked from network); 27 Jun 2006 09:45:08 -0000 Received: from parhelion.firedrake.org (193.201.200.77) by a.mx.sunsite.dk with SMTP; 27 Jun 2006 09:45:07 -0000 Received: from phil by parhelion.firedrake.org with local (Exim 4.50 #1 (Debian)) id 1FvA83-0005VU-6h for ; Tue, 27 Jun 2006 10:45:07 +0100 Date: Tue, 27 Jun 2006 11:45:07 +0200 From: Phil Pennock To: Zsh Users Subject: Re: mail paths and IMAP Message-ID: <20060627094507.GA19307@parhelion.globnix.org> Mail-Followup-To: Zsh Users References: <20060621112300.GA28907@parhelion.globnix.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060621112300.GA28907@parhelion.globnix.org> Sender: Phil Pennock On 2006-06-21 at 13:23 +0200, Phil Pennock wrote: > I'm having trouble twisting the new completion system to another of my > whims. I'd like to be able to tab-complete IMAP mail-folders. I have > GSSAPI authentication, so no password prompt is needed, and I have a > tool which will list all subscribed folders, one per line. I can make > this work interactively, but want to automate it. Could someone please > point me to which bit of the completion system I need to be using to do > this (preferably a snippet, if it's "just" configuration): Solved. The key is to keep the data from being overriden, which can be done by zstyle'ing muttrc to /nonexistant. ~/.zshrc contains (inter alia): -----------------------------< cut here >------------------------------- export IMAP_SERVER=host.example.net # ... function smutt { mutt "${(@)argv[1,-2]}" -f "+Shared Folders/shared/$argv[-1]" } function init_mua_completion { typeset -aU -g imap_folders _mutt_cache imap_folders=(${(@f):-"$(mailcheck -B -l 2>/dev/null)"}) zstyle ':completion:*' muttrc /nonexistant # override _mutt_cache zstyle ':completion:*' mail-directory imap://$IMAP_SERVER/ mailpath=(imap://$IMAP_SERVER/$imap_folders) # not used yet _mutt_cache=(+$imap_folders) compdef '_values ${${(M)imap_folders:#Shared Folders/shared/*}#Shared Folders/shared/}' smutt # 'mutt -f +' actually relative to $(mutt -Q folder) } klist -t && init_mua_completion -----------------------------< cut here >------------------------------- and I can choose my own method for calling init_mua_completion in the window which calls kinit. -- VISTA: Viruses, Infections, Spyware, Trojans & Adware