From: Oliver Kiddle <opk@u.genie.co.uk>
To: Zsh workers <zsh-workers@sunsite.auc.dk>
Subject: PATCH: _mh where path is not the default
Date: Mon, 24 Jul 2000 20:28:30 +0100 [thread overview]
Message-ID: <397C98DE.173E587F@u.genie.co.uk> (raw)
I have my mh mail in a directory called mhmail because the default
(Mail) still contains all my real mail archives whch I still access with
mush. The problem with this was that the mh completions were then
completing mail folders from the wrong directory.
The patch modifies _mh to run mhpath + to get the correct directory. Is
anyone concerned about the affect this will have on speed? I'm happy to
back-out the patch if anyone objects. Another possibility would be to
cache the directory by storing it in a non-local variable.
Are the completions written for nmh or mh? I'm using nmh so are there
any problems I should expect? Also, has anyone written a zpty wrapper
around the whatnow command to do completion in a similar way to the
nslookup thing. I'd also appreciate any other cunning zsh scripts for mh
anyone has.
Thanks
Oliver
Index: Completion/User/_mh
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_mh,v
retrieving revision 1.4
diff -u -r1.4 _mh
--- Completion/User/_mh 2000/04/11 07:57:57 1.4
+++ Completion/User/_mh 2000/07/24 20:27:06
@@ -1,11 +1,8 @@
#compdef folder folders comp inc mark refile repl scan show next prev rmm pick whom mhn mhpath
# Completion for all possible MH commands.
-# Alter the following two to your own mh directory and the directory
-# where standard mh library files live. (It works anyway, but this
-# will save a little time.)
-local mymhdir=~/Mail
+local mymhdir=${$(mhpath + 2>/dev/null):-~/Mail}
local mhlib=/usr/lib/mh
local prev="$words[CURRENT-1]" expl
@@ -45,7 +42,7 @@
# or with the standard library.
local mhfpath
# This is the only place we need mhlib, so leave the test till here.
- [[ -d $mhlib ]] || { mhlib=$(mhparam mhlproc); mhlib=$mhlib:h; }
+ mhlib=${${$(mhparam mhlproc 2>/dev/null):h}:-/usr/lib/mh}
mhfpath=($mymhdir $mhlib)
_wanted files expl 'MH template file' _files -W mhfpath -g '*(.)'
next reply other threads:[~2000-07-24 20:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-07-24 19:28 Oliver Kiddle [this message]
2000-07-24 20:59 ` Peter Stephenson
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=397C98DE.173E587F@u.genie.co.uk \
--to=opk@u.genie.co.uk \
--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).