Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: _mh where path is not the default



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 '*(.)'



Messages sorted by: Reverse Date, Date, Thread, Author