zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: "Zsh Hackers' List" <zsh-workers@sunsite.dk>
Subject: PATCH (?) Re: Regression in braces completion
Date: Mon, 13 Oct 2008 21:37:20 -0700	[thread overview]
Message-ID: <081013213720.ZM30875@torch.brasslantern.com> (raw)
In-Reply-To: <200810131627.m9DGRoED017498@news01.csr.com>

On Oct 13,  5:27pm, Peter Stephenson wrote:
}
} > I wasn't suggesting treating this as a special case, I was suggesting
} > that _path_files treat a spelling correction in the path prefix as a
} > special case.  That's the stated reason why _path_files is using -U.
} 
} As you previously noted, there are already far too many ways of running
} compadd within _path_files as it is.  I'm not at all happy about
} doubling the number to get sets with and without -U --- which would
} leave spelling correction broken in the case where braces are present

Somebody tell me what's wrong with this.  Doesn't seem to break spelling
correction in the path prefix when braces are present, and doesn't seem
to break braces when spelling correction isn't present, and doesn't add
any new calls to compadd; just changes whether the ones that are there
get -U passed in.

What am I missing?


--- ../zsh-forge/current/Completion/Unix/Type/_path_files	2008-09-02 20:09:04.000000000 -0700
+++ Completion/Unix/Type/_path_files	2008-10-13 21:31:53.000000000 -0700
@@ -7,7 +7,7 @@
 local tmp1 tmp2 tmp3 tmp4 i orig eorig pre suf tpre tsuf opre osuf cpre
 local pats haspats ignore pfx pfxsfx sopt gopt opt sdirs ignpar cfopt listsfx
 local nm=$compstate[nmatches] menu matcher mopts sort mid accex fake
-local listfiles listopts tmpdisp origtmp1
+local listfiles listopts tmpdisp origtmp1 Uopt
 integer npathcheck
 local -a match mbegin mend
 
@@ -209,7 +209,7 @@
 [[ $compstate[insert] = (*menu|[0-9]*) || -n "$_comp_correct" ||
    ( -n "$compstate[pattern_match]" &&
      "${orig#\~}" != (|*[^\\])[][*?#~^\|\<\>]* ) ]] && menu=yes
-[[ -n "$_comp_correct" ]] && cfopt=-
+[[ -n "$_comp_correct" ]] && cfopt=- Uopt=-U
 
 # Now let's have a closer look at the string to complete.
 
@@ -612,7 +612,7 @@
 	    # back up the path.
 	    tmp1=("${(@)tmp1%%/*}")
 	    _list_files tmp1 "$prepath$realpath$testpath"
-	    compadd -U -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \
+	    compadd $Uopt -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \
 	            -s "/${tmp3#*/}$ISUFFIX" \
 	            -W "$prepath$realpath$testpath" \
 		    "$pfxsfx[@]" \
@@ -622,7 +622,7 @@
 	    # Same with a non-empty suffix
 	    tmp1=("${(@)^tmp1%%/*}/${tmp3#*/}")
 	    _list_files tmp1 "$prepath$realpath$testpath"
-	    compadd -U -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \
+	    compadd $Uopt -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \
 	            -s "$ISUFFIX" \
 	            -W "$prepath$realpath$testpath" \
 		    "$pfxsfx[@]" \
@@ -631,7 +631,7 @@
           fi
 	else
 	  _list_files tmp1 "$prepath$realpath$testpath"
-	  compadd -U -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \
+	  compadd $Uopt -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \
 	          -s "$ISUFFIX" \
 	          -W "$prepath$realpath$testpath" \
 		   "$pfxsfx[@]" \
@@ -661,7 +661,7 @@
           fi
         else
 	  _list_files tmp1 "$prepath$realpath$testpath"
-	  compadd -U -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \
+	  compadd $Uopt -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp2" \
 	          -s "$ISUFFIX" \
                   -W "$prepath$realpath$testpath" \
 		  "$pfxsfx[@]" \
@@ -730,7 +730,7 @@
       compquote tmp4 tmp2 tmp1
       for i in "$tmp1[@]"; do
 	_list_files tmp2 "$prepath$realpath${mid%/*/}"
-        compadd -U -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp3/" \
+        compadd $Uopt -Qf "$mopts[@]" -p "$IPREFIX$linepath$tmp3/" \
 	        -s "/$tmp4$i$ISUFFIX" \
                 -W "$prepath$realpath${mid%/*/}/" \
 	        "$pfxsfx[@]" $listopts - "$tmp2"
@@ -761,7 +761,7 @@
       else
 	# Not a pattern match
 	_list_files tmp1 "$prepath$realpath$testpath"
-        compadd -U -Qf -p "$IPREFIX$linepath$tmp4" \
+        compadd $Uopt -Qf -p "$IPREFIX$linepath$tmp4" \
 	        -s "$ISUFFIX" \
 	        -W "$prepath$realpath$testpath" \
 	        "$pfxsfx[@]" "$mopts[@]" $listopts -a tmp1


  parent reply	other threads:[~2008-10-14  4:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-12  2:32 Vin Shelton
2008-10-12  4:32 ` Bart Schaefer
2008-10-12  7:10   ` Bart Schaefer
2008-10-12 19:42     ` Peter Stephenson
2008-10-12 22:47       ` Bart Schaefer
2008-10-13  9:04         ` Peter Stephenson
2008-10-13 15:43           ` Bart Schaefer
2008-10-13 16:27             ` Peter Stephenson
2008-10-13 16:56               ` Bart Schaefer
2008-10-14  4:37               ` Bart Schaefer [this message]
2008-10-14  8:45                 ` PATCH (?) " Peter Stephenson
2008-10-15  1:34                   ` Vin Shelton

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=081013213720.ZM30875@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.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).