zsh-workers
 help / color / mirror / Atom feed
* Not-quite-alphabetic sorting: bug in Zsh or in Ubuntu?
@ 2021-08-27 14:49 Marlon Richert
  2021-08-27 22:33 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Marlon Richert @ 2021-08-27 14:49 UTC (permalink / raw)
  To: Zsh hackers list

% exec -c zsh -fc "HOME=$PWD SHELL=$SHELL TERM=$TERM PS1='%# ' exec Src/zsh -f"
% autoload compinit
% compinit
% zstyle '*' extra-verbose yes
% less<TAB>
less     -- opposite of more
lessecho -- expand metacharacters
lessfile -- "input preprocessor" for less.
lesskey  -- specify key bindings for less
lesspipe -- "input preprocessor" for less.
% LANG=en_US.UTF-8
% less<TAB>
lessecho -- expand metacharacters
lessfile -- "input preprocessor" for less.
lesskey  -- specify key bindings for less
less     -- opposite of more
lesspipe -- "input preprocessor" for less.

Without `$LANG`, the output is correctly sorted, but with
`LANG=en_US.UTF-8`, `less` somehow ends up in the wrong spot.

The problem occurs for me on Ubuntu, but not on macOS. Ergo, I suppose
this is a bug on the OS level?

On the other hand, it appears to affect only completion sorting:

% LANG=en_US.UTF-8
% touch lessecho lessfile lesskey lesspipe less
% print -l less*
less
lessecho
lessfile
lesskey
lesspipe
% rm less*
% tmp=( lessecho lessfile lesskey lesspipe less )
% print ${(o)tmp}
less lessecho lessfile lesskey lesspipe
%

These are all sorted just fine.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Not-quite-alphabetic sorting: bug in Zsh or in Ubuntu?
  2021-08-27 14:49 Not-quite-alphabetic sorting: bug in Zsh or in Ubuntu? Marlon Richert
@ 2021-08-27 22:33 ` Bart Schaefer
  2021-08-30 10:50   ` Marlon Richert
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2021-08-27 22:33 UTC (permalink / raw)
  To: Marlon Richert; +Cc: Zsh hackers list

I believe this has been discussed before, it has to do with how each
platform defines locale-specific collation order.  In the completion
example I believe this has to do with collation of spaces, because the
descriptions are included in the strings passed to strcoll() for
sorting.

Try

LANG=en_US.UTF-8 sort <<\EOF
less     -- opposite of more
lessecho -- expand metacharacters
lessfile -- "input preprocessor" for less.
lesskey  -- specify key bindings for less
lesspipe -- "input preprocessor" for less.
EOF

and you'll get the same result.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Not-quite-alphabetic sorting: bug in Zsh or in Ubuntu?
  2021-08-27 22:33 ` Bart Schaefer
@ 2021-08-30 10:50   ` Marlon Richert
  0 siblings, 0 replies; 3+ messages in thread
From: Marlon Richert @ 2021-08-30 10:50 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Zsh hackers list

On Sat, Aug 28, 2021 at 1:33 AM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> I believe this has been discussed before, it has to do with how each
> platform defines locale-specific collation order.  In the completion
> example I believe this has to do with collation of spaces, because the
> descriptions are included in the strings passed to strcoll() for
> sorting.
>
> Try
>
> LANG=en_US.UTF-8 sort <<\EOF
> less     -- opposite of more
> lessecho -- expand metacharacters
> lessfile -- "input preprocessor" for less.
> lesskey  -- specify key bindings for less
> lesspipe -- "input preprocessor" for less.
> EOF
>
> and you'll get the same result.

Thanks for the explanation! :)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-30 10:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-27 14:49 Not-quite-alphabetic sorting: bug in Zsh or in Ubuntu? Marlon Richert
2021-08-27 22:33 ` Bart Schaefer
2021-08-30 10:50   ` Marlon Richert

zsh-workers

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.vuxu.org/zsh-workers

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 zsh-workers zsh-workers/ https://inbox.vuxu.org/zsh-workers \
		zsh-workers@zsh.org
	public-inbox-index zsh-workers

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


code repositories for the project(s) associated with this inbox:

	https://git.vuxu.org/mirror/zsh/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git