From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7769 invoked from network); 28 Mar 2004 10:46:59 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 28 Mar 2004 10:46:59 -0000 Received: (qmail 19216 invoked by alias); 28 Mar 2004 10:46:36 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7275 Received: (qmail 19188 invoked from network); 28 Mar 2004 10:46:35 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 28 Mar 2004 10:46:35 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [130.225.247.86] by sunsite.dk (MessageWall 1.0.8) with SMTP; 28 Mar 2004 10:46:34 -0000 Received: (qmail 31079 invoked from network); 28 Mar 2004 10:46:34 -0000 Received: from natsmtp00.rzone.de (HELO natsmtp00.webmailer.de) (81.169.145.165) by a.mx.sunsite.dk with SMTP; 28 Mar 2004 10:46:32 -0000 Received: from eumel.yoo.local (pD9E09BE8.dip.t-dialin.net [217.224.155.232]) by post.webmailer.de (8.12.10/8.12.10) with ESMTP id i2SAkU9l014859 for ; Sun, 28 Mar 2004 12:46:31 +0200 (MEST) Received: by eumel.yoo.local (Postfix, from userid 1000) id 197004808A; Sun, 28 Mar 2004 12:42:22 +0200 (CEST) Date: Sun, 28 Mar 2004 12:42:22 +0200 From: Thorsten Haude To: Zsh User ML Subject: Completion for cd Message-ID: <20040328104221.GA2642@eumel.yoo.net> Mail-Followup-To: Zsh User ML Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="G4iJoqBmSsgzjUCe" Content-Disposition: inline X-Warning: Email may contain unsmilyfied humor and/or satire. Keywords: Haschisch, Marihuana, Kokain, Heroin, LSD und Extacy sind alles Drogen Organization: Ministry of Information, Department of Information Dispersal User-Agent: Mutt/1.5.5.1i cd.edit_threads cd.trash_folder X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: * X-Spam-Status: No, hits=1.6 required=6.0 tests=RCVD_IN_NJABL,RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: 1.6 --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, one of the last upgrades of Zsh in Debian Sarge changed the way directory names for cd are completed. With the current set of functions, user's home directories are completed, which is a nuisance. I think I have found the file to change: /usr/share/zsh/4.1.1/functions/Completion/Zsh/_cd Now, there are some problems: 1. I don't understand enough of the code to reliably remove user's home directories from completion. I could fall back to an older version of the file, but would loose completion of cdable vars. The code in question is probably this part: - - - Schnipp - - - # With cdablevars, we can complete foo as if ~foo/ if [[ -o cdablevars && -n "$PREFIX" && "$PREFIX" !=3D <-> ]]; then if [[ "$PREFIX" !=3D */* ]]; then alt=3D( "$alt[@]" 'named-directories: : _tilde' ) else local oipre=3D"$IPREFIX" opre=3D"$PREFIX" dirpre dir # Note we need a tilde because cdablevars also allows user home # directories, hence nonomatch (above) to suppress error messages. dirpre=3D"${PREFIX%%/*}/" IPREFIX=3D"$IPREFIX$dirpre" eval "dir=3D( ~$dirpre )" PREFIX=3D"${PREFIX#*/}" [[ $#dir -eq 1 && "$dir[1]" !=3D "~$dirpre" ]] && _wanted named-directories expl 'directory after cdablevar' \ _path_files -W dir -/ && ret=3D0 PREFIX=3D"$opre" IPREFIX=3D"$oipre" fi fi - - - Schnapp - - - How to rip out home dir completion without affecting cdable vars? 2. I would like to do the change in a way that does not interfere with future updates from Debian's package management system. Any ideas? I'm not sure whether the change in behavior is the idea of the Zsh team or of the Debian maintainer. I reported this as a bug to Debian, but if someone here is closer to the source he might want to revert this change in Zsh itself. tia, Thorsten --=20 Don't let your sense of morals prevent you from doing what is right. - Isaac Asimov --G4iJoqBmSsgzjUCe Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAZqwNW/x2JEBlodoRAgc9AKCGXQgaQP/ZzVU6BcrtdmIq9kxufACg2oQD BxWymPMfQh5RORq6uzCAJPg= =R1mV -----END PGP SIGNATURE----- --G4iJoqBmSsgzjUCe--