From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@sunsite.dk>
Subject: PATCH: improve completion of mh sequences
Date: Thu, 19 May 2005 12:19:48 +0200 [thread overview]
Message-ID: <9906.1116497988@trentino.groupinfra.com> (raw)
_mh now handles the Sequence-Negation profile option. You may want to
use ignored-patterns to initially suppress these. I use the following
style which also supresses the message numbers:
zstyle ':completion::(^approximate*):*:sequences' ignored-patterns '(not*|<->)'
It also now copes with '-' for message ranges and `:' which allows the
number of messages to be limited.
I've also corrected the list of pre-defined message sequences. You may
want to use the fake style for the mark command if you have certain
favourite sequence names.
Oliver
Index: Completion/Unix/Command/_mh
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_mh,v
retrieving revision 1.5
diff -u -r1.5 _mh
--- Completion/Unix/Command/_mh 21 Jan 2004 13:53:29 -0000 1.5
+++ Completion/Unix/Command/_mh 19 May 2005 10:13:13 -0000
@@ -1,4 +1,4 @@
-#compdef ali burst dist flist flists folder folders forw comp inc mark refile repl scan show next prev packf rmf rmm pick whom mhn mhpath mhlist mhstore mhshow mhparam mhmail
+#compdef ali anno burst comp dist flist flists folder folders forw inc mark mhlist mhmail mhn mhparam mhpath mhshow mhstore msgchk next packf pick prev refile repl rmf rmm scan show sortm whom
# Completion for all possible MH commands.
local mymhdir=${$(_call_program mhpath mhpath + 2>/dev/null):-~/Mail}
@@ -61,9 +61,13 @@
${${(f)"$(mhparam -all)"}%%:*}
elif [[ $service = ali ]]; then
_email_addresses -n MH
+elif compset -P '*:'; then
+ _message -e number 'number of messages'
else
# Generate sequences.
- local foldnam folddir f ret
+ local foldnam folddir f sequences mhneg ret=1
+
+ compset -P '*-' # ignore start of message range
for f in $words; do
[[ $f = [@+]* ]] && foldnam=$f
@@ -77,13 +81,15 @@
# leaving foldnam empty works here
fi
+ sequences=( ${${(f)"$(mark $foldnam 2>/dev/null)"}%%:*} )
+ mhneg="$(mhparam Sequence-Negation)" && sequences=( {,$mhneg}$^sequences )
+ sequences+=( all first last prev next )
_tags sequences
while _tags; do
while _next_label sequences expl sequence; do
- compadd "$expl[@]" $(mark $foldnam 2>/dev/null | awk -F: '{ print $1 }') &&
- ret=0
- compadd "$expl[@]" reply next cur prev first last all unseen && ret=0
- _path_files "$expl[@]" -W folddir -g '<->(-.)' && ret=0
+ compadd -S ' ' -r '-: \t\n\-' "$expl[@]" -a sequences && ret=0
+ _path_files -S ' ' -r '-: \t\n\-' "$expl[@]" -W folddir -g '<->(-.)' &&
+ ret=0
done
(( ret )) || return 0
done
reply other threads:[~2005-05-19 10:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=9906.1116497988@trentino.groupinfra.com \
--to=okiddle@yahoo.co.uk \
--cc=zsh-workers@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).