From: Phil Pennock <phil.pennock@globnix.org>
To: Zsh Users <zsh-users@sunsite.dk>
Subject: Re: mail paths and IMAP
Date: Tue, 27 Jun 2006 11:45:07 +0200 [thread overview]
Message-ID: <20060627094507.GA19307@parhelion.globnix.org> (raw)
In-Reply-To: <20060621112300.GA28907@parhelion.globnix.org>
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 +<x>' 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
prev parent reply other threads:[~2006-06-27 9:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-21 11:23 Phil Pennock
2006-06-27 9:45 ` Phil Pennock [this message]
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=20060627094507.GA19307@parhelion.globnix.org \
--to=phil.pennock@globnix.org \
--cc=zsh-users@sunsite.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).