zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: ~user completion in single quotes.
Date: Tue, 16 May 2000 13:22:39 +0200 (MET DST)	[thread overview]
Message-ID: <200005161122.NAA27048@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Tanaka Akira's message of 16 May 2000 08:15:43 +0900


Tanaka Akira wrote:

> Z(4):akr@serein% Src/zsh -f                        
> serein% bindkey -e; autoload -U compinit; compinit -D
> serein% echo '~ro<TAB>
> ->
> serein% echo '~root/
> 
> User names are completed even in single quotes.  I think it shouldn't.
> 
> serein% echo '~akr/zs<TAB>
> ->
> serein% echo '~akr/zsh/    
> 
> serein% echo '$PWD/C<TAB
> 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


             reply	other threads:[~2000-05-16 11:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-05-16 11:22 Sven Wischnowsky [this message]
2000-05-16 16:14 ` Tanaka Akira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200005161122.NAA27048@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).