From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27519 invoked from network); 3 Mar 2006 11:57:36 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 3 Mar 2006 11:57:36 -0000 Received: (qmail 63576 invoked from network); 3 Mar 2006 11:57:28 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 3 Mar 2006 11:57:28 -0000 Received: (qmail 5295 invoked by alias); 3 Mar 2006 11:57:21 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9987 Received: (qmail 5286 invoked from network); 3 Mar 2006 11:57:20 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 3 Mar 2006 11:57:20 -0000 Received: (qmail 62548 invoked from network); 3 Mar 2006 11:57:20 -0000 Received: from cluster-d.mailcontrol.com (217.69.20.190) by a.mx.sunsite.dk with SMTP; 3 Mar 2006 11:57:18 -0000 Received: from exchange03.csr.com (uuk202166.uk.customer.alter.net [62.189.241.194] (may be forged)) by rly31d.srv.mailcontrol.com (MailControl) with ESMTP id k23BuPK0021227 for ; Fri, 3 Mar 2006 11:57:17 GMT Received: from csr.com ([10.103.143.38]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Fri, 3 Mar 2006 11:57:13 +0000 To: "zsh-users Mailinglist" Subject: Re: HASH_LIST_ALL does not work as expected In-reply-to: <6F0CB04509C11D46A54232E852E390ACF230C1@MCHP7R6A.ww002.siemens.net> References: <6F0CB04509C11D46A54232E852E390ACF230C1@MCHP7R6A.ww002.siemens.net> Comments: In-reply-to "Com MN PG P E B Consultant 3" message dated "Fri, 03 Mar 2006 09:41:19 +0100." Date: Fri, 03 Mar 2006 11:56:59 +0000 From: Peter Stephenson Message-ID: X-OriginalArrivalTime: 03 Mar 2006 11:57:13.0228 (UTC) FILETIME=[9BE97CC0:01C63EB9] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-06-00-05 (www.mailcontrol.com) on 10.68.0.141 "Com MN PG P E B Consultant 3" wrote: > I understood that due to HASH_LIST_ALL, whenever I try to complete a > command, the PATH is hashed for available commands first. HASH_LIST_ALL means that the path is fully hashed *the first time* you do completion, for efficiency. For the same efficiency reasons, it isn't rehashed automatically thereafter, which is the effect you are seeing. What you might want is always to complete commands by searching rather than by the hash table. I don't think that's currently supported. (The implementation detail is that we use the zsh/parameter module's special associative array commands to access the internal hash table.) Actually, it would be trivial to make the shell issue a rehash on each command search and nowadays (unlike the days when hashing of commands was really useful) it doesn't take that long, at least unless you have an NFS disk on a dial-up line from Ulaanbaatar. This could be a style... zstyle ":completion:*" rehash true will turn it on. Index: Completion/Zsh/Type/_command_names =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Type/_command_names,v retrieving revision 1.7 diff -u -r1.7 _command_names --- Completion/Zsh/Type/_command_names 1 May 2004 05:47:39 -0000 1.7 +++ Completion/Zsh/Type/_command_names 3 Mar 2006 11:50:36 -0000 @@ -6,6 +6,8 @@ local args defs +zstyle -t ":completion:${curcontext}:commands" rehash && rehash + defs=( 'commands:external command:compadd -k commands' ) Index: Doc/Zsh/compsys.yo =================================================================== RCS file: /cvsroot/zsh/zsh/Doc/Zsh/compsys.yo,v retrieving revision 1.183 diff -u -r1.183 compsys.yo --- Doc/Zsh/compsys.yo 28 Feb 2006 11:57:20 -0000 1.183 +++ Doc/Zsh/compsys.yo 3 Mar 2006 11:50:37 -0000 @@ -2101,6 +2101,14 @@ regular aliases will never be expanded. If it is set to `tt(always)', regular aliases will be expanded even if not in command position. ) +kindex(rehash, completion style) +item(tt(rehash))( +If this is set when completing external commands, the internal +list (hash) of commands will be updated for each search by issuing +the tt(rehash) command. There is a speed penalty for this which +is only likely to be noticeable when directories in the path have +slow file access. +) kindex(remote-access, completion style) item(tt(remote-access))( If set to tt(false), certain commands will be prevented from making -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php