From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12171 invoked from network); 17 Jun 2004 13:05:24 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.86) by ns1.primenet.com.au with SMTP; 17 Jun 2004 13:05:24 -0000 Received: (qmail 25246 invoked from network); 17 Jun 2004 13:05:15 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 17 Jun 2004 13:05:15 -0000 Received: (qmail 16763 invoked by alias); 17 Jun 2004 13:05:07 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20069 Received: (qmail 16753 invoked from network); 17 Jun 2004 13:05:06 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 17 Jun 2004 13:05:03 -0000 Received: (qmail 24819 invoked from network); 17 Jun 2004 13:05:03 -0000 Received: from mail36.messagelabs.com (193.109.254.211) by a.mx.sunsite.dk with SMTP; 17 Jun 2004 13:05:02 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-5.tower-36.messagelabs.com!1087477474!7067803 X-StarScan-Version: 5.2.10; banners=-,-,- X-Originating-IP: [158.234.9.163] Received: (qmail 3154 invoked from network); 17 Jun 2004 13:04:34 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-5.tower-36.messagelabs.com with SMTP; 17 Jun 2004 13:04:34 -0000 Received: from trentino.logica.co.uk ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id i5HD4YUI029062; Thu, 17 Jun 2004 14:04:34 +0100 Received: from trentino.logica.co.uk (localhost [127.0.0.1]) by trentino.logica.co.uk (Postfix) with ESMTP id A9EDD7970C6A; Thu, 17 Jun 2004 15:03:49 +0200 (CEST) Cc: Hugo Haas , 254801-forwarded@bugs.debian.org X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <20040616235219.GA18736@scowler.net> From: Oliver Kiddle References: <20040616184219.GA7569@larve.net> <20040616235219.GA18736@scowler.net> To: zsh-workers@sunsite.dk Subject: Re: Bug#254801: zsh: iconv code set completion case insensitivity Date: Thu, 17 Jun 2004 15:03:49 +0200 Message-ID: <2794.1087477429@trentino.logica.co.uk> X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 Clint wrote: > > > > However, iconv doesn't matter about the case of the character encoding > > name given, which is legit AFAIK. > > > > Is it possible to make the completion case insensitive too? > > It's possible. Does it make sense to do it for all platforms, or is > there an iconv out there that cares about case? As far as I can tell, it is only GNU iconv which doesn't care about case. Anyway, it's easy to fix. This patch also makes it use _call_program and does the job of using LOCPATH on OSF properly. Oliver Index: _iconv =================================================================== RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_iconv,v retrieving revision 1.3 diff -u -r1.3 _iconv --- _iconv 12 Mar 2003 18:55:38 -0000 1.3 +++ _iconv 17 Jun 2004 12:30:19 -0000 @@ -1,6 +1,7 @@ #compdef iconv -local expl curcontext="$curcontext" state line codeset LOCPATH ret=1 +local expl curcontext="$curcontext" state line codeset ret=1 +local LOCPATH="${LOCPATH:-/usr/lib/nls/loc}" if _pick_variant gnu=GNU unix --version; then @@ -22,8 +23,9 @@ if compset -P '*/'; then _wanted option expl option compadd "$@" /TRANSLIT && ret=0 else - _wanted codesets expl 'code set' compadd "$@" -M 'r:|-=* r:|=*' \ - ${${${(f)"$(iconv --list|sed -n '/^$/,$ p')"}## #}%//} && ret=0 + _wanted codesets expl 'code set' compadd "$@" \ + -M 'm:{a-zA-Z}={A-Za-z} r:|-=* r:|=*' \ + ${${${(f)"$(_call_program codesets iconv --list|sed -n '/^$/,$ p')"}## #}%//} && ret=0 fi fi @@ -38,7 +40,7 @@ if [[ $state = codeset ]]; then if [[ -f /usr/lib/iconv/iconv_data ]]; then # IRIX & Solaris codeset=( ${${(f)"$(