From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? Date: Fri, 22 Aug 2014 16:23:34 +0200 Message-ID: <87ha147gd5.fsf@gmx.de> References: <87ha2f5gp8.fsf@web.de> <87a987ht5r.fsf@gmx.de> <83y4vq6cz3.fsf@gnu.org> <87tx6c7f5v.fsf@web.de> <8338dw5zrf.fsf@gnu.org> <87lhro7dp4.fsf@web.de> <83zjg44jzd.fsf@gnu.org> <87wqb8mqqv.fsf@web.de> <83y4vo4fbr.fsf@gnu.org> <87silwmo8h.fsf@web.de> <83wqb84e7l.fsf@gnu.org> <87iomsgsqg.fsf@gmx.de> <83tx6c44x7.fsf@gnu.org> <87egxggigj.fsf@gmx.de> <877g28w19r.fsf@gmx.de> <83sikvcbqr.fsf@gnu.org> <83r40fc876.fsf@gnu.org> <87wqa7uf7w.fsf@gmx.de> <83oavjc5jj.fsf@gnu.org> <87y4uixleg.fsf@gmx.de> <83sikpc3cd.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1408717483 23810 80.91.229.3 (22 Aug 2014 14:24:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Aug 2014 14:24:43 +0000 (UTC) Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 22 16:24:32 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XKplJ-0007Aj-Tw for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Aug 2014 16:24:18 +0200 Original-Received: from localhost ([::1]:37450 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKplJ-0001QB-0I for geb-bug-gnu-emacs@m.gmane.org; Fri, 22 Aug 2014 10:24:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKplA-0001O9-Ip for bug-gnu-emacs@gnu.org; Fri, 22 Aug 2014 10:24:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKpl4-0005MH-Kp for bug-gnu-emacs@gnu.org; Fri, 22 Aug 2014 10:24:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKpl4-0005MD-I9 for bug-gnu-emacs@gnu.org; Fri, 22 Aug 2014 10:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XKpl4-00037k-7Q for bug-gnu-emacs@gnu.org; Fri, 22 Aug 2014 10:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Aug 2014 14:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18051 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18051-submit@debbugs.gnu.org id=B18051.140871743611996 (code B ref 18051); Fri, 22 Aug 2014 14:24:02 +0000 Original-Received: (at 18051) by debbugs.gnu.org; 22 Aug 2014 14:23:56 +0000 Original-Received: from localhost ([127.0.0.1]:49657 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XKpkx-00037Q-Dw for submit@debbugs.gnu.org; Fri, 22 Aug 2014 10:23:55 -0400 Original-Received: from mout.gmx.net ([212.227.17.22]:63788) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XKpkv-00037C-3S for 18051@debbugs.gnu.org; Fri, 22 Aug 2014 10:23:53 -0400 Original-Received: from detlef.gmx.de ([93.209.90.240]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0MOCSm-1XFJyk25rw-005VOz; Fri, 22 Aug 2014 16:23:42 +0200 In-Reply-To: <83sikpc3cd.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 21 Aug 2014 17:41:22 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-Provags-ID: V03:K0:sySYIxjb57u51oVW3aSGCVlVF1Pql1JrBf2zow0OMiDajfhJehV WR1OCxJzssD2q4+ICaMsTsz2Se3Ugz5F7gyEuuHzRc8+FXfSRESlhjb2gEUciMFpRH2++xe Gtgobj+C1I5XRvJsujqUKPK8G5uaHP/MqUY80YqwpTNOi5rMQEo3qTcrmPVj3f6icddRA1b 8rzq+q1tKt37gKPvJ/LrQ== X-UI-Out-Filterresults: notjunk:1; X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:92603 Archived-At: Eli Zaretskii writes: Hi Eli, > . I suggest to factor out the part that converts to wchar_t, sets up > the locale, and calls strcoll. The code you wrote makes certain > assumptions about 'setlocale', and also about the wchar_t > representation. Factoring those system-dependent parts out will > minimize the number of #ifdef's needed to provide such features for > other platforms. I see. But I don't know how to factor out. Shall I move str_collate to another file? Or to a new file? Something else? > . I think glibc has a 'newlocale' API that is better suited to this > kind of jobs. In particular, 'setlocale' changes the locale of the > entire program, which is bad news for other threads that might be > using some locale-aware functions while the main thread calls > string-collate-lessp. (We have more than 1 thread in Emacs built > with GTK, for example, and who knows what those threads might be > doing?) OK, done. I have added also configure checks HAVE_NEWLOCALE, HAVE_USELOCALE and HAVE_FREELOCALE for the respective glibc functions. I don't know whether it is overengineering, and whether I could simply apply the existing HAVE_SETLOCALE check. I believe all these functions do exist in parallel in locale.h, don't they? Best regards, Michael.