zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _mh where path is not the default
@ 2000-07-24 19:28 Oliver Kiddle
  2000-07-24 20:59 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Kiddle @ 2000-07-24 19:28 UTC (permalink / raw)
  To: Zsh workers

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: _mh where path is not the default
  2000-07-24 19:28 PATCH: _mh where path is not the default Oliver Kiddle
@ 2000-07-24 20:59 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2000-07-24 20:59 UTC (permalink / raw)
  To: Zsh workers

Oliver Kiddle wrote:
> Are the completions written for nmh or mh? I'm using nmh so are there
> any problems I should expect?

They were written for mh, so you should expect completions for certain
functions to be missing, in particular mhcomp, mhlist etc.  As these take
standard MH arguments it should be simply a case of adding them to the list
of commands handled by _mh, but some sort of sanity checking should be done
if you do that.  I just tried by hand with `compdef _mh mhlist' and it
looked OK.

-- 
Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
Work: pws@CambridgeSiliconRadio.com
Web: http://www.pwstephenson.fsnet.co.uk


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-07-24 20:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-24 19:28 PATCH: _mh where path is not the default Oliver Kiddle
2000-07-24 20:59 ` Peter Stephenson

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).