* Re: Bug#289442: zsh: completions do not respect LC_COLLATE
[not found] <E1CnUVX-0005Di-00@nozomi>
@ 2005-01-09 15:35 ` Clint Adams
2005-01-09 16:12 ` Clint Adams
0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 2005-01-09 15:35 UTC (permalink / raw)
To: zsh-workers, Benjamin Hill (Mako), 289442-forwarded
> Thanks for maintaining zsh Clint!
>
> AFAICT, results returned by tab completions to do not respect
> LC_COLLATE. Preferabley, zsh should sort completions according to
> whatever LC_COLLATE is set to at the time the completions are
> presented.
>
> To reproduce the bug, go into a directory with upper case and
> lowercase filenames. Set LC_COLLATE to C or POSIX and you should see
> case sensative sorting for a command like ls and in the completions of
> the ls command. Now set LC_COLLATE to, for example, en_US.UTF-8 which
> sorts case insensatively. The behavior will be changed for ls but not
> for tab completions of ls from within zsh.
>
> Invoking zsh with the LC_COLLATE set does not alter this behavior.
There were some concerns with locale-specific collation order in the
past with respect to surprise data loss when globbing.
http://www.zsh.org/mla/users/1998/msg00740.html
http://www.zsh.org/mla/workers/1999/msg02226.html
However, the real issue with your sorting problem seems to be the use of
a comparison function that ignores locale and behaves differently
depending on the setting of the NUMERIC_GLOB_SORT option.
I think we could change the character comparison at the end of
setbpcmp() to a strcoll(), or do setxfrm()'s at the beginning.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Bug#289442: zsh: completions do not respect LC_COLLATE
2005-01-09 15:35 ` Bug#289442: zsh: completions do not respect LC_COLLATE Clint Adams
@ 2005-01-09 16:12 ` Clint Adams
0 siblings, 0 replies; 2+ messages in thread
From: Clint Adams @ 2005-01-09 16:12 UTC (permalink / raw)
To: zsh-workers, Benjamin Hill (Mako), 289442
> I think we could change the character comparison at the end of
> setbpcmp() to a strcoll(), or do setxfrm()'s at the beginning.
This does the trick. I'll refrain from committing in case there's
an unacceptable performance hit or side effect.
Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.45
diff -u -r1.45 zle_tricky.c
--- Src/Zle/zle_tricky.c 2 Jun 2004 22:15:02 -0000 1.45
+++ Src/Zle/zle_tricky.c 9 Jan 2005 16:09:21 -0000
@@ -1907,7 +1907,11 @@
}
}
}
+#ifndef HAVE_STRCOLL
return (int)(*a - *b);
+#else
+ return strcoll(a,b);
+#endif
}
/* This is used to print the strings (e.g. explanations). *
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-01-09 16:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <E1CnUVX-0005Di-00@nozomi>
2005-01-09 15:35 ` Bug#289442: zsh: completions do not respect LC_COLLATE Clint Adams
2005-01-09 16:12 ` Clint Adams
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).