From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu (gatech.edu [130.207.244.244]) by werple.mira.net.au (8.6.12/8.6.9) with SMTP id OAA00344 for ; Sat, 15 Jul 1995 14:54:37 +1000 Received: from math (math.skiles.gatech.edu) by gatech.edu with SMTP id AA08124 (5.65c/Gatech-10.0-IDA for ); Sat, 15 Jul 1995 00:55:21 -0400 Received: by math (5.x/SMI-SVR4) id AA15451; Sat, 15 Jul 1995 00:51:57 -0400 Resent-Date: Sat, 15 Jul 1995 05:53:01 +0100 (BST) Old-Return-Path: From: Zefram Message-Id: <3541.199507150453@stone.dcs.warwick.ac.uk> Subject: Re: about beta11 To: zsh-workers@math.gatech.edu (Z Shell workers mailing list) Date: Sat, 15 Jul 1995 05:53:01 +0100 (BST) In-Reply-To: <9507150355.AA08946@redwood.skiles.gatech.edu> from "Richard Coleman" at Jul 14, 95 11:54:59 pm X-Loop: zefram@dcs.warwick.ac.uk X-Stardate: [-31]5981.01 Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-Id: <"Pak9l1.0.Ln3.ibq1m"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/209 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu -----BEGIN PGP SIGNED MESSAGE----- >One of the things I'm doing for beta11 is splitting the hash table >cmdnamtab into three separate tables for shell functions, builtins, >and external commands. This fixes some of the weird command name >space problems that would have been difficult to fix any other way. Does this mean that command completion, equals substitution and the hash builtin will all agree on whether a command exists? >1) enable/disable by default will only work on builtin functions >2) enable -f, disable -f will enable/disable shell functions >3) enable -r, disable -r will enable/disable reserved words Great. Atm, one can disable functions, but not reserved words or external commands (though they will be added to the disable list), but can't enable anything other than a builtin. It's all rather silly. >4) unhash by default will only unhash external commands. >5) unhash -f will remove shell functions. unfunction is now > just an alias for unhash -f. >6) unhash -a will remove aliases. unalias is now just an > alias for unhash -a. Neat. >Zefram, were you the one that wrote the code for named directories? Some of it, yes. hash/rehash -d is my code. >Is there anything preventing us from using a hash table for this >rather than a linked list (which is what it currently uses)? 'fraid so. The named directory table is sorted. (Actually, I'm pretty sure it's a big array, not a linked list, hence the occasional comment that calls it a hash table even though there's no real hashing involved.) It has to be sorted so that %~ in prompts gives the shortest possible name for the directory. That capability isn't used anywhere else, but unless you have a brilliant way to do that with a hash table then hash -d will have to stay as an exception. I think it might make the builtins a bit neater if hash/rehash -d, and unhash -d if it gets added (it should be), were handled by separate functions from the normal bin_{,re,un}hash. There would be a statement "if(ops['d']) return dir_hash(whatever)" at the beginning of each bin_*hash function, and the rest of the function would be the normal hash table stuff. It *might* also be good to merge bin_hash and bin_rehash, and have rehash merely as an alias to hash -r. It should be documented that way anyway. Speaking of builtin aliases, is "where" (whence -ca) going to appear at some point? I sent a one-line patch for it, and Zoltan's release has that patch plus documentation. It is genuinely useful to have a builtin that does a whence -a (I alias it). And has anyone considered adding the csh "glob" command, which would be something like "print -rN"? (Less useful, but it occurred to me as being appropriate. Does anyone use glob these days?) At this point I was going to request that the remaining disgusting bits of inconsistent ! quoting be fixed, as Zoltan's release contains a patch to make it just a normal character. That was certainly the case a few betas ago. But then I tested, just to make sure: % echo $ZSH_VERSION 2.6-beta10 % echo \\! ! % # Double escaping. Ugh. % zshz % echo $ZSH_VERSION 2.6-beta10-hzoli10.1 % echo \\! zsh: Oops. You discovered a bug in hungetc I'd love to see this quoting mess sorted out -- once Zoltan has the above problem sorted out. In any case, the man page that says that SQs will not quote !s is now wrong, thankfully. Finally, I remember there being a very simple (two line) patch that made AUTO_REMOVE_SLASH remove an automatically added slash if the next character typed is a slash, as well as if it's a newline. I think the consensus was in favour of it being used. (Its purpose is to stop a menu completion on a directory name and continue completion on pathnames under that directory, without having to add a character and then delete it again.) Could this be put into the next release? -zefram -----BEGIN PGP SIGNATURE----- Version: 2.6.i iQBVAgUBMAdJmWWJ8JfKi+e9AQE/YQH/c5iqTbPjMSspjJpEbNs5k2ISMQsPrqhC /xwa4454BkftZFxL4HBoBY7K2GrJ/l5J8zSX0SK024ja14NZJei/Sw== =d3Hs -----END PGP SIGNATURE-----