summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2000-07-24 20:32:56 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2000-07-24 20:32:56 +0000
commitb758c1072641d20671e3416391b8683c9e0c81aa (patch)
tree286d572b93364b01be33969c762de1e68c0737db /Completion
parent0e8c318b8ee07b6efd14293380cf9b82a862bace (diff)
downloadzsh-b758c1072641d20671e3416391b8683c9e0c81aa.tar.gz
zsh-b758c1072641d20671e3416391b8683c9e0c81aa.tar.xz
zsh-b758c1072641d20671e3416391b8683c9e0c81aa.zip
use mhpath and mhparams commands instead of guessing directories (12356)
Diffstat (limited to 'Completion')
-rw-r--r--Completion/User/_mh7
1 files changed, 2 insertions, 5 deletions
diff --git a/Completion/User/_mh b/Completion/User/_mh
index 29d6bc2a1..630ad11cf 100644
--- a/Completion/User/_mh
+++ b/Completion/User/_mh
@@ -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 @@ elif [[ "$prev" = -(form|audit|filter) ]]; then
   # 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 '*(.)'