zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@sunsite.dk, 377765@bugs.debian.org
Subject: Re: Bug#377765: zsh: completion of configure script does not handle underscore properly
Date: Thu, 13 Dec 2007 20:56:22 +0000	[thread overview]
Message-ID: <20071213205622.006d37a7.p.w.stephenson@ntlworld.com> (raw)
In-Reply-To: <20071213190909.GA31400@scowler.net>

On Thu, 13 Dec 2007 14:09:09 -0500
Clint Adams <schizo@debian.org> wrote:
> This still seems to be an issue and that patch no longer applies to
> current _arguments.

I would imagine something simple-minded like the following would do this
consistently.  Please commit it if it works.

Index: Completion/Base/Utility/_arguments
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_arguments,v
retrieving revision 1.20
diff -u -r1.20 _arguments
--- Completion/Base/Utility/_arguments	16 Feb 2007 15:02:03 -0000	1.20
+++ Completion/Base/Utility/_arguments	13 Dec 2007 20:56:36 -0000
@@ -97,7 +97,7 @@
        # present.  Maybe the problem was that the intervening code
        # didn't.  If it's buggy without removing them, the problem
        # probably is later, not here.
-       if [[ -z ${tmp[(r)${match[1]%%[^a-zA-Z0-9-]#}]} ]]; then
+       if [[ -z ${tmp[(r)${match[1]%%[^a-zA-Z0-9_-]#}]} ]]; then
 	 tmp+=($match[1])
        fi
        opt=$match[2]
@@ -218,9 +218,9 @@
 	    odescr=
 	  fi
 	  if [[ $opt = (#b)(*)\[\=* ]]; then
-	    opt2=${${match[1]}//[^a-zA-Z0-9-]}=-${dir}${odescr}
+	    opt2=${${match[1]}//[^a-zA-Z0-9_-]}=-${dir}${odescr}
 	  else
-	    opt2=${${opt}//[^a-zA-Z0-9-]}=${dir}${odescr}
+	    opt2=${${opt}//[^a-zA-Z0-9_-]}=${dir}${odescr}
 	  fi
 	  if [[ "$descr" = :\=* ]]; then
 	    cache+=( "${opt2}::${(L)${opt%\]}#*\=}: " )
@@ -247,7 +247,7 @@
 	  else
 	    odescr=
 	  fi
-	  opt2="${${opt%%\=*}//[^a-zA-Z0-9-]}=${dir}${odescr}"
+	  opt2="${${opt%%\=*}//[^a-zA-Z0-9_-]}=${dir}${odescr}"
 	  if [[ "$descr" = :\=* ]]; then
 	    cache+=( "${opt2}:${(L)${opt%\]}#*\=}: " )
 	  else
@@ -268,7 +268,7 @@
 	  # I discovered after about half an hour, so don't do that.
 	  "${(@)^${(@)tmp:#^*:*}//:/[}]"
 	  # commands with no description
-	  "${(@)${(@)tmp:#*:*}//[^a-zA-Z0-9-]}")
+	  "${(@)${(@)tmp:#*:*}//[^a-zA-Z0-9_-]}")
         if [[ -n "$descr" && "$descr" != ': :  ' ]]; then
 	  cache+=( "${(@)^tmp}${descr}" )
         else

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


      reply	other threads:[~2007-12-13 20:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060711070135.40826124047@star.phys.s.u-tokyo.ac.jp>
2006-10-07  9:53 ` Clint Adams
2007-03-29  1:20   ` Ryo IGARASHI
2007-12-13 19:09     ` Clint Adams
2007-12-13 20:56       ` Peter Stephenson [this message]

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=20071213205622.006d37a7.p.w.stephenson@ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=377765@bugs.debian.org \
    --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).