From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10956 invoked from network); 16 May 2000 11:23:15 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 16 May 2000 11:23:15 -0000 Received: (qmail 20214 invoked by alias); 16 May 2000 11:22:59 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 11407 Received: (qmail 20204 invoked from network); 16 May 2000 11:22:59 -0000 Date: Tue, 16 May 2000 13:22:39 +0200 (MET DST) Message-Id: <200005161122.NAA27048@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: Tanaka Akira's message of 16 May 2000 08:15:43 +0900 Subject: PATCH: Re: ~user completion in single quotes. Tanaka Akira wrote: > Z(4):akr@serein% Src/zsh -f > serein% bindkey -e; autoload -U compinit; compinit -D > serein% echo '~ro > -> > serein% echo '~root/ > > User names are completed even in single quotes. I think it shouldn't. > > serein% echo '~akr/zs > -> > serein% echo '~akr/zsh/ > > serein% echo '$PWD/C CVS/ ChangeLog ChangeLog.3.0 Completion/ Config/ > > Hm. _path_files expands `~akr' and `$PWD' even in single quotes. Hmhm, seems sensible, because there is `compset -q' for real in-quote completion. Bye Sven Index: Completion/Base/_tilde =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Base/_tilde,v retrieving revision 1.3 diff -u -r1.3 _tilde --- Completion/Base/_tilde 2000/04/25 11:00:06 1.3 +++ Completion/Base/_tilde 2000/05/16 11:22:27 @@ -4,6 +4,8 @@ # for you or if there are too many of them, you may want to use # `compadd -qS/ - "$friends[@]"' or something like that. +[[ -n "$compstate[quote]" ]] && return 1 + local expl suf dirs list lines revlines i ret disp nm="$compstate[nmatches]" if [[ "$SUFFIX" = */* ]]; then Index: Completion/Core/_path_files =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Core/_path_files,v retrieving revision 1.13 diff -u -r1.13 _path_files --- Completion/Core/_path_files 2000/05/15 10:45:24 1.13 +++ Completion/Core/_path_files 2000/05/16 11:22:27 @@ -160,7 +160,7 @@ # Now let's have a closer look at the string to complete. -if [[ "$pre[1]" = \~ ]]; then +if [[ "$pre[1]" = \~ && -z "$compstate[quote]" ]]; then # It begins with `~', so remember anything before the first slash to be able # to report it to the completion code. Also get an expanded version of it # (in `realpath'), so that we can generate the matches. Then remove that @@ -209,7 +209,7 @@ orig="${orig#*/}" donepath= prepaths=( '' ) -elif [[ "$pre" = *\$*/* ]]; then +elif [[ "$pre" = *\$*/* && -z "$compstate[quote]" ]]; then # If there is a parameter expansion in the word from the line, we try # to complete the beast by expanding the prefix and completing anything -- Sven Wischnowsky wischnow@informatik.hu-berlin.de