bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal


From: Michael Albinus
Subject: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function?
Date: Wed, 27 Aug 2014 20:08:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Glenn Morris <rgm@gnu.org> writes:

> I'm missing something, because I don't get why you want me to write (in
> authors.el):
>
> (let ((process-environment
>        (cons "LC_COLLATE=en_US.UTF-8"
>              process-environment)))
>   (sort authors-author-list
>         (lambda (a b) (string-collate-lessp (car a) (car b)))))
>
> rather than the obviously-better:
>
> (sort authors-author-list
>       (lambda (a b) (string-collate-lessp (car a) (car b) "en_US.UTF-8")))
>
> Normally one controls functions through their arguments, not the
> environment.

authors.el is a special case:

- Your sort predicate is not an existing function, but a
  lambda. Usually, I would expect something like

  (sort any-list 'string-collate-lessp)

- You use a hard-coded value for the locale. The intention is to make it
  configurable for the user.

If, for example, a user wants to use another collation order but the one
given by "en_US.UTF-8", you end up in offering a variable which can be
set. Don't know whether this is desirable in authors.el, 'tho.

Best regards, Michael.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]