From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9980 invoked from network); 24 Jul 2000 20:30:23 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 24 Jul 2000 20:30:23 -0000 Received: (qmail 29831 invoked by alias); 24 Jul 2000 20:30:05 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12356 Received: (qmail 29824 invoked from network); 24 Jul 2000 20:30:04 -0000 Sender: opk Message-ID: <397C98DE.173E587F@u.genie.co.uk> Date: Mon, 24 Jul 2000 20:28:30 +0100 From: Oliver Kiddle X-Mailer: Mozilla 4.73 [en] (X11; I; Linux 2.2.16 i586) X-Accept-Language: en MIME-Version: 1.0 To: Zsh workers Subject: PATCH: _mh where path is not the default Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 '*(.)'