From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@sunsite.dk
Cc: Hugo Haas <hugo@larve.net>, 254801-forwarded@bugs.debian.org
Subject: Re: Bug#254801: zsh: iconv code set completion case insensitivity
Date: Thu, 17 Jun 2004 15:03:49 +0200 [thread overview]
Message-ID: <2794.1087477429@trentino.logica.co.uk> (raw)
In-Reply-To: <20040616235219.GA18736@scowler.net>
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)"$(</usr/lib/iconv/iconv_data)"}%%[[:blank:]]*} )
- elif [[ -d ${LOCPATH:=/usr/lib/nls/loc}/iconv ]]; then # OSF
+ elif [[ -d $LOCPATH/iconv ]]; then # OSF
codeset=( $LOCPATH/iconv/*(N:t) )
codeset=( ${(j:_:s:_:)codeset} )
else
next prev parent reply other threads:[~2004-06-17 13:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20040616184219.GA7569@larve.net>
2004-06-16 23:52 ` Clint Adams
2004-06-17 13:03 ` Oliver Kiddle [this message]
2004-06-17 14:02 ` Clint Adams
2004-06-17 14:04 ` Clint Adams
2004-06-17 14:43 ` Oliver Kiddle
2004-06-17 15:01 ` Clint Adams
2004-06-24 20:47 ` Clint Adams
2004-06-25 9:39 ` Oliver Kiddle
2004-06-26 14:37 ` Clint Adams
2004-06-26 18:12 ` Bart Schaefer
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=2794.1087477429@trentino.logica.co.uk \
--to=okiddle@yahoo.co.uk \
--cc=254801-forwarded@bugs.debian.org \
--cc=hugo@larve.net \
--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).