From unknown Wed Jun 25 10:47:28 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#18051 <18051@debbugs.gnu.org> To: bug#18051 <18051@debbugs.gnu.org> Subject: Status: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? Reply-To: bug#18051 <18051@debbugs.gnu.org> Date: Wed, 25 Jun 2025 17:47:28 +0000 retitle 18051 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal= function? reassign 18051 emacs submitter 18051 michael_heerdegen@web.de severity 18051 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 02:23:15 2014 Received: (at submit) by debbugs.gnu.org; 18 Jul 2014 06:23:15 +0000 Received: from localhost ([127.0.0.1]:57853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X81Za-0001zU-LI for submit@debbugs.gnu.org; Fri, 18 Jul 2014 02:23:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53427) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X81ZY-0001zH-8Z for submit@debbugs.gnu.org; Fri, 18 Jul 2014 02:23:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X81ZL-0005ie-S9 for submit@debbugs.gnu.org; Fri, 18 Jul 2014 02:23:07 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59396) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X81ZL-0005ia-Ok for submit@debbugs.gnu.org; Fri, 18 Jul 2014 02:22:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X81ZF-0004xN-FH for bug-gnu-emacs@gnu.org; Fri, 18 Jul 2014 02:22:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X81Z9-0005hO-7A for bug-gnu-emacs@gnu.org; Fri, 18 Jul 2014 02:22:53 -0400 Received: from mout.web.de ([212.227.15.14]:55755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X81Z8-0005gs-U1 for bug-gnu-emacs@gnu.org; Fri, 18 Jul 2014 02:22:47 -0400 Received: from drachen.dragon ([94.217.127.201]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0LrpKY-1WPMcs1hkc-013i9f for ; Fri, 18 Jul 2014 08:22:44 +0200 From: Michael Heerdegen To: bug-gnu-emacs@gnu.org Subject: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? Date: Fri, 18 Jul 2014 08:22:43 +0200 Message-ID: <87ha2f5gp8.fsf@web.de> MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:VnG0AKdubOjK9++EmxMCcwYtJfTDe4tx9rLxtg6vaPbPUxRwd9p LL7Kvxv7w3jl6u0SNVSWOjoYiIvfDqcERZPwee7yOr1wF5FslrGz9Ko+rzQ7TMat1ivRctR FKBggePqFO3Ge+k8g5ayIjNUPxXEARjtRVjFky3VP585zgntePnB310DFvVTyODjMaYNe+R r4aXOL66dVQtmjt/v19Ag== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: michael_heerdegen@web.de List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hello, Some users will want to configure the sorting predicate used by ls-lisp, for example, to get a natural sorting of version numbers, or to sort in files whose names start with a dot as if they had no dot, etc. Currently, sorting is even hardcoded because `ls-lisp-string-lessp' is a defsubst. If it was a normal function, one could advice it. Or, with some more efforts, sorting order could be made configurable via options, and the -v switch could be implemented. Regards, Michael. In GNU Emacs 24.3.92.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2) of 2014-07-17 on drachen Windowing system distributor `The X.Org Foundation', version 11.0.11599904 System Description: Debian GNU/Linux testing (jessie) From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 02:54:09 2014 Received: (at 18051) by debbugs.gnu.org; 18 Jul 2014 06:54:09 +0000 Received: from localhost ([127.0.0.1]:57866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X823V-0002ky-4L for submit@debbugs.gnu.org; Fri, 18 Jul 2014 02:54:09 -0400 Received: from mtaout25.012.net.il ([80.179.55.181]:42928) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X823R-0002kO-Nw for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 02:54:06 -0400 Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0N8W00900APCJC00@mtaout25.012.net.il> for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 09:49:34 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N8W000YNAYMSB90@mtaout25.012.net.il>; Fri, 18 Jul 2014 09:49:34 +0300 (IDT) Date: Fri, 18 Jul 2014 09:53:49 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <87ha2f5gp8.fsf@web.de> X-012-Sender: halo1@inter.net.il To: michael_heerdegen@web.de Message-id: <838unr6ttu.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Heerdegen > Date: Fri, 18 Jul 2014 08:22:43 +0200 > > Some users will want to configure the sorting predicate used by ls-lisp, > for example, to get a natural sorting of version numbers, or to sort in > files whose names start with a dot as if they had no dot, etc. > > Currently, sorting is even hardcoded because `ls-lisp-string-lessp' is a > defsubst. If it was a normal function, one could advice it. > > Or, with some more efforts, sorting order could be made configurable via > options, and the -v switch could be implemented. ls-lisp emulates the Unix and GNU 'ls'. So I will generally oppose to introducing any option into it that cannot be had with an external 'ls' program, as long as the latter is the main method of getting a Dired buffer. (If Emacs ever decides that ls-lisp becomes the main method, and will use it by default on all supported platforms, this objection will no longer be valid, of course.) An alternative to what you want would be a Dired-level feature, which then will be available also to those who don't use ls-lisp. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 03:33:41 2014 Received: (at 18051) by debbugs.gnu.org; 18 Jul 2014 07:33:41 +0000 Received: from localhost ([127.0.0.1]:57874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X82fh-0003kk-D4 for submit@debbugs.gnu.org; Fri, 18 Jul 2014 03:33:41 -0400 Received: from mout.web.de ([212.227.15.3]:49859) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X82fb-0003kT-Ku for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 03:33:35 -0400 Received: from drachen.dragon ([94.217.127.201]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0MUEoU-1WzlC424Yc-00R2j8; Fri, 18 Jul 2014 09:33:22 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> Date: Fri, 18 Jul 2014 09:33:21 +0200 In-Reply-To: <838unr6ttu.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 Jul 2014 09:53:49 +0300") Message-ID: <871ttj5dfi.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:GazOo9jA0fsNuXxmjQbCC7ph3AH9AH9RWtKS9MMaeDLXaMAtdRU UQxZFFFL+smQ0Eq7kmHwGrcvpRhriLvk2jTXYCaN7P6VICWvOhzcNRs88ti5CAC8xd+jFeb R9NffywXx5HNGVT7fr2yVo6t8JExCEcDb5c8/2H/nQg5gFelXu71SIrEgYdHyVOmA/PQFnk ihP8VQKp9RN76Z4Asb16Q== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > ls-lisp emulates the Unix and GNU 'ls'. So I will generally oppose to > introducing any option into it that cannot be had with an external > 'ls' program, as long as the latter is the main method of getting a > Dired buffer. (If Emacs ever decides that ls-lisp becomes the main > method, and will use it by default on all supported platforms, this > objection will no longer be valid, of course.) That's a bit what I expected, and makes sense. I would welcome ls-lisp to become the default, btw. Sorting in dired could generally be improved a lot. If you want sorting by size, you need to edit the switches, which is not very handy (there are addons for that job). I needed to define the whole `dired-sort-toggle-or-edit' because it hardcodes -t whereby I prefer -c. > An alternative to what you want would be a Dired-level feature, which > then will be available also to those who don't use ls-lisp. That would be a really good thing (if it doesn't slow down things). But before this is reality ... could I please get my `ls-lisp-string-lessp' defined as a function? Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 04:53:28 2014 Received: (at 18051) by debbugs.gnu.org; 18 Jul 2014 08:53:28 +0000 Received: from localhost ([127.0.0.1]:57919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X83uu-0005in-E7 for submit@debbugs.gnu.org; Fri, 18 Jul 2014 04:53:28 -0400 Received: from mtaout27.012.net.il ([80.179.55.183]:42561) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X83un-0005iO-AQ for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 04:53:21 -0400 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0N8W00B00GATLB00@mtaout27.012.net.il> for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 11:48:57 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N8W002Y5GHLLN90@mtaout27.012.net.il>; Fri, 18 Jul 2014 11:48:57 +0300 (IDT) Date: Fri, 18 Jul 2014 11:53:00 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <871ttj5dfi.fsf@web.de> X-012-Sender: halo1@inter.net.il To: Michael Heerdegen Message-id: <837g3b6ob7.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Heerdegen > Cc: 18051@debbugs.gnu.org > Date: Fri, 18 Jul 2014 09:33:21 +0200 > > could I please get my `ls-lisp-string-lessp' defined as a function? You can always redefine the functions that call it, no? From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 05:25:22 2014 Received: (at 18051) by debbugs.gnu.org; 18 Jul 2014 09:25:22 +0000 Received: from localhost ([127.0.0.1]:57928 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X84Pl-0006Vf-Up for submit@debbugs.gnu.org; Fri, 18 Jul 2014 05:25:21 -0400 Received: from mout.gmx.net ([212.227.15.18]:61959) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X84Pf-0006VH-S1 for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 05:25:16 -0400 Received: from detlef.gmx.de ([87.146.37.9]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MXIcX-1X4xBV1GTt-00WDlq; Fri, 18 Jul 2014 11:25:04 +0200 From: Michael Albinus To: Michael Heerdegen Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> Date: Fri, 18 Jul 2014 11:24:59 +0200 In-Reply-To: <871ttj5dfi.fsf@web.de> (Michael Heerdegen's message of "Fri, 18 Jul 2014 09:33:21 +0200") Message-ID: <87iomvhvdg.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:vEdkmdYVWuywyk7LtyF+Tztsa8NItMScsH+L3bTSFcLphmgOcBN IhLJHntMWldFjMhtJJjEC6OvIdQSUEQDpvT1ADSmcITX83qJAg2xPrKJXVZOOCQrL3fYkKK ebzGU7HQoHCfNYEKBZREiuczc31lYBE7CxpdjrZ0nCS6ht8gN5BUP9PC0PTBzxlA6GYzSOx R0jJxG6jNkuJjhMIsiuxQ== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: Eli Zaretskii , 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Michael Heerdegen writes: > Eli Zaretskii writes: > >> ls-lisp emulates the Unix and GNU 'ls'. So I will generally oppose to >> introducing any option into it that cannot be had with an external >> 'ls' program, as long as the latter is the main method of getting a >> Dired buffer. (If Emacs ever decides that ls-lisp becomes the main >> method, and will use it by default on all supported platforms, this >> objection will no longer be valid, of course.) > > That's a bit what I expected, and makes sense. I would welcome ls-lisp > to become the default, btw. Tramp uses ls-lisp only in case it cannot use a native method on the remote host. Experience shows, that ls-lisp has a much worse performance for remote directories than native implementations. I would oppose to make ls-lisp the default, and to add functionality to it which would not be available otherwise. Such additional functionality must be added to file name functions with a file name handler, if desired. > Michael. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 05:34:00 2014 Received: (at 18051) by debbugs.gnu.org; 18 Jul 2014 09:34:01 +0000 Received: from localhost ([127.0.0.1]:57935 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X84Y8-0006jL-8a for submit@debbugs.gnu.org; Fri, 18 Jul 2014 05:34:00 -0400 Received: from mtaout29.012.net.il ([80.179.55.185]:51959) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X84Y2-0006j0-CX for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 05:33:54 -0400 Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0N8W00A00I058H00@mtaout29.012.net.il> for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 12:33:44 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N8W00509IK80C80@mtaout29.012.net.il>; Fri, 18 Jul 2014 12:33:44 +0300 (IDT) Date: Fri, 18 Jul 2014 12:33:34 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <87iomvhvdg.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus Message-id: <834myf6mfl.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Cc: Eli Zaretskii , 18051@debbugs.gnu.org > Date: Fri, 18 Jul 2014 11:24:59 +0200 > > Tramp uses ls-lisp only in case it cannot use a native method on the > remote host. Experience shows, that ls-lisp has a much worse performance > for remote directories than native implementations. Any insight as to why this happens? Perhaps the Tramp implementation of directory-files-and-attributes needs some love? > I would oppose to make ls-lisp the default, and to add functionality to > it which would not be available otherwise. If this is because of Tramp, nothing prevents us from using 'ls' on the remote host, and then manipulate the results locally in Lisp, right? So I'm not sure I understand the rationale for your objections. Perhaps revealing more details will help. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 05:37:41 2014 Received: (at 18051) by debbugs.gnu.org; 18 Jul 2014 09:37:41 +0000 Received: from localhost ([127.0.0.1]:57939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X84bh-0006rB-61 for submit@debbugs.gnu.org; Fri, 18 Jul 2014 05:37:41 -0400 Received: from mout.web.de ([212.227.15.3]:54372) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X84bb-0006qr-3o for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 05:37:35 -0400 Received: from drachen.dragon ([94.217.127.201]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0Lwq4m-1WS2jw3Biy-016RHK; Fri, 18 Jul 2014 11:37:20 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <837g3b6ob7.fsf@gnu.org> Date: Fri, 18 Jul 2014 11:37:19 +0200 In-Reply-To: <837g3b6ob7.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 Jul 2014 11:53:00 +0300") Message-ID: <874myfatyo.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:Jmhv1rV+IDA3U09Z/QVOgAy4j4tc2BnL26+QV5yx84nuQ5WnTqp XQ+AiYTuuxLqMOT4mMmBBsW04usAJKSyFKp7zUX8/ytorNx3vJY+vLveXkl3erkw1Aft3gT fUZbXlq/m2TecNWNRxMBxplc7AqQSIa5OfbSdgHQuAYhMSrj42rfWvBFzLnmtLSIOo1eshW kl0SYJUFBTKSxqUf4tFYQ== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > > could I please get my `ls-lisp-string-lessp' defined as a function? > > You can always redefine the functions that call it, no? That would cover the whole switch processing algorithm, `ls-lisp-handle-switches', 60 lines of code. I would shadow any future change in that code by redefining that huge function. That's why I wanted to avoid that. What's the advantage of `ls-lisp-string-lessp' being a defsubst? If it really makes it significantly faster (it's called a lot of times, of course), then ok, let's keep it. Thanks, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 05:46:54 2014 Received: (at 18051) by debbugs.gnu.org; 18 Jul 2014 09:46:54 +0000 Received: from localhost ([127.0.0.1]:57943 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X84kb-00075K-0O for submit@debbugs.gnu.org; Fri, 18 Jul 2014 05:46:53 -0400 Received: from mtaout29.012.net.il ([80.179.55.185]:32900) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X84kU-00074y-A8 for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 05:46:47 -0400 Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0N8W00D00IMW0M00@mtaout29.012.net.il> for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 12:46:36 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N8W005W4J5O0CA0@mtaout29.012.net.il>; Fri, 18 Jul 2014 12:46:36 +0300 (IDT) Date: Fri, 18 Jul 2014 12:46:26 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <874myfatyo.fsf@web.de> X-012-Sender: halo1@inter.net.il To: Michael Heerdegen Message-id: <831ttj6lu5.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <837g3b6ob7.fsf@gnu.org> <874myfatyo.fsf@web.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Heerdegen > Cc: 18051@debbugs.gnu.org > Date: Fri, 18 Jul 2014 11:37:19 +0200 > > Eli Zaretskii writes: > > > > could I please get my `ls-lisp-string-lessp' defined as a function? > > > > You can always redefine the functions that call it, no? > > That would cover the whole switch processing algorithm, > `ls-lisp-handle-switches', 60 lines of code. I would shadow any future > change in that code by redefining that huge function. That's why I > wanted to avoid that. You are going to override the behavior of the package anyway, so I don't see the big difference. > What's the advantage of `ls-lisp-string-lessp' being a defsubst? >From my POV, making sure the package always behaves as designed, I guess. You agreed with my motivation, so it sounds like a contradiction to me to still push for the change. Anyway, if others think the comparison of file names should be up for grabs, I won't fight the change just because I think it's wrong. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 06:13:03 2014 Received: (at 18051) by debbugs.gnu.org; 18 Jul 2014 10:13:03 +0000 Received: from localhost ([127.0.0.1]:57949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X859y-0007iX-Uy for submit@debbugs.gnu.org; Fri, 18 Jul 2014 06:13:03 -0400 Received: from mout.gmx.net ([212.227.15.15]:57636) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X859w-0007i3-VF for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 06:13:01 -0400 Received: from detlef.gmx.de ([87.146.37.9]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MfVU3-1WtQas1Xr9-00P6kz; Fri, 18 Jul 2014 12:12:53 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> Date: Fri, 18 Jul 2014 12:12:48 +0200 In-Reply-To: <834myf6mfl.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 Jul 2014 12:33:34 +0300") Message-ID: <87a987ht5r.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:Bwhh7gyM3Bg69KKdvtg3aX95/oHKGIoMLVQZMrIF7W2wmkgAqF6 NknmAhbU/RlCXH0eo39qDKgZtA9og5QAyhBKXvsyBHgIDGqPhh53XltF+T4iM5VUVJRX/to WAvTyT4/A28lWa6ayNabwif7sgLTQjwLPIIp0kOGZ5vLZIF0Ocl0epCHqZ33C0gVVSBFRa7 IMjFUIUV5Xk5LZ8lZ1AKw== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: Hi Eli, >> Tramp uses ls-lisp only in case it cannot use a native method on the >> remote host. Experience shows, that ls-lisp has a much worse performance >> for remote directories than native implementations. > > Any insight as to why this happens? Perhaps the Tramp implementation > of directory-files-and-attributes needs some love? Maybe it is a misunderstanding. Tramp's native implementation is much faster, because it sends exactly one remote command. For ssh-like connections, this is for example # echo "("; (/bin/ls --color=never -a | sed -e s/\$/\"/g -e s/^/\"/g | xargs \stat -c '("%n" ("%N") %h %ue0 %ge0 %Xe0 %Ye0 %Ze0 %se0 "%A" t %ie0 -1)' 2>/dev/null); echo ")" 2>/dev/null This is much faster than ls-lisp, which must determine file-attributes for every single file in a remote directory (which is a remote command on its own). >> I would oppose to make ls-lisp the default, and to add functionality to >> it which would not be available otherwise. > > If this is because of Tramp, nothing prevents us from using 'ls' on > the remote host, and then manipulate the results locally in Lisp, > right? So I'm not sure I understand the rationale for your > objections. Perhaps revealing more details will help. I would oppose only if there is an additional mandatory functionality in ls-lisp other file name primitives are urged to use. If there would be changes in, let's say, directory-files-and-attributes, there's no problem for me. But that's not what Michael has asked for. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 06:18:39 2014 Received: (at 18051) by debbugs.gnu.org; 18 Jul 2014 10:18:39 +0000 Received: from localhost ([127.0.0.1]:57953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X85FK-0007rL-RR for submit@debbugs.gnu.org; Fri, 18 Jul 2014 06:18:38 -0400 Received: from mout.web.de ([212.227.15.3]:63701) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X85FE-0007r1-Iw for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 06:18:32 -0400 Received: from drachen.dragon ([94.217.127.201]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0MfHUw-1Wt9vT0auw-00Op4q; Fri, 18 Jul 2014 12:18:21 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <837g3b6ob7.fsf@gnu.org> <874myfatyo.fsf@web.de> <831ttj6lu5.fsf@gnu.org> Date: Fri, 18 Jul 2014 12:18:19 +0200 In-Reply-To: <831ttj6lu5.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 Jul 2014 12:46:26 +0300") Message-ID: <87zjg79dhw.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:zABmX4G2Vk82AR2eoxW6hSkoLO6h7xUb+4NrAaz04FX7Hn05B/r iWVRjXUnBTtz72LRbhzYNVCZxZtcKLcEhnO3OPAWliKxg7mOs4jCDf05yeD5QohSanH5G/B 5Sa+Z4UCcs8kRyqs/Ca2XvE+pDjdDXrI9XRIf2xE7nTnM+rqENn+Fn1v/0RKBG+k5oa8BB4 oHIZei3RMRfiZY2g1OLAQ== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > From my POV, making sure the package always behaves as designed, I > guess. You agreed with my motivation, so it sounds like a > contradiction to me to still push for the change. Seems I again misunderstood what you meant with: > [...] So I will generally oppose to introducing any option into it > that cannot be had with an external 'ls' program, as long as the > latter is the main method of getting a I had read that as introducing "user options", but you obviously meant introducing options for changing the behavior using any means. > Anyway, if others think the comparison of file names should be up for > grabs, I won't fight the change just because I think it's wrong. At least we agree that there's room for improvement. Anyway, what I want to reach: (1) sort in files starting with a dot as if they had no dot (2) -v sorting (sorting versions correctly) isn't that both possible with ls? (2) obviously; I think (1) depends on the system's language setting? From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 08:58:13 2014 Received: (at 18051) by debbugs.gnu.org; 18 Jul 2014 12:58:13 +0000 Received: from localhost ([127.0.0.1]:57998 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X87jo-0004Wc-Px for submit@debbugs.gnu.org; Fri, 18 Jul 2014 08:58:13 -0400 Received: from mtaout27.012.net.il ([80.179.55.183]:49726) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X87jk-0004WF-VF for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 08:58:10 -0400 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0N8W00900RMI5A00@mtaout27.012.net.il> for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 15:53:49 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N8W008H9RTPFN10@mtaout27.012.net.il>; Fri, 18 Jul 2014 15:53:49 +0300 (IDT) Date: Fri, 18 Jul 2014 15:57:52 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <87a987ht5r.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus Message-id: <83y4vq6cz3.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <87a987ht5r.fsf@gmx.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org > Date: Fri, 18 Jul 2014 12:12:48 +0200 > > >> Tramp uses ls-lisp only in case it cannot use a native method on the > >> remote host. Experience shows, that ls-lisp has a much worse performance > >> for remote directories than native implementations. > > > > Any insight as to why this happens? Perhaps the Tramp implementation > > of directory-files-and-attributes needs some love? > > Maybe it is a misunderstanding. Tramp's native implementation is much > faster, because it sends exactly one remote command. For ssh-like > connections, this is for example > > # echo "("; (/bin/ls --color=never -a | sed -e s/\$/\"/g -e s/^/\"/g | xargs \stat -c '("%n" ("%N") %h %ue0 %ge0 %Xe0 %Ye0 %Ze0 %se0 "%A" t %ie0 -1)' 2>/dev/null); echo ")" 2>/dev/null We could easily add this to ls-lisp, in case the directory is remote. Right now, it simply doesn't support remote directories, because I didn't know there was any interest in that. > I would oppose only if there is an additional mandatory functionality in > ls-lisp other file name primitives are urged to use. If there would > be changes in, let's say, directory-files-and-attributes, there's no > problem for me. But that's not what Michael has asked for. I don't think you understood what Michael wanted, but I'll let Michael speak for himself. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 09:04:01 2014 Received: (at 18051) by debbugs.gnu.org; 18 Jul 2014 13:04:01 +0000 Received: from localhost ([127.0.0.1]:58003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X87pQ-0004gT-Ua for submit@debbugs.gnu.org; Fri, 18 Jul 2014 09:04:01 -0400 Received: from mtaout26.012.net.il ([80.179.55.182]:56225) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X87pN-0004gC-Oo for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 09:03:58 -0400 Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0N8W00C00RUOO800@mtaout26.012.net.il> for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 15:59:45 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N8W005XES3L8U80@mtaout26.012.net.il>; Fri, 18 Jul 2014 15:59:45 +0300 (IDT) Date: Fri, 18 Jul 2014 16:03:41 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <87zjg79dhw.fsf@web.de> X-012-Sender: halo1@inter.net.il To: Michael Heerdegen Message-id: <83wqba6cpe.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <837g3b6ob7.fsf@gnu.org> <874myfatyo.fsf@web.de> <831ttj6lu5.fsf@gnu.org> <87zjg79dhw.fsf@web.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Heerdegen > Cc: 18051@debbugs.gnu.org > Date: Fri, 18 Jul 2014 12:18:19 +0200 > > Eli Zaretskii writes: > > > From my POV, making sure the package always behaves as designed, I > > guess. You agreed with my motivation, so it sounds like a > > contradiction to me to still push for the change. > > Seems I again misunderstood what you meant with: > > > [...] So I will generally oppose to introducing any option into it > > that cannot be had with an external 'ls' program, as long as the > > latter is the main method of getting a > > I had read that as introducing "user options", but you obviously meant > introducing options for changing the behavior using any means. Yes, I meant adding code that would support functionality not available when 'ls' is used. > > Anyway, if others think the comparison of file names should be up for > > grabs, I won't fight the change just because I think it's wrong. > > At least we agree that there's room for improvement. That's trivial: there always is, including in ls-lisp. > Anyway, what I want to reach: > > (1) sort in files starting with a dot as if they had no dot Why? Personally, it would mightily confuse me: I always expect to find all the dot-files together. This is useful, e.g., when I'm looking for init file related to some feature, but I don't know the exact name of that file. But if 'ls' supports that, so should ls-lisp. > (2) -v sorting (sorting versions correctly) Isn't this what "ls -v" does? If so, and if ls-lisp doesn't currently support that, patches to add such support are welcome. > isn't that both possible with ls? (2) obviously; I think (1) depends on > the system's language setting? Patches to support any feature available in some 'ls' are more than welcome. TIA. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 09:19:03 2014 Received: (at 18051) by debbugs.gnu.org; 18 Jul 2014 13:19:03 +0000 Received: from localhost ([127.0.0.1]:58009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X883u-00052H-S9 for submit@debbugs.gnu.org; Fri, 18 Jul 2014 09:19:02 -0400 Received: from mout.gmx.net ([212.227.15.18]:63352) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X883p-00051u-Eu for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 09:18:57 -0400 Received: from detlef.gmx.de ([87.146.37.9]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0LomN9-1WbW3x0czz-00gpa3; Fri, 18 Jul 2014 15:18:46 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <87a987ht5r.fsf@gmx.de> <83y4vq6cz3.fsf@gnu.org> Date: Fri, 18 Jul 2014 15:18:40 +0200 In-Reply-To: <83y4vq6cz3.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 Jul 2014 15:57:52 +0300") Message-ID: <8738dyiz4f.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:cwVxcBgrHClnYw3c3I4OoTNlN8X/Y2o0OpkSHq2QZl3QtG4dInj Yl9ne/O7uRsZ1vH1gmvwCzjgjp/mDohvLChzBQEm/QT/WH6BLcqb4Gm5sbxzB0BO+b90tbH h8FpY/moYZRJnZtjBHA68/5ZeNYZOREwyIWt57TGjDbUCv+9XM4plcBK3ApFnCJLPTiP2zc KGv6XJDHl++Wl2SKhqlFA== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: >> Maybe it is a misunderstanding. Tramp's native implementation is much >> faster, because it sends exactly one remote command. For ssh-like >> connections, this is for example >> >> # echo "("; (/bin/ls --color=never -a | sed -e s/\$/\"/g -e s/^/\"/g >> | xargs \stat -c '("%n" ("%N") %h %ue0 %ge0 %Xe0 %Ye0 %Ze0 %se0 "%A" >> t %ie0 -1)' 2>/dev/null); echo ")" 2>/dev/null > > We could easily add this to ls-lisp, in case the directory is remote. > Right now, it simply doesn't support remote directories, because I > didn't know there was any interest in that. No, that's not needed. Tramp does its job for different target architectures in different ways. For example, if the stat command is not available on the remote host, it uses another implementation with perl for directory-files-and-attributes, and so on. ls-lisp does not support file name handlers, and Tramp uses it only internally in case it doesn't know better. Support for remote directories would mean to add a file name handler for ls-lisp - is this what you have in mind? I don't believe it is necessary. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 09:44:57 2014 Received: (at 18051) by debbugs.gnu.org; 18 Jul 2014 13:44:57 +0000 Received: from localhost ([127.0.0.1]:58015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X88T1-0005cq-Sn for submit@debbugs.gnu.org; Fri, 18 Jul 2014 09:44:56 -0400 Received: from mtaout24.012.net.il ([80.179.55.180]:47692) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X88Sy-0005cY-9L for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 09:44:53 -0400 Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0N8W00300TMFGC00@mtaout24.012.net.il> for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 16:40:52 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N8W003MYU04HY10@mtaout24.012.net.il>; Fri, 18 Jul 2014 16:40:52 +0300 (IDT) Date: Fri, 18 Jul 2014 16:44:35 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <8738dyiz4f.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus Message-id: <83vbqu6at8.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <87a987ht5r.fsf@gmx.de> <83y4vq6cz3.fsf@gnu.org> <8738dyiz4f.fsf@gmx.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org > Date: Fri, 18 Jul 2014 15:18:40 +0200 > > Eli Zaretskii writes: > > >> Maybe it is a misunderstanding. Tramp's native implementation is much > >> faster, because it sends exactly one remote command. For ssh-like > >> connections, this is for example > >> > >> # echo "("; (/bin/ls --color=never -a | sed -e s/\$/\"/g -e s/^/\"/g > >> | xargs \stat -c '("%n" ("%N") %h %ue0 %ge0 %Xe0 %Ye0 %Ze0 %se0 "%A" > >> t %ie0 -1)' 2>/dev/null); echo ")" 2>/dev/null > > > > We could easily add this to ls-lisp, in case the directory is remote. > > Right now, it simply doesn't support remote directories, because I > > didn't know there was any interest in that. > > No, that's not needed. Tramp does its job for different target > architectures in different ways. For example, if the stat command is not > available on the remote host, it uses another implementation with perl > for directory-files-and-attributes, and so on. We are talking past each other. What I meant was to add to ls-lisp support for remote directories, which will simply invoke Tramp's handlers for that. > Support for remote directories would mean to add a file name handler > for ls-lisp - is this what you have in mind? Yes. > I don't believe it is necessary. It is necessary if ls-lisp will ever become the default. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 12:21:26 2014 Received: (at 18051) by debbugs.gnu.org; 18 Jul 2014 16:21:26 +0000 Received: from localhost ([127.0.0.1]:58540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8AuQ-0001pY-B0 for submit@debbugs.gnu.org; Fri, 18 Jul 2014 12:21:26 -0400 Received: from mout.gmx.net ([212.227.15.19]:53544) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8AuK-0001p4-L3 for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 12:21:21 -0400 Received: from detlef.gmx.de ([87.146.37.9]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MDQp3-1XK2rT0H41-00Gmnf; Fri, 18 Jul 2014 18:21:10 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <87a987ht5r.fsf@gmx.de> <83y4vq6cz3.fsf@gnu.org> <8738dyiz4f.fsf@gmx.de> <83vbqu6at8.fsf@gnu.org> Date: Fri, 18 Jul 2014 18:21:05 +0200 In-Reply-To: <83vbqu6at8.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 Jul 2014 16:44:35 +0300") Message-ID: <87wqbahc3y.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:eohBuOf9umC4PKuof6GTXiPjFnu6ZOZxc+nwhHzWGRBCApGMA0f X6jgERdMZKrt9Kk1zV9jHc1V0cooVgsxU9/5UIhDvCeNCdd/gAon7SSHaPFRokq+c8z6zVB xbLHcbJe6VY/4ayBwtq0ABlm4D3YLxqPe5vLo0e1rQJ1HwBc+PVlwgttvnP7h7xxdmWMZRi Z7PQUWcwZDYz3YUtwWYvw== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: >> Support for remote directories would mean to add a file name handler >> for ls-lisp - is this what you have in mind? > > Yes. > >> I don't believe it is necessary. > > It is necessary if ls-lisp will ever become the default. Well, in this case I don't know which functionality shall be added to ls-lisp-insert-directory, which couldn't be added directly to insert-directory. The latter function calls file name handlers already, if needed. (I still have the impression we're speaking about different topics. Sorry for my stupidness) Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 21:25:16 2014 Received: (at 18051) by debbugs.gnu.org; 19 Jul 2014 01:25:16 +0000 Received: from localhost ([127.0.0.1]:58745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8JOl-0006h3-AY for submit@debbugs.gnu.org; Fri, 18 Jul 2014 21:25:16 -0400 Received: from mout.web.de ([212.227.15.3]:56777) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8JOh-0006gl-LM for 18051@debbugs.gnu.org; Fri, 18 Jul 2014 21:25:12 -0400 Received: from drachen.dragon ([94.217.127.201]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0MaHHc-1WoR3m2p2G-00Jstn; Sat, 19 Jul 2014 03:25:02 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <837g3b6ob7.fsf@gnu.org> <874myfatyo.fsf@web.de> <831ttj6lu5.fsf@gnu.org> <87zjg79dhw.fsf@web.de> <83wqba6cpe.fsf@gnu.org> Date: Sat, 19 Jul 2014 03:25:01 +0200 In-Reply-To: <83wqba6cpe.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 Jul 2014 16:03:41 +0300") Message-ID: <8761iujg2a.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:YjmTjfXyREaJiwlJuLMdN/ytC3N2uHRfIZDN1HVoALv5kOpuqIQ EOjvc0KKYVoBvxEmlmZr1/wl6l9rcXI+zFwpKdo6uNIi6piocLfIo68TW0dEocsJcohfL7F aDnJj1uM/d9SO5dfyw51Cw5NyK1uYpGoo866zp1lIZORxd+tOUxXiqC+rnXxS3ms5MVX9iA E1ApxWavhQzoHlLqPQjLQ== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > > Anyway, what I want to reach: > > > > (1) sort in files starting with a dot as if they had no dot > > Why? Personally, it would mightily confuse me: I always expect to > find all the dot-files together. This is useful, e.g., when I'm > looking for init file related to some feature, but I don't know the > exact name of that file. But currently all dot files are listed before all the other files. I find that annoying most of the time. Dunno yet if I like my current setup, I'll see - but over the current sorting, I would much prefer having all the dot files at the end. (I don't know if this is possible with ls.) > But if 'ls' supports that, so should ls-lisp. It depends on "locale" settings. I tried some settings of the LC_ALL variable. With "C" or "POSIX", I get the same sorting as with ls-lisp. OTOH, with "en_US.utf8" or "de_DE.utf8" I get the sorting I described, with dot files merged with the other files. > > (2) -v sorting (sorting versions correctly) > > Isn't this what "ls -v" does? If so, and if ls-lisp doesn't currently > support that, patches to add such support are welcome. ls -v sorts backup versions in their natural order (which is not the lexicographic order). Yes, would be good to have that in ls-lisp, and should not be too hard. I can give it a try when I get the time. But I'm not sure what would have to be done about the locale depend part. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 19 04:17:33 2014 Received: (at 18051) by debbugs.gnu.org; 19 Jul 2014 08:17:33 +0000 Received: from localhost ([127.0.0.1]:58939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8Ppk-0008Hg-Nb for submit@debbugs.gnu.org; Sat, 19 Jul 2014 04:17:33 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:51225) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8Pph-0008HO-B8 for 18051@debbugs.gnu.org; Sat, 19 Jul 2014 04:17:30 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0N8Y003009G2UC00@a-mtaout20.012.net.il> for 18051@debbugs.gnu.org; Sat, 19 Jul 2014 11:17:22 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N8Y003GX9OYMB60@a-mtaout20.012.net.il>; Sat, 19 Jul 2014 11:17:22 +0300 (IDT) Date: Sat, 19 Jul 2014 11:17:15 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <8761iujg2a.fsf@web.de> X-012-Sender: halo1@inter.net.il To: Michael Heerdegen Message-id: <83lhrp69v8.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <837g3b6ob7.fsf@gnu.org> <874myfatyo.fsf@web.de> <831ttj6lu5.fsf@gnu.org> <87zjg79dhw.fsf@web.de> <83wqba6cpe.fsf@gnu.org> <8761iujg2a.fsf@web.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Heerdegen > Cc: 18051@debbugs.gnu.org > Date: Sat, 19 Jul 2014 03:25:01 +0200 > > over the current sorting, I would much prefer having all the dot > files at the end. (I don't know if this is possible with ls.) If 'ls' cannot do that, I think we should have this in Dired. > > But if 'ls' supports that, so should ls-lisp. > > It depends on "locale" settings. I tried some settings of the LC_ALL > variable. With "C" or "POSIX", I get the same sorting as with ls-lisp. > OTOH, with "en_US.utf8" or "de_DE.utf8" I get the sorting I described, > with dot files merged with the other files. AFAICT, 'ls' uses strcoll. I don't see how can that effectively ignore the leading dot, but maybe I'm missing something. OTOH, if the UTF-8 codeset says the leading dot should be ignored, then ls-lisp should do the same by default, at least when the locale's codeset is UTF-8. Can you see the answer in 'ls' sources? Does just "en_US" or "en_US.8859-1" change the order? > > > (2) -v sorting (sorting versions correctly) > > > > Isn't this what "ls -v" does? If so, and if ls-lisp doesn't currently > > support that, patches to add such support are welcome. > > ls -v sorts backup versions in their natural order (which is not the > lexicographic order). Yes, would be good to have that in ls-lisp, and > should not be too hard. I can give it a try when I get the time. Thanks. > I'm not sure what would have to be done about the locale depend part. Assuming it's indeed the locale thing, Emacs doesn't yet support locale-specific sorting. But we could do that in some ad-hoc manner anyway. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 19 06:52:46 2014 Received: (at 18051) by debbugs.gnu.org; 19 Jul 2014 10:52:46 +0000 Received: from localhost ([127.0.0.1]:59046 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8SFy-0003XR-3K for submit@debbugs.gnu.org; Sat, 19 Jul 2014 06:52:46 -0400 Received: from mout.web.de ([212.227.15.3]:63395) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8SFu-0003XC-2H for 18051@debbugs.gnu.org; Sat, 19 Jul 2014 06:52:42 -0400 Received: from drachen.dragon ([94.217.127.201]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0LqoAk-1WdGMa296A-00eINc; Sat, 19 Jul 2014 12:52:34 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <837g3b6ob7.fsf@gnu.org> <874myfatyo.fsf@web.de> <831ttj6lu5.fsf@gnu.org> <87zjg79dhw.fsf@web.de> <83wqba6cpe.fsf@gnu.org> <8761iujg2a.fsf@web.de> <83lhrp69v8.fsf@gnu.org> Date: Sat, 19 Jul 2014 12:52:33 +0200 In-Reply-To: <83lhrp69v8.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 19 Jul 2014 11:17:15 +0300") Message-ID: <87a985sjri.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:akD9Wjk7id0G7feYZ9xtnEl2PZ85HtjFdOh65SHHt9NlYHXj+X0 Pkytz4ohAOb2jjJqO1XUdhcb0b8XueEINMEtdHf7YecHS32Uc+8Ru3FkRODPzkwJWDR1shX TZjDPjo6kvcIJM076xHuGbkbFpIM7kl670jqpKR8ZRCRmUQq13WDIL2qbRrURMBowesL6BK 0/oDwpjqiWUExwSsYaVXg== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > AFAICT, 'ls' uses strcoll. I don't see how can that effectively > ignore the leading dot, but maybe I'm missing something. Yes, it uses strcoll. > Can you see the answer in 'ls' sources? No, I don't see anything related in the sources, it just calls strcoll (or strcmp as fallback), nothing more. I compiled some test program calling strcoll, and there it didn't ignore the dot. Sorry, I don't why this is different in ls. > Does just "en_US" or "en_US.8859-1" change the order? Yes! ls -al with en_US behaves the same as with en_US.utf8, dots are ignored. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 19 06:56:20 2014 Received: (at 18051) by debbugs.gnu.org; 19 Jul 2014 10:56:20 +0000 Received: from localhost ([127.0.0.1]:59050 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8SJQ-0003ci-6g for submit@debbugs.gnu.org; Sat, 19 Jul 2014 06:56:20 -0400 Received: from mtaout21.012.net.il ([80.179.55.169]:49488) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8SJN-0003cR-H2 for 18051@debbugs.gnu.org; Sat, 19 Jul 2014 06:56:19 -0400 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0N8Y00E00GT38L00@a-mtaout21.012.net.il> for 18051@debbugs.gnu.org; Sat, 19 Jul 2014 13:56:09 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N8Y00EPYH1L8O00@a-mtaout21.012.net.il>; Sat, 19 Jul 2014 13:56:09 +0300 (IDT) Date: Sat, 19 Jul 2014 13:56:02 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <83lhrp69v8.fsf@gnu.org> X-012-Sender: halo1@inter.net.il To: michael_heerdegen@web.de Message-id: <83fvhx62il.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <837g3b6ob7.fsf@gnu.org> <874myfatyo.fsf@web.de> <831ttj6lu5.fsf@gnu.org> <87zjg79dhw.fsf@web.de> <83wqba6cpe.fsf@gnu.org> <8761iujg2a.fsf@web.de> <83lhrp69v8.fsf@gnu.org> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Sat, 19 Jul 2014 11:17:15 +0300 > From: Eli Zaretskii > Cc: 18051@debbugs.gnu.org > > > > But if 'ls' supports that, so should ls-lisp. > > > > It depends on "locale" settings. I tried some settings of the LC_ALL > > variable. With "C" or "POSIX", I get the same sorting as with ls-lisp. > > OTOH, with "en_US.utf8" or "de_DE.utf8" I get the sorting I described, > > with dot files merged with the other files. > > AFAICT, 'ls' uses strcoll. I don't see how can that effectively > ignore the leading dot, but maybe I'm missing something. I think I know the answer: those versions of 'ls' that do this are based on libc implementation that supports UTS#10, the Unicode Collation Algorithm, or at least part of it. UTS#10 specifies a multi-level comparison, whereby base characters, accents, and letter-case variants are compared before punctuation characters. > OTOH, if the UTF-8 codeset says the leading dot should be ignored, > then ls-lisp should do the same by default, at least when the > locale's codeset is UTF-8. For this, we would need a UTS#10 compatible compare-strings. Then ls-lisp could simply use it when the locale is .UTF-8. Alternatively, we could have an approximation to that, just for sorting non-punctuation characters before the punctuation characters. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 20 01:50:04 2014 Received: (at 18051) by debbugs.gnu.org; 20 Jul 2014 05:50:04 +0000 Received: from localhost ([127.0.0.1]:59919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8k0Z-0007Z6-33 for submit@debbugs.gnu.org; Sun, 20 Jul 2014 01:50:03 -0400 Received: from mout.web.de ([212.227.17.12]:51534) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8k0U-0007YI-OH for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 01:50:00 -0400 Received: from drachen.dragon ([94.217.127.201]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0Lr2dj-1WdF4H0gap-00eedT; Sun, 20 Jul 2014 07:49:50 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <87a987ht5r.fsf@gmx.de> <83y4vq6cz3.fsf@gnu.org> Date: Sun, 20 Jul 2014 07:49:48 +0200 In-Reply-To: <83y4vq6cz3.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 18 Jul 2014 15:57:52 +0300") Message-ID: <87tx6c7f5v.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:/iJb5wifGQNIFRBloGO29TnCTJi0ad8JegWqMSZQNE6tFVefLZX hb+67pX9cvFvHyaNmzdhIhY10FpIuYPHDUltHFuyV74uRKJ3MrVg7thsu+YU4iQsxZXDXDE JYRfte66B1fIM6SUQ+xp5ziC26liZUPWwRF2qtFiM49O8Mw+LIWeXLfT74pAztmvrSeIKTp i6U1s7yFgvYh5c2cbAGgA== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, Michael Albinus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > I don't think you understood what Michael wanted, but I'll let Michael > speak for himself. I don't use Tramp often currently. Generally, I switched to ls-lisp because I liked that it gives me more control over how dired looks like. Sorting is one only thing (that could probably be done with Tramp). There are other things. What I don't like from ls is that it shows symlinks like this: lrwxrwxrwx ... ... rwxrwxrwx is redundant. When you use M on a link in dired, you actually set the modes of the target. I want to see the target file's modes, so I use this: ,---------------------------------------------------------------------- | (defun my-ls-lisp-treat-symlinks-ad (file-alist &rest _) | "Make it show modes of truenames for symlinks." | (mapc (lambda (file-line) | (let ((filename (expand-file-name (car file-line) | default-directory)) | modes-string) | (when (file-symlink-p filename) | (setq modes-string (nth 8 (file-attributes | (file-truename filename)))) | (if (not modes-string) ;; link could be dead! | (setq modes-string "l?????????") | (aset modes-string 0 ?l)) | (setf (nth 9 file-line) modes-string)))) | file-alist) | file-alist) | | (advice-add 'ls-lisp-handle-switches :after #'my-ls-lisp-treat-symlinks-ad) `---------------------------------------------------------------------- AFAIK this can't be reached with ls. Just one example. Trying to do such things with Tramp would probably indeed slow it down. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 20 02:08:04 2014 Received: (at 18051) by debbugs.gnu.org; 20 Jul 2014 06:08:04 +0000 Received: from localhost ([127.0.0.1]:59929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8kHz-00088h-R3 for submit@debbugs.gnu.org; Sun, 20 Jul 2014 02:08:04 -0400 Received: from mtaout24.012.net.il ([80.179.55.180]:42334) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8kHw-000889-Lh for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 02:08:02 -0400 Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0N8Z00400XR48O00@mtaout24.012.net.il> for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 09:03:58 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N8Z002V3Y6M2G40@mtaout24.012.net.il>; Sun, 20 Jul 2014 09:03:58 +0300 (IDT) Date: Sun, 20 Jul 2014 09:07:48 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <87tx6c7f5v.fsf@web.de> X-012-Sender: halo1@inter.net.il To: Michael Heerdegen Message-id: <8338dw5zrf.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <87a987ht5r.fsf@gmx.de> <83y4vq6cz3.fsf@gnu.org> <87tx6c7f5v.fsf@web.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Heerdegen > Cc: Michael Albinus , 18051@debbugs.gnu.org > Date: Sun, 20 Jul 2014 07:49:48 +0200 > > There are other things. What I don't like from ls is that it shows > symlinks like this: > > lrwxrwxrwx ... ... > > rwxrwxrwx is redundant. It's what 'lstat' returns. > When you use M on a link in dired, you actually > set the modes of the target. I want to see the target file's modes, so > I use this: > > ,---------------------------------------------------------------------- > | (defun my-ls-lisp-treat-symlinks-ad (file-alist &rest _) > | "Make it show modes of truenames for symlinks." > | (mapc (lambda (file-line) > | (let ((filename (expand-file-name (car file-line) > | default-directory)) > | modes-string) > | (when (file-symlink-p filename) > | (setq modes-string (nth 8 (file-attributes > | (file-truename filename)))) > | (if (not modes-string) ;; link could be dead! > | (setq modes-string "l?????????") > | (aset modes-string 0 ?l)) > | (setf (nth 9 file-line) modes-string)))) > | file-alist) > | file-alist) > | > | (advice-add 'ls-lisp-handle-switches :after #'my-ls-lisp-treat-symlinks-ad) > `---------------------------------------------------------------------- > > AFAIK this can't be reached with ls. Doesn't "ls -L" give you that? > Just one example. Trying to do such things with Tramp would > probably indeed slow it down. IMO, the right way to do this is to have an additional argument to file-attributes, follow-symlinks, with the obvious semantics. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 20 02:18:23 2014 Received: (at 18051) by debbugs.gnu.org; 20 Jul 2014 06:18:23 +0000 Received: from localhost ([127.0.0.1]:59933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8kRz-0008NR-1x for submit@debbugs.gnu.org; Sun, 20 Jul 2014 02:18:23 -0400 Received: from mout.web.de ([212.227.15.4]:52733) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8kRv-0008NC-VO for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 02:18:21 -0400 Received: from drachen.dragon ([94.217.127.201]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0MfqC4-1WwYit3ZBs-00N8T1; Sun, 20 Jul 2014 08:18:12 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <87a987ht5r.fsf@gmx.de> <83y4vq6cz3.fsf@gnu.org> <87tx6c7f5v.fsf@web.de> Date: Sun, 20 Jul 2014 08:18:08 +0200 In-Reply-To: <87tx6c7f5v.fsf@web.de> (Michael Heerdegen's message of "Sun, 20 Jul 2014 07:49:48 +0200") Message-ID: <87pph07dun.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:yrjm2c7neJ18zwuk3WCGc9J81EbGE2Ww6nwJawDghn79nmhviy4 ob6OgseLERGxA5TxQj/hHpNKGZYUwfob6xQGC6IUVmvMHs+giyXVJlYRAj1rHtvRcwH21Ek GIpHgRYgm/jDIumgtT6s2QWfrja83hT73vWYtqiF/IuwfB3Lm/tOahTa4fngH8Xdbqr49sv 47FksyJFjc/PSiwahZ7cA== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, Michael Albinus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Michael Heerdegen writes: > | (advice-add 'ls-lisp-handle-switches > :after #'my-ls-lisp-treat-symlinks-ad) And I understand that users should not be encouraged to do such things. Being 1:1 ls compatible has many advantages, but it makes dired unusually inflexible compared to other Emacs packages. That's why I said I wished ls-lisp - or some other configurable mechanism - would be the default. I didn't think of Tramp when I said that. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 20 02:21:38 2014 Received: (at 18051) by debbugs.gnu.org; 20 Jul 2014 06:21:38 +0000 Received: from localhost ([127.0.0.1]:59937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8kV7-0008SZ-Og for submit@debbugs.gnu.org; Sun, 20 Jul 2014 02:21:38 -0400 Received: from mout.web.de ([212.227.15.3]:53602) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8kV4-0008SI-MS for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 02:21:35 -0400 Received: from drachen.dragon ([94.217.127.201]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0MhOpG-1Wuua20oIk-00Mca6; Sun, 20 Jul 2014 08:21:28 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <87a987ht5r.fsf@gmx.de> <83y4vq6cz3.fsf@gnu.org> <87tx6c7f5v.fsf@web.de> <8338dw5zrf.fsf@gnu.org> Date: Sun, 20 Jul 2014 08:21:27 +0200 In-Reply-To: <8338dw5zrf.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 20 Jul 2014 09:07:48 +0300") Message-ID: <87lhro7dp4.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:k7HWcL/qNWdf0YYglESxxj/SmFDjaTh60vMu6O9UnhmadA6cutn 1jbM9rmbdFMnTeb4zSMMg+IpZ/HwGqTmV70vK8ALWD1NFy+DyXUZyoJp9kqKOInGk+4qyqF a+x8kkRl1xBJwzyEBG/ksFwTcrwc5crJBKDnAsFUyr/b6X/CH6m+8CJBECcUiMkV4e91tw/ bW4xIdUoDisHxVbBpzfpA== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > Doesn't "ls -L" give you that? That's worse. Then I don't even see at all that the file is a symlink, it is shown as a regular file. I had tried that, and found it very confusing. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 20 02:34:14 2014 Received: (at 18051) by debbugs.gnu.org; 20 Jul 2014 06:34:15 +0000 Received: from localhost ([127.0.0.1]:59941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8khK-0000Jm-2P for submit@debbugs.gnu.org; Sun, 20 Jul 2014 02:34:14 -0400 Received: from mtaout26.012.net.il ([80.179.55.182]:45124) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8khG-0000JV-F3 for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 02:34:11 -0400 Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0N8Z00300ZE0ZR00@mtaout26.012.net.il> for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 09:30:03 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N8Z00OLXZE3LS40@mtaout26.012.net.il>; Sun, 20 Jul 2014 09:30:03 +0300 (IDT) Date: Sun, 20 Jul 2014 09:33:58 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <87lhro7dp4.fsf@web.de> X-012-Sender: halo1@inter.net.il To: Michael Heerdegen Message-id: <83zjg44jzd.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <87a987ht5r.fsf@gmx.de> <83y4vq6cz3.fsf@gnu.org> <87tx6c7f5v.fsf@web.de> <8338dw5zrf.fsf@gnu.org> <87lhro7dp4.fsf@web.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Heerdegen > Cc: michael.albinus@gmx.de, 18051@debbugs.gnu.org > Date: Sun, 20 Jul 2014 08:21:27 +0200 > > Eli Zaretskii writes: > > > Doesn't "ls -L" give you that? > > That's worse. Then I don't even see at all that the file is a symlink, > it is shown as a regular file. I had tried that, and found it very > confusing. Why is it important to you to know that the file is a symlink, if you always want to change its target? From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 20 03:30:48 2014 Received: (at 18051) by debbugs.gnu.org; 20 Jul 2014 07:30:48 +0000 Received: from localhost ([127.0.0.1]:59949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8la2-0001gF-T3 for submit@debbugs.gnu.org; Sun, 20 Jul 2014 03:30:47 -0400 Received: from mout.web.de ([212.227.17.12]:62145) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8lZy-0001fv-K4 for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 03:30:43 -0400 Received: from drachen.dragon ([94.217.127.201]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0MX0Q4-1X5Lor0UOi-00VxYf; Sun, 20 Jul 2014 09:30:33 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <87a987ht5r.fsf@gmx.de> <83y4vq6cz3.fsf@gnu.org> <87tx6c7f5v.fsf@web.de> <8338dw5zrf.fsf@gnu.org> <87lhro7dp4.fsf@web.de> <83zjg44jzd.fsf@gnu.org> Date: Sun, 20 Jul 2014 09:30:32 +0200 In-Reply-To: <83zjg44jzd.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 20 Jul 2014 09:33:58 +0300") Message-ID: <87wqb8mqqv.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:YN67xDTmKkYyCcDDMFwVOtxxXUcOUMKz2M6X8VTjmgrIFCM8jS+ myv92qjogZQocHQ8elvARvKzJg4u4cov+h0UFkjAtnYg42ZKRgN9fAuneHqlZne4p3nU6k4 DYn/hdPLFSUK9LPwCwC+z+/bB4S3uQUmXQ5o0nXUeo0T2IlaSY/rCkbu6K1bPL5IrjjvMKr zCJ88G1cegus8HXmQ0yvw== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > Why is it important to you to know that the file is a symlink, if you > always want to change its target? That's what I want for file modes - but still I want to know/see what I'm doing! And it makes a difference in the organization of the file system. You can use symlinks as some kind of shortcut to move within the file system more quickly. It makes a difference if you remove a shortcut or if you erase a whole directory with all its files from your hard drive. It also makes a difference when you think you make a local change, and actually cause changes "somewhere else" in the file system. The funniest thing you could do would be to delete the target because you think you have two identical versions of a file/directory in your filesystem, and then are shocked because the second version turns out to be a dead link after that. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 20 04:14:48 2014 Received: (at 18051) by debbugs.gnu.org; 20 Jul 2014 08:14:48 +0000 Received: from localhost ([127.0.0.1]:59953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8mGe-0002ia-5B for submit@debbugs.gnu.org; Sun, 20 Jul 2014 04:14:48 -0400 Received: from mtaout26.012.net.il ([80.179.55.182]:37430) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8mGb-0002iL-1F for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 04:14:46 -0400 Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0N90005003RUL000@mtaout26.012.net.il> for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 11:10:37 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9000N3T41PIW90@mtaout26.012.net.il>; Sun, 20 Jul 2014 11:10:37 +0300 (IDT) Date: Sun, 20 Jul 2014 11:14:32 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <87wqb8mqqv.fsf@web.de> X-012-Sender: halo1@inter.net.il To: Michael Heerdegen Message-id: <83y4vo4fbr.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <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> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Heerdegen > Cc: michael.albinus@gmx.de, 18051@debbugs.gnu.org > Date: Sun, 20 Jul 2014 09:30:32 +0200 > > Eli Zaretskii writes: > > > Why is it important to you to know that the file is a symlink, if you > > always want to change its target? > > That's what I want for file modes - but still I want to know/see what > I'm doing! But the same problem exists with the size, the time stamp, the UID/GID, the inode -- you name it. I fail to see how seeing the mode bits of the target is important, but the same is not true for the rest of the attributes. Or are you just saying that you want to see the attributes of the target, and _also_ the fact that the file is a symlink? > And it makes a difference in the organization of the file system. You > can use symlinks as some kind of shortcut to move within the file system > more quickly. It makes a difference if you remove a shortcut or if you > erase a whole directory with all its files from your hard drive. It > also makes a difference when you think you make a local change, and > actually cause changes "somewhere else" in the file system. This just means that we should have an easy way of switching between the -L view and the non-L view. Would that solve the problem? From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 20 04:25:06 2014 Received: (at 18051) by debbugs.gnu.org; 20 Jul 2014 08:25:06 +0000 Received: from localhost ([127.0.0.1]:59961 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8mQc-0002yN-0b for submit@debbugs.gnu.org; Sun, 20 Jul 2014 04:25:06 -0400 Received: from mout.web.de ([212.227.15.4]:58256) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8mQZ-0002xq-80 for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 04:25:04 -0400 Received: from drachen.dragon ([94.217.127.201]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0Lzrwh-1WUNSC2p99-0154Lj; Sun, 20 Jul 2014 10:24:51 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <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> Date: Sun, 20 Jul 2014 10:24:46 +0200 In-Reply-To: <83y4vo4fbr.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 20 Jul 2014 11:14:32 +0300") Message-ID: <87silwmo8h.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:NoLuB8MsPP8vtABfYPAuWXy1Ehbsq5Tt+hIro2IuJSVDsWYRPlI k528ly24LxVHIJXxK0GV+ZWkRj4c763XD8Okq5xDEwMaVIeTh5GnVLDch+eJReWst5x5GNe 00sICebhsL0Pn+ij6EyT1r2A4gH0f8s23A1cuHHaDAy4pRdxhitNo1fojKLtx2+RMVztqFS VoutZRRGjj+/5ir5SnkSQ== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > Or are you just saying that you want to see the attributes of the > target, and _also_ the fact that the file is a symlink? Yes, exactly. > This just means that we should have an easy way of switching between > the -L view and the non-L view. Would that solve the problem? That would not be bad, although personally I would prefer one view providing all relevant information, even when that's not ls conform. But even more important would be to an easy way to sort by size and such. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 20 04:38:53 2014 Received: (at 18051) by debbugs.gnu.org; 20 Jul 2014 08:38:53 +0000 Received: from localhost ([127.0.0.1]:59967 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8mdw-0003LK-MF for submit@debbugs.gnu.org; Sun, 20 Jul 2014 04:38:53 -0400 Received: from mtaout28.012.net.il ([80.179.55.184]:50755) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8mdt-0003L7-Ts for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 04:38:50 -0400 Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0N9000I005A43S00@mtaout28.012.net.il> for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 11:38:27 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N90009DJ5C3HC90@mtaout28.012.net.il>; Sun, 20 Jul 2014 11:38:27 +0300 (IDT) Date: Sun, 20 Jul 2014 11:38:38 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <87silwmo8h.fsf@web.de> X-012-Sender: halo1@inter.net.il To: Michael Heerdegen Message-id: <83wqb84e7l.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <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> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Heerdegen > Cc: michael.albinus@gmx.de, 18051@debbugs.gnu.org > Date: Sun, 20 Jul 2014 10:24:46 +0200 > > Eli Zaretskii writes: > > > Or are you just saying that you want to see the attributes of the > > target, and _also_ the fact that the file is a symlink? > > Yes, exactly. > > > This just means that we should have an easy way of switching between > > the -L view and the non-L view. Would that solve the problem? > > That would not be bad, although personally I would prefer one view > providing all relevant information, even when that's not ls conform. Should be possible on the Dired level. > But even more important would be to an easy way to sort by size and > such. That is already available (e.g., sorting by size is triggered by the "-S" switch). I think that one important conclusion from this discussion is that we need to have a way to sort files names in a way that is at least partially compliant with UTS#10, to produce listings that are similar to what 'ls' does on GNU systems under UTF-8 locales. I hope someone will step forward to write the necessary code. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 20 05:15:52 2014 Received: (at 18051) by debbugs.gnu.org; 20 Jul 2014 09:15:52 +0000 Received: from localhost ([127.0.0.1]:59991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8nDj-0004Ll-Vd for submit@debbugs.gnu.org; Sun, 20 Jul 2014 05:15:52 -0400 Received: from mout.web.de ([212.227.15.4]:50721) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8nDg-0004LU-Lw for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 05:15:49 -0400 Received: from drachen.dragon ([94.217.127.201]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0Md16Y-1WqiOv3KT4-00IEwp; Sun, 20 Jul 2014 11:15:40 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <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> Date: Sun, 20 Jul 2014 11:15:38 +0200 In-Reply-To: <83wqb84e7l.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 20 Jul 2014 11:38:38 +0300") Message-ID: <87oawkmlvp.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:LNsXnO8fYrksGEyqg9URYvKP0VnKe//CszRRpmAb6P5yZf7b7e/ xgGkrwOvaDPxOWCgw4+UOi5rpFQoKROLmAAWabqqjANcpfjlZXs1eN+CHOMjpBwAsC1kz+a j/pJoMYZYr3q1KLrA9aMjslp+KbFL4IeKf0dSxRtgkDyulRzPi6Y7E+iFV4EyKO4j328/FI OwRqaIk67isY37P4naiEA== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > That is already available (e.g., sorting by size is triggered by the > "-S" switch). But very inconveniently: C-u s [edit minibuffer] RET. It would be more convenient when s without prefix would cycle between more then two sorting orders, and when this would be configurable. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 20 05:19:15 2014 Received: (at 18051) by debbugs.gnu.org; 20 Jul 2014 09:19:15 +0000 Received: from localhost ([127.0.0.1]:59999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8nH0-0004RT-EK for submit@debbugs.gnu.org; Sun, 20 Jul 2014 05:19:14 -0400 Received: from mtaout27.012.net.il ([80.179.55.183]:58373) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8nGx-0004RC-DN for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 05:19:12 -0400 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0N9000M006UDAW00@mtaout27.012.net.il> for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 12:14:48 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9000GQI70NWG60@mtaout27.012.net.il>; Sun, 20 Jul 2014 12:14:47 +0300 (IDT) Date: Sun, 20 Jul 2014 12:18:59 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <87oawkmlvp.fsf@web.de> X-012-Sender: halo1@inter.net.il To: Michael Heerdegen Message-id: <83vbqs4ccc.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <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> <87oawkmlvp.fsf@web.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Heerdegen > Cc: michael.albinus@gmx.de, 18051@debbugs.gnu.org > Date: Sun, 20 Jul 2014 11:15:38 +0200 > > It would be more convenient when s without prefix would cycle between > more then two sorting orders, and when this would be configurable. Sounds like a good idea to me. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 20 07:44:31 2014 Received: (at 18051) by debbugs.gnu.org; 20 Jul 2014 11:44:31 +0000 Received: from localhost ([127.0.0.1]:60031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8pXa-0000it-Jc for submit@debbugs.gnu.org; Sun, 20 Jul 2014 07:44:30 -0400 Received: from mout.gmx.net ([212.227.17.21]:55907) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8pXY-0000ig-3c for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 07:44:29 -0400 Received: from detlef.gmx.de ([87.146.61.166]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0M9bYB-1XFfAO1pct-00D0Nw; Sun, 20 Jul 2014 13:44:15 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <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> Date: Sun, 20 Jul 2014 13:44:07 +0200 In-Reply-To: <83wqb84e7l.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 20 Jul 2014 11:38:38 +0300") Message-ID: <87iomsgsqg.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:xz9PInN/b7NJEZ+Y81NRLKLmJ3zV6bN1qBdJbZzkBm08ED2nC2g 8oAntpKCAN9x8akZo1d6TdBYhpYx28fiNMWoh1VyYYmE2/M6U7HoBG4H8UDWccvtq6bw3lY 3MEVTWV4ZVOIr+HApDMwQjQ/RM7UFcnbzEu2tPFWTJKGb3+oqvLZCeGWXuMCkYiCM2opi+F bH5gXNCR2Sef+S5Bg2CkQ== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: Michael Heerdegen , 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > I think that one important conclusion from this discussion is that we > need to have a way to sort files names in a way that is at least > partially compliant with UTS#10, to produce listings that are similar > to what 'ls' does on GNU systems under UTF-8 locales. I hope someone > will step forward to write the necessary code. Programs like `ls' honor the LC_COLLATE environment variable. Emacs shall do it as well. This shouldn't affect only directory listings, but could be used also for string searches. Maybe we should expose glib's g_utf8_collate() on Lisp level. On systems without glib, we might emulate it partially. Packages like ls-lisp could use it then for sorting. I have no clear forecast on my time budget next weeks. If possible, I would play with this. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 20 07:59:56 2014 Received: (at 18051) by debbugs.gnu.org; 20 Jul 2014 11:59:56 +0000 Received: from localhost ([127.0.0.1]:60037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8pmV-00014k-B2 for submit@debbugs.gnu.org; Sun, 20 Jul 2014 07:59:55 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:37608) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8pmS-00014U-1u for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 07:59:53 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0N9000I00EFDAR00@a-mtaout20.012.net.il> for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 14:59:21 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9000H1QEMXSHA0@a-mtaout20.012.net.il>; Sun, 20 Jul 2014 14:59:21 +0300 (IDT) Date: Sun, 20 Jul 2014 14:59:16 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <87iomsgsqg.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus Message-id: <83tx6c44x7.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <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> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Cc: Michael Heerdegen , 18051@debbugs.gnu.org > Date: Sun, 20 Jul 2014 13:44:07 +0200 > > Programs like `ls' honor the LC_COLLATE environment variable. Emacs > shall do it as well. That's clear, and is not the issue. The issue is why (and how) does having UTF-8 in the codeset part of the locale cause sorting to sort as 'ls' does on GNU platforms. And the answer is that the sorting should implement UTS#10, which I'm not sure every platform does in its standard C library. > This shouldn't affect only directory listings, but could be used > also for string searches. That is a much larger job, and it's not clear how to do it best. Emacs supports different languages in different buffers, and setting and resetting LC_COLLATE for each buffer is not a good idea, IMO, because thread-local locales are not well supported outside glibc (AFAIK). > Maybe we should expose glib's g_utf8_collate() on Lisp level. Are you sure this does the job? Glib docs are minimal, and don't seem to mention UTS#10. E.g., if g_utf8_collate relies on the underlying libc's strcoll, we are back at square one. > On systems without glib, we might emulate it partially. Packages > like ls-lisp could use it then for sorting. I think we need our own implementation in any case. If nothing else, that would solve the issue of encoding strings into UTF-8 before calling external C functions. > I have no clear forecast on my time budget next weeks. If possible, I > would play with this. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 20 10:22:53 2014 Received: (at 18051) by debbugs.gnu.org; 20 Jul 2014 14:22:53 +0000 Received: from localhost ([127.0.0.1]:60442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8s0q-0004Ys-D9 for submit@debbugs.gnu.org; Sun, 20 Jul 2014 10:22:52 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:39511) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8s0n-0004Yc-P3 for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 10:22:50 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giYBAQRWIxALNBIUGA0kiAzSGReOegeEOASpGYFqgXGBWyE X-IPAS-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwaDSr0vgw6BFxd0giYBAQRWIxALNBIUGA0kiAzSGReOegeEOASpGYFqgXGBWyE X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="78447945" Received: from 75-119-224-253.dsl.teksavvy.com (HELO ceviche.home) ([75.119.224.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 Jul 2014 10:22:41 -0400 Received: by ceviche.home (Postfix, from userid 20848) id E6653664B7; Sun, 20 Jul 2014 10:22:42 -0400 (EDT) From: Stefan Monnier To: Michael Heerdegen Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? Message-ID: References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <87a987ht5r.fsf@gmx.de> <83y4vq6cz3.fsf@gnu.org> <87tx6c7f5v.fsf@web.de> <87pph07dun.fsf@web.de> Date: Sun, 20 Jul 2014 10:22:42 -0400 In-Reply-To: <87pph07dun.fsf@web.de> (Michael Heerdegen's message of "Sun, 20 Jul 2014 08:18:08 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, Eli Zaretskii , Michael Albinus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> | (advice-add 'ls-lisp-handle-switches >> | :after #'my-ls-lisp-treat-symlinks-ad) > And I understand that users should not be encouraged to do such things. Actually, while they're not encouraged, I definitely don't want to discourage users from using defadvice or advice-add. It's strongly discouraged within Emacs, and mildly discouraged for external packages, but it's not discouraged for end-users. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 20 11:26:23 2014 Received: (at 18051) by debbugs.gnu.org; 20 Jul 2014 15:26:23 +0000 Received: from localhost ([127.0.0.1]:60484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8t0I-000685-46 for submit@debbugs.gnu.org; Sun, 20 Jul 2014 11:26:23 -0400 Received: from mout.gmx.net ([212.227.17.22]:53637) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8t0F-00067q-U1 for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 11:26:20 -0400 Received: from detlef.gmx.de ([87.146.61.166]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0LsOsW-1WOVad3Ytc-0124G2; Sun, 20 Jul 2014 17:26:12 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <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> Date: Sun, 20 Jul 2014 17:26:04 +0200 In-Reply-To: <83tx6c44x7.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 20 Jul 2014 14:59:16 +0300") Message-ID: <87egxggigj.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:zWoShfSX8fky1YXqa3cUFjkB/D8PZGn3IdY1LHyBA2DQDQH79ao 8lOGDOM1Js8ZVIyuTWmMeNiPQ1QeKUkJxOMzpkafhtsYqPbN5P5dA3mPwwfMd+4LrfzAwpr G8SmZmOYjulQh5MqcI8gX5FgchtD+JU4ewfG/MQTClI5CWqpAM3BHZV+nSiE4BR3x8svxoz xLAChh+Yy+1ySjg3Ffgyg== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, Paul Eggert , 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: >> Maybe we should expose glib's g_utf8_collate() on Lisp level. > > Are you sure this does the job? Glib docs are minimal, and don't seem > to mention UTS#10. E.g., if g_utf8_collate relies on the underlying > libc's strcoll, we are back at square one. Well, I've checked the code of g_utf8_collate in glib 2.36. Shortly, it does --8<---------------cut here---------------start------------->8--- #ifdef HAVE_CARBON UCCompareTextDefault (kUCCollateStandardOptions, str1_utf16, len1, str2_utf16, len2, NULL, &retval); #elif defined(__STDC_ISO_10646__) result = wcscoll ((wchar_t *)str1_norm, (wchar_t *)str2_norm); #else /* !__STDC_ISO_10646__ */ result = strcoll (str1_norm, str2_norm); #endif --8<---------------cut here---------------end--------------->8--- Likely, wcscoll implements only ISO 14651 (a subset of UCA these days), and likely wcscoll supports single byte characters only. I will run some tests next days. An alternative would be libicu, which seems to implement UCA completely. I have no idea whether there are licensing issues when linking with Emacs, 'tho. Maybe Paul knows better which library to use? I've seen in GNU grep's Changelogs, that wcscoll was used, but removed last year. I haven't checked (yet) what is the replacement. >> On systems without glib, we might emulate it partially. Packages >> like ls-lisp could use it then for sorting. > > I think we need our own implementation in any case. If nothing else, > that would solve the issue of encoding strings into UTF-8 before > calling external C functions. Yep. But given the complexity of UCA, we will start slowly with a subset of the algorithm only. This and performance considerations will still demand for a native C library, if available. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 20 12:17:12 2014 Received: (at 18051) by debbugs.gnu.org; 20 Jul 2014 16:17:12 +0000 Received: from localhost ([127.0.0.1]:60499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8tnT-0007VQ-WE for submit@debbugs.gnu.org; Sun, 20 Jul 2014 12:17:12 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:58225) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X8tnQ-0007V7-Sv for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 12:17:10 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0N9000400QBJ6Q00@a-mtaout22.012.net.il> for 18051@debbugs.gnu.org; Sun, 20 Jul 2014 19:17:01 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N9000473QKD6O10@a-mtaout22.012.net.il>; Sun, 20 Jul 2014 19:17:01 +0300 (IDT) Date: Sun, 20 Jul 2014 19:16:57 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <87egxggigj.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus Message-id: <83r41g3szq.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <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> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, eggert@cs.ucla.edu, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org, Paul Eggert > Date: Sun, 20 Jul 2014 17:26:04 +0200 > > Eli Zaretskii writes: > > >> Maybe we should expose glib's g_utf8_collate() on Lisp level. > > > > Are you sure this does the job? Glib docs are minimal, and don't seem > > to mention UTS#10. E.g., if g_utf8_collate relies on the underlying > > libc's strcoll, we are back at square one. > > Well, I've checked the code of g_utf8_collate in glib 2.36. Shortly, it does > > --8<---------------cut here---------------start------------->8--- > #ifdef HAVE_CARBON > > UCCompareTextDefault (kUCCollateStandardOptions, > str1_utf16, len1, str2_utf16, len2, > NULL, &retval); > > #elif defined(__STDC_ISO_10646__) > > result = wcscoll ((wchar_t *)str1_norm, (wchar_t *)str2_norm); > > #else /* !__STDC_ISO_10646__ */ > > result = strcoll (str1_norm, str2_norm); > > #endif > --8<---------------cut here---------------end--------------->8--- As expected, it simply relies on the Standard C library's wcscoll implementation. > Likely, wcscoll implements only ISO 14651 (a subset of UCA these days), > and likely wcscoll supports single byte characters only. No, I expect wcscoll, at least in its glibc implementation, to support the entire Unicode range. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 16 17:52:31 2014 Received: (at 18051) by debbugs.gnu.org; 16 Aug 2014 21:52:31 +0000 Received: from localhost ([127.0.0.1]:44927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XIltm-0005mE-20 for submit@debbugs.gnu.org; Sat, 16 Aug 2014 17:52:30 -0400 Received: from mout.gmx.net ([212.227.17.21]:57033) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XIltj-0005lz-S9 for 18051@debbugs.gnu.org; Sat, 16 Aug 2014 17:52:28 -0400 Received: from detlef.gmx.de ([93.202.56.190]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MPYqL-1XMscs2l5l-004jke; Sat, 16 Aug 2014 23:52:20 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <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> Date: Sat, 16 Aug 2014 23:52:16 +0200 In-Reply-To: <87egxggigj.fsf@gmx.de> (Michael Albinus's message of "Sun, 20 Jul 2014 17:26:04 +0200") Message-ID: <877g28w19r.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:Zniz7UQ1b5wdHJUoHMj/bB3ha5J+qG35z7PtTp7c5B1+8IvIGOE VmzvzBdU2rrzhpG2/Bk1t8eV4eTF3tGuT0VpU/HliUFA5gxjDdpwgtRLImPQMaByzNEUifd aEWwYE4HOV1QAng6Ntg0DnaPKYYxec+xovG7GJEtNjW/uUHiXZdX87RE6o9hEvJbuTV55Qe BTSxqIAI9PMpgiduhh1Ug== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Michael Albinus writes: >>> On systems without glib, we might emulate it partially. Packages >>> like ls-lisp could use it then for sorting. >> >> I think we need our own implementation in any case. If nothing else, >> that would solve the issue of encoding strings into UTF-8 before >> calling external C functions. > > Yep. But given the complexity of UCA, we will start slowly with a subset > of the algorithm only. This and performance considerations will still > demand for a native C library, if available. Just being curious, I've taken g_utf8_collate from the glib for a test. It doesn't work bad. I have added two functions `gstring-lessp' and `gstring-equalp', which are meant to be the collation counterparts of `string-lessp' and `string-equal'. Here are some tests, taken from UTS#10, chapter 1.1 "Multi-Level Comparison": --8<---------------cut here---------------start------------->8--- (sort '("role" "roles" "rule") 'string-lessp) =3D> ("role" "roles" "rule") (sort '("role" "roles" "rule") 'gstring-lessp) =3D> ("role" "roles" "rule") --8<---------------cut here---------------end--------------->8--- No surprise they return the same result, this is level 1 comparison. Just base characters are compared. --8<---------------cut here---------------start------------->8--- (sort '("role" "r=C3=B4le" "roles") 'string-lessp) =3D> ("role" "roles" "r=C3=B4le") (sort '("role" "r=C3=B4le" "roles") 'gstring-lessp) =3D> ("role" "r=C3=B4le" "roles") --8<---------------cut here---------------end--------------->8--- Accent differences are typically ignored in collation, if the base letters differ. And so on, further tests applied from there ... The collation rules could even be influenced by setting the locale environment. The following example is taken from ISO 14651:2011, appendix D.3. If LC_COLLATE is set to C.utf8, `string-lessp' and `gstring-lessp' behave the same: --8<---------------cut here---------------start------------->8--- (sort '("Alzheimer" "czar" "c=C3=A6sium" "c=C3=B8libat" "Aachen" "Aalborg" = "=C3=85rhus") 'stri\ng-lessp) =3D> ("Aachen" "Aalborg" "Alzheimer" "czar" "c=C3=A6sium" "c=C3=B8libat" "= =C3=85rhus") (sort '("Alzheimer" "czar" "c=C3=A6sium" "c=C3=B8libat" "Aachen" "Aalborg" = "=C3=85rhus") 'gstring-lessp) =3D> ("Aachen" "Aalborg" "Alzheimer" "czar" "c=C3=A6sium" "c=C3=B8libat" "= =C3=85rhus") --8<---------------cut here---------------end--------------->8--- When I set LC_COLLATE to en_US.utf8, accent differences are ignored, again: --8<---------------cut here---------------start------------->8--- (sort '("Alzheimer" "czar" "c=C3=A6sium" "c=C3=B8libat" "Aachen" "Aalborg" = "=C3=85rhus") 'gstring-lessp) =3D> ("Aachen" "Aalborg" "Alzheimer" "=C3=85rhus" "c=C3=A6sium" "c=C3=B8lib= at" "czar") --8<---------------cut here---------------end--------------->8--- But setting LC_COLLATE to da_DK.utf8, the order differs, because "cz" is less than "c=C3=A6", and "aa" is equivalent to "=C3=A5" but greater than "z= ". --8<---------------cut here---------------start------------->8--- (sort '("Alzheimer" "czar" "c=C3=A6sium" "c=C3=B8libat" "Aachen" "Aalborg" = "=C3=85rhus") 'gstring-lessp) ("Alzheimer" "czar" "c=C3=A6sium" "c=C3=B8libat" "Aachen" "Aalborg" "=C3=85= rhus") --8<---------------cut here---------------end--------------->8--- Well, for practical use cases it seems to be worth to include g_utf8_collate into Emacs. Of course, it could be used only in case glib is linked, so we might still need an own Lisp implementation. I don't know how well g_utf8_collate works for non Latin characters, 'tho. And the test files CollationTest_NON_IGNORABLE.txt and CollationTest_SHIFTED.txt from UTS#10 do not run completely successful. I have no idea, whether it is due to a limitation of g_utf8_collate, or whether it is because I have taken the latest Unicode 7.0.0 test files, which might include tests which haven't reached GNU/Linux distributions yet. (Or whether my implementation is still erroneous). Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 17 12:38:58 2014 Received: (at 18051) by debbugs.gnu.org; 17 Aug 2014 16:38:58 +0000 Received: from localhost ([127.0.0.1]:45580 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XJ3Tu-0006hc-1L for submit@debbugs.gnu.org; Sun, 17 Aug 2014 12:38:58 -0400 Received: from mtaout25.012.net.il ([80.179.55.181]:49889) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XJ3Tp-0006gs-Dd for 18051@debbugs.gnu.org; Sun, 17 Aug 2014 12:38:54 -0400 Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NAG00500LQQQI00@mtaout25.012.net.il> for 18051@debbugs.gnu.org; Sun, 17 Aug 2014 19:33:41 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAG00O1OM053V70@mtaout25.012.net.il>; Sun, 17 Aug 2014 19:33:41 +0300 (IDT) Date: Sun, 17 Aug 2014 19:38:36 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <877g28w19r.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus Message-id: <83sikvcbqr.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <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> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org > Date: Sat, 16 Aug 2014 23:52:16 +0200 > > Just being curious, I've taken g_utf8_collate from the glib for a > test. It doesn't work bad. Are you sure this is implemented in Glib, not in the underlying libc (glibc in your case, I presume)? From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 17 13:55:30 2014 Received: (at 18051) by debbugs.gnu.org; 17 Aug 2014 17:55:31 +0000 Received: from localhost ([127.0.0.1]:45592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XJ4fy-0000Lb-B0 for submit@debbugs.gnu.org; Sun, 17 Aug 2014 13:55:30 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:50801) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XJ4fu-0000LH-Dp for 18051@debbugs.gnu.org; Sun, 17 Aug 2014 13:55:28 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NAG00600PLMYV00@a-mtaout20.012.net.il> for 18051@debbugs.gnu.org; Sun, 17 Aug 2014 20:55:19 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAG00632PS7N230@a-mtaout20.012.net.il>; Sun, 17 Aug 2014 20:55:19 +0300 (IDT) Date: Sun, 17 Aug 2014 20:55:09 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <83sikvcbqr.fsf@gnu.org> X-012-Sender: halo1@inter.net.il To: michael.albinus@gmx.de Message-id: <83r40fc876.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <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> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Sun, 17 Aug 2014 19:38:36 +0300 > From: Eli Zaretskii > Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org > > > From: Michael Albinus > > Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org > > Date: Sat, 16 Aug 2014 23:52:16 +0200 > > > > Just being curious, I've taken g_utf8_collate from the glib for a > > test. It doesn't work bad. > > Are you sure this is implemented in Glib, not in the underlying libc > (glibc in your case, I presume)? Answering myself here: by reading the source of g_utf8_collate, it is clear that the implementation is elsewhere. In particular, in any environment that defines __STDC_ISO_10646__ (as does glibc), g_utf8_collate simply calls wcscoll, after converting the UTF-8 strings to wide-character strings. So I think a better alternative would be to base the implementation of this feature on the system libraries directly. I think most modern platforms have the necessary facilities. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 17 14:46:25 2014 Received: (at 18051) by debbugs.gnu.org; 17 Aug 2014 18:46:25 +0000 Received: from localhost ([127.0.0.1]:45606 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XJ5TD-0001n0-VY for submit@debbugs.gnu.org; Sun, 17 Aug 2014 14:46:24 -0400 Received: from mout.gmx.net ([212.227.15.15]:49395) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XJ5TB-0001mk-JV for 18051@debbugs.gnu.org; Sun, 17 Aug 2014 14:46:22 -0400 Received: from detlef.gmx.de ([87.146.51.37]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0LoVvG-1Wi4xI2QgM-00gV87; Sun, 17 Aug 2014 20:46:14 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <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> Date: Sun, 17 Aug 2014 20:46:11 +0200 In-Reply-To: <83r40fc876.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 17 Aug 2014 20:55:09 +0300") Message-ID: <87wqa7uf7w.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:SuNbKBVAesMhJ+YxVBcZPh2WCdEfiNfDJho1ZyUa7LvTLmkKhkW UemUo6rIxs06uTowL/LBIwkf27GZD6gLeLVsP4MytxTK7+/xWgSRtdg7bbWU91OzOT2PqD1 /TQBnrWpwDslunKljBWB6ejCuT7nx2PQ+yhYkygSSM1IAKwgQhT4sniC2WD4VrWxzE2mfoF SidHf+qZMVSo9YzwiaCuA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > Answering myself here: by reading the source of g_utf8_collate, it is > clear that the implementation is elsewhere. In particular, in any > environment that defines __STDC_ISO_10646__ (as does glibc), > g_utf8_collate simply calls wcscoll, after converting the UTF-8 > strings to wide-character strings. > > So I think a better alternative would be to base the implementation of > this feature on the system libraries directly. I think most modern > platforms have the necessary facilities. But OTOH, g_utf8_collate handles also other cases, like the #ifdef HAVE_CARBON case. So what, maybe it is sufficient to take over the implementation from glib, indeed. There's not too much logic added there, and we would avoid the glib dependency. What I would really like to test are non-Latin coding points. I'm a noob for such characters (glad to speak German, English and a little bit Fran=C3=A7ais); do you or somebody else has some test cases for `gstring-lessp' or `gstring-equalp', which shall return different results than `string-lessp' and `string-equal'? Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 17 14:52:53 2014 Received: (at 18051) by debbugs.gnu.org; 17 Aug 2014 18:52:53 +0000 Received: from localhost ([127.0.0.1]:45612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XJ5ZU-0001xu-SV for submit@debbugs.gnu.org; Sun, 17 Aug 2014 14:52:53 -0400 Received: from mtaout25.012.net.il ([80.179.55.181]:47226) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XJ5ZR-0001xa-DH for 18051@debbugs.gnu.org; Sun, 17 Aug 2014 14:52:50 -0400 Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NAG00800RZPJ800@mtaout25.012.net.il> for 18051@debbugs.gnu.org; Sun, 17 Aug 2014 21:47:37 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAG0015QS7DOY70@mtaout25.012.net.il>; Sun, 17 Aug 2014 21:47:37 +0300 (IDT) Date: Sun, 17 Aug 2014 21:52:32 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <87wqa7uf7w.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus Message-id: <83oavjc5jj.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <838unr6ttu.fsf@gnu.org> <871ttj5dfi.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <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> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org > Date: Sun, 17 Aug 2014 20:46:11 +0200 > > So what, maybe it is sufficient to take over the implementation from > glib, indeed. There's not too much logic added there, and we would avoid > the glib dependency. That's what I had in mind, yes. > do you or somebody else has some test cases for `gstring-lessp' or > `gstring-equalp', which shall return different results than > `string-lessp' and `string-equal'? I don't have such test cases, but I'd start by looking in the glib test suite. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 21 05:06:05 2014 Received: (at 18051) by debbugs.gnu.org; 21 Aug 2014 09:06:05 +0000 Received: from localhost ([127.0.0.1]:48735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XKOJo-0002vl-2p for submit@debbugs.gnu.org; Thu, 21 Aug 2014 05:06:04 -0400 Received: from mout.gmx.net ([212.227.17.22]:51648) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XKOJk-0002vC-Az for 18051@debbugs.gnu.org; Thu, 21 Aug 2014 05:06:01 -0400 Received: from detlef.gmx.de ([87.146.32.163]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LoVja-1WjObS02Ek-00gUMR; Thu, 21 Aug 2014 11:05:52 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <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> Date: Thu, 21 Aug 2014 11:05:43 +0200 In-Reply-To: <83oavjc5jj.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 17 Aug 2014 21:52:32 +0300") Message-ID: <87y4uixleg.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K0:ujMJp9CmGC2nmcoGIecSTmNhxVVa/0q86WjtLttvfhPH5aIGodY 5TaJihBoPt4zCflpst5ZRhgRDxj/KV8p5FFI6/A1qHArGZq5GfJhjG9Xs0/VKSChtlrMZYs 3GyBED29nWXxFW+dvqiZswI+EAX6c49eHUjKKHOUWCLbRiyIbNTP5Ezue6i/ZXcnnh4b6gA LVVW80GFRgp3dV9p40Q7Q== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> So what, maybe it is sufficient to take over the implementation from >> glib, indeed. There's not too much logic added there, and we would avoid >> the glib dependency. > > That's what I had in mind, yes. Finally, I came out with the appended patch. Comments appreciated. >> do you or somebody else has some test cases for `gstring-lessp' or >> `gstring-equalp', which shall return different results than >> `string-lessp' and `string-equal'? > > I don't have such test cases, but I'd start by looking in the glib > test suite. There aren't so many glib test cases for collation. I need to search further. Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=collate-patch *** /usr/local/src/emacs/src/fns.c.~117719~ 2014-08-21 10:58:42.195613026 +0200 --- /usr/local/src/emacs/src/fns.c 2014-08-21 10:27:30.986334200 +0200 *************** *** 39,46 **** #if defined (HAVE_X_WINDOWS) #include "xterm.h" #endif ! Lisp_Object Qstring_lessp; static Lisp_Object Qprovide, Qrequire; static Lisp_Object Qyes_or_no_p_history; Lisp_Object Qcursor_in_echo_area; --- 39,52 ---- #if defined (HAVE_X_WINDOWS) #include "xterm.h" #endif + #ifdef HAVE_SETLOCALE + #include + #endif /* HAVE_SETLOCALE */ + #ifdef __STDC_ISO_10646__ + #include + #endif /* __STDC_ISO_10646__ */ ! Lisp_Object Qstring_lessp, Qstring_collate_lessp, Qstring_collate_equalp; static Lisp_Object Qprovide, Qrequire; static Lisp_Object Qyes_or_no_p_history; Lisp_Object Qcursor_in_echo_area; *************** *** 343,348 **** --- 349,467 ---- } return i1 < SCHARS (s2) ? Qt : Qnil; } + + #ifdef __STDC_ISO_10646__ + ptrdiff_t + str_collate (Lisp_Object s1, Lisp_Object s2) + { + register ptrdiff_t res, len, i, i_byte; + wchar_t *p1, *p2; + Lisp_Object lc_collate; + char *old_collate, *saved_collate; + + USE_SAFE_ALLOCA; + + /* Check parameters. */ + if (SYMBOLP (s1)) + s1 = SYMBOL_NAME (s1); + if (SYMBOLP (s2)) + s2 = SYMBOL_NAME (s2); + CHECK_STRING (s1); + CHECK_STRING (s2); + + /* Convert byte stream to code pointers. */ + len = SCHARS (s1); i = i_byte = 0; + p1 = (wchar_t *) SAFE_ALLOCA ((len+1) * (sizeof *p1)); + while (i < len) + FETCH_STRING_CHAR_ADVANCE (*(p1+i-1), s1, i, i_byte); + *(p1+len) = 0; + + len = SCHARS (s2); i = i_byte = 0; + p2 = (wchar_t *) SAFE_ALLOCA ((len+1) * (sizeof *p2)); + while (i < len) + FETCH_STRING_CHAR_ADVANCE (*(p2+i-1), s2, i, i_byte); + *(p2+len) = 0; + + #ifdef HAVE_SETLOCALE + /* Set locale. */ + lc_collate = + Fgetenv_internal (build_string ("LC_COLLATE"), Vprocess_environment); + if (STRINGP (lc_collate)) + { + old_collate = setlocale (LC_COLLATE, NULL); + saved_collate = xstrdup (old_collate); + setlocale (LC_COLLATE, SSDATA (lc_collate)); + } + #endif /* HAVE_SETLOCALE */ + + res = wcscoll (p1, p2); + + #ifdef HAVE_SETLOCALE + /* Restore the original locale. */ + if (STRINGP (lc_collate)) + setlocale (LC_COLLATE, saved_collate); + #endif /* HAVE_SETLOCALE */ + + /* Return result. */ + SAFE_FREE (); + return res; + } + #endif /* __STDC_ISO_10646__ */ + + DEFUN ("string-collate-lessp", Fstring_collate_lessp, Sstring_collate_lessp, 2, 2, 0, + doc: /* Return t if first arg string is less than second in collation order. + + Case is significant. Symbols are also allowed; their print names are + used instead. + + This function obeys the conventions for collation order in your + locale settings. For example, punctuation and whitespace characters + are considered less significant for sorting. + + \(sort '\("11" "12" "1 1" "1 2" "1.1" "1.2") 'string-collate-lessp) + => \("11" "1 1" "1.1" "12" "1 2" "1.2") + + If your system does not support a locale environment, this function + behaves like `string-lessp'. + + If the environment variable \"LC_COLLATE\" is set in `process-environment', + it overrides the setting of your current locale. */) + (Lisp_Object s1, Lisp_Object s2) + { + #ifdef __STDC_ISO_10646__ + return (str_collate (s1, s2) < 0) ? Qt : Qnil; + #else + return Fstring_lessp (s1, s2); + #endif /* __STDC_ISO_10646__ */ + } + + DEFUN ("string-collate-equalp", Fstring_collate_equalp, Sstring_collate_equalp, 2, 2, 0, + doc: /* Return t if two strings have identical contents. + + Case is significant. Symbols are also allowed; their print names are + used instead. + + This function obeys the conventions for collation order in your locale + settings. For example, characters with different coding points but + the same meaning are considered as equal, like different grave accent + unicode characters. + + \(string-collate-equalp \(string ?\\uFF40) \(string ?\\u1FEF)) + => t + + If your system does not support a locale environment, this function + behaves like `string-equal'. + + If the environment variable \"LC_COLLATE\" is set in `process-environment', + it overrides the setting of your current locale. */) + (Lisp_Object s1, Lisp_Object s2) + { + #ifdef __STDC_ISO_10646__ + return (str_collate (s1, s2) == 0) ? Qt : Qnil; + #else + return Fstring_equal (s1, s2); + #endif /* __STDC_ISO_10646__ */ + } static Lisp_Object concat (ptrdiff_t nargs, Lisp_Object *args, enum Lisp_Type target_type, bool last_special); *************** *** 4919,4924 **** --- 5038,5045 ---- defsubr (&Sdefine_hash_table_test); DEFSYM (Qstring_lessp, "string-lessp"); + DEFSYM (Qstring_collate_lessp, "string-collate-lessp"); + DEFSYM (Qstring_collate_equalp, "string-collate-equalp"); DEFSYM (Qprovide, "provide"); DEFSYM (Qrequire, "require"); DEFSYM (Qyes_or_no_p_history, "yes-or-no-p-history"); *************** *** 4972,4977 **** --- 5093,5100 ---- defsubr (&Sstring_equal); defsubr (&Scompare_strings); defsubr (&Sstring_lessp); + defsubr (&Sstring_collate_lessp); + defsubr (&Sstring_collate_equalp); defsubr (&Sappend); defsubr (&Sconcat); defsubr (&Svconcat); --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 21 10:41:33 2014 Received: (at 18051) by debbugs.gnu.org; 21 Aug 2014 14:41:33 +0000 Received: from localhost ([127.0.0.1]:49044 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XKTYT-0004D1-3z for submit@debbugs.gnu.org; Thu, 21 Aug 2014 10:41:33 -0400 Received: from mtaout21.012.net.il ([80.179.55.169]:63572) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XKTYQ-0004Ck-B0 for 18051@debbugs.gnu.org; Thu, 21 Aug 2014 10:41:31 -0400 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0NAN00J00V4CTQ00@a-mtaout21.012.net.il> for 18051@debbugs.gnu.org; Thu, 21 Aug 2014 17:41:23 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAN00JGXVGZIN70@a-mtaout21.012.net.il>; Thu, 21 Aug 2014 17:41:23 +0300 (IDT) Date: Thu, 21 Aug 2014 17:41:22 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <87y4uixleg.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus Message-id: <83sikpc3cd.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <87iomvhvdg.fsf@gmx.de> <834myf6mfl.fsf@gnu.org> <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> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org > Date: Thu, 21 Aug 2014 11:05:43 +0200 > > >> So what, maybe it is sufficient to take over the implementation from > >> glib, indeed. There's not too much logic added there, and we would avoid > >> the glib dependency. > > > > That's what I had in mind, yes. > > Finally, I came out with the appended patch. Comments appreciated. Thanks. I have 2 comments: . 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 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?) From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 22 10:23:56 2014 Received: (at 18051) by debbugs.gnu.org; 22 Aug 2014 14:23:56 +0000 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 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 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 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? 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> Date: Fri, 22 Aug 2014 16:23:34 +0200 In-Reply-To: <83sikpc3cd.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 21 Aug 2014 17:41:22 +0300") Message-ID: <87ha147gd5.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:sySYIxjb57u51oVW3aSGCVlVF1Pql1JrBf2zow0OMiDajfhJehV WR1OCxJzssD2q4+ICaMsTsz2Se3Ugz5F7gyEuuHzRc8+FXfSRESlhjb2gEUciMFpRH2++xe Gtgobj+C1I5XRvJsujqUKPK8G5uaHP/MqUY80YqwpTNOi5rMQEo3qTcrmPVj3f6icddRA1b 8rzq+q1tKt37gKPvJ/LrQ== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 23 05:05:59 2014 Received: (at 18051) by debbugs.gnu.org; 23 Aug 2014 09:05:59 +0000 Received: from localhost ([127.0.0.1]:49941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XL7Go-0006ci-GP for submit@debbugs.gnu.org; Sat, 23 Aug 2014 05:05:59 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:33105) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XL7Gm-0006cQ-4M for 18051@debbugs.gnu.org; Sat, 23 Aug 2014 05:05:57 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NAR0020053C4900@a-mtaout22.012.net.il> for 18051@debbugs.gnu.org; Sat, 23 Aug 2014 12:05:49 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAR0020A59P4510@a-mtaout22.012.net.il>; Sat, 23 Aug 2014 12:05:49 +0300 (IDT) Date: Sat, 23 Aug 2014 12:05:51 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <87ha147gd5.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus Message-id: <83a96vmv80.fsf@gnu.org> 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> <87ha147gd5.fsf@gmx.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org > Date: Fri, 22 Aug 2014 16:23:34 +0200 > > > . 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 everything in str_collate starting with the "Convert byte stream to code pointers." comment (btw, I guess you meant "code points" here) should be in a separate function, and the best place for that function is sysdep.c. At least on MS-Windows, both the part that converts a Lisp string into wchar_t array, and the part that performs a locale-sensitive string comparison, will be implemented differently. > > . 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. Thanks. (You didn't attach the new patch.) Btw, I wonder whether we should have a way to pass the locale string explicitly, instead of relying on $LC_COLLATE. > 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? I'll defer to glibc experts on that. My knowledge of 'newlocale' facilities is limited to what I saw in Guile's i18n.c module. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 23 12:43:08 2014 Received: (at 18051) by debbugs.gnu.org; 23 Aug 2014 16:43:09 +0000 Received: from localhost ([127.0.0.1]:50327 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLEPD-0002z9-Kx for submit@debbugs.gnu.org; Sat, 23 Aug 2014 12:43:08 -0400 Received: from mout.gmx.net ([212.227.15.18]:57590) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLEP8-0002yb-6J for 18051@debbugs.gnu.org; Sat, 23 Aug 2014 12:43:03 -0400 Received: from detlef.gmx.de ([87.146.34.141]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0LmKag-1WmRod0z6Q-00Ztbu; Sat, 23 Aug 2014 18:42:54 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <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> <87ha147gd5.fsf@gmx.de> <83a96vmv80.fsf@gnu.org> Date: Sat, 23 Aug 2014 18:42:44 +0200 In-Reply-To: <83a96vmv80.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Aug 2014 12:05:51 +0300") Message-ID: <87a96vuph7.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K0:LX0bv4qMGKO3naaBFGF6HbOxfzMz+iykYjV9Skcb7LyQs373v8y T0SkVvtlQAIx+P2cBKtmkcvri4sYdm3v13xh0QDUw/Cgjm5evMRgMIuEgzh0lLrWe/JgTRF BH0TEQxcGPSEJm69lncCgiTW5URJjS2AcFn5xZ+VVsYPugaF4y0taqsuj6/Fkc7/M1PfZD9 McAUsvb2AOzGS5pivn8OA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > I think everything in str_collate starting with the "Convert byte > stream to code pointers." comment (btw, I guess you meant "code > points" here) should be in a separate function, and the best place for > that function is sysdep.c. At least on MS-Windows, both the part that > converts a Lisp string into wchar_t array, and the part that performs > a locale-sensitive string comparison, will be implemented differently. Well, I've moved (most of) str_collate to sysdep.c. > Thanks. (You didn't attach the new patch.) Oops. Appended this time. > Btw, I wonder whether we should have a way to pass the locale string > explicitly, instead of relying on $LC_COLLATE. We could add an optional argument to string-collate-*. But this would break signature equivalence with string-lessp and string-equal, respectively. Or we could introduce a global var, which shall be let-bound to the locale string. >> 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? > > I'll defer to glibc experts on that. My knowledge of 'newlocale' > facilities is limited to what I saw in Guile's i18n.c module. According to the manpages, setlocale is conforming to "C89, C99, POSIX.1-2001". {new,use,free}locale are conforming to "POSIX.1-2008". So we must check for HAVE_USELOCALE, indeed. Checks for HAVE_NEWLOCALE and HAVE_FREELOCALE are not necessary, the functions exist in parallel to uselocale (introduced in glibc 2.3). This raises the question, whether we shall use also my first setlocale approach in case of uselocale absence? Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=collate-patch === modified file 'src/fns.c' --- src/fns.c 2014-08-02 15:56:18 +0000 +++ src/fns.c 2014-08-23 15:57:06 +0000 @@ -40,7 +40,7 @@ #include "xterm.h" #endif -Lisp_Object Qstring_lessp; +Lisp_Object Qstring_lessp, Qstring_collate_lessp, Qstring_collate_equalp; static Lisp_Object Qprovide, Qrequire; static Lisp_Object Qyes_or_no_p_history; Lisp_Object Qcursor_in_echo_area; @@ -343,6 +343,84 @@ } return i1 < SCHARS (s2) ? Qt : Qnil; } + +#ifdef __STDC_ISO_10646__ +/* Defined in sysdep.c. */ +extern ptrdiff_t str_collate (Lisp_Object, Lisp_Object); +#endif /* __STDC_ISO_10646__ */ + +DEFUN ("string-collate-lessp", Fstring_collate_lessp, Sstring_collate_lessp, 2, 2, 0, + doc: /* Return t if first arg string is less than second in collation order. + +Case is significant. Symbols are also allowed; their print names are +used instead. + +This function obeys the conventions for collation order in your +locale settings. For example, punctuation and whitespace characters +are considered less significant for sorting. + +\(sort '\("11" "12" "1 1" "1 2" "1.1" "1.2") 'string-collate-lessp) + => \("11" "1 1" "1.1" "12" "1 2" "1.2") + +If your system does not support a locale environment, this function +behaves like `string-lessp'. + +If the environment variable \"LC_COLLATE\" is set in `process-environment', +it overrides the setting of your current locale. */) + (Lisp_Object s1, Lisp_Object s2) +{ +#ifdef __STDC_ISO_10646__ + /* Check parameters. */ + if (SYMBOLP (s1)) + s1 = SYMBOL_NAME (s1); + if (SYMBOLP (s2)) + s2 = SYMBOL_NAME (s2); + CHECK_STRING (s1); + CHECK_STRING (s2); + + return (str_collate (s1, s2) < 0) ? Qt : Qnil; + +#else + return Fstring_lessp (s1, s2); +#endif /* __STDC_ISO_10646__ */ +} + +DEFUN ("string-collate-equalp", Fstring_collate_equalp, Sstring_collate_equalp, 2, 2, 0, + doc: /* Return t if two strings have identical contents. + +Case is significant. Symbols are also allowed; their print names are +used instead. + +This function obeys the conventions for collation order in your locale +settings. For example, characters with different coding points but +the same meaning are considered as equal, like different grave accent +unicode characters. + +\(string-collate-equalp \(string ?\\uFF40) \(string ?\\u1FEF)) + => t + +If your system does not support a locale environment, this function +behaves like `string-equal'. + +If the environment variable \"LC_COLLATE\" is set in `process-environment', +it overrides the setting of your current locale. */) + (Lisp_Object s1, Lisp_Object s2) +{ +#ifdef __STDC_ISO_10646__ + /* Check parameters. */ + if (SYMBOLP (s1)) + s1 = SYMBOL_NAME (s1); + if (SYMBOLP (s2)) + s2 = SYMBOL_NAME (s2); + CHECK_STRING (s1); + CHECK_STRING (s2); + + return (str_collate (s1, s2) == 0) ? Qt : Qnil; + +#else + return Fstring_equal (s1, s2); +#endif /* __STDC_ISO_10646__ */ +} static Lisp_Object concat (ptrdiff_t nargs, Lisp_Object *args, enum Lisp_Type target_type, bool last_special); @@ -4919,6 +4997,8 @@ defsubr (&Sdefine_hash_table_test); DEFSYM (Qstring_lessp, "string-lessp"); + DEFSYM (Qstring_collate_lessp, "string-collate-lessp"); + DEFSYM (Qstring_collate_equalp, "string-collate-equalp"); DEFSYM (Qprovide, "provide"); DEFSYM (Qrequire, "require"); DEFSYM (Qyes_or_no_p_history, "yes-or-no-p-history"); @@ -4972,6 +5052,8 @@ defsubr (&Sstring_equal); defsubr (&Scompare_strings); defsubr (&Sstring_lessp); + defsubr (&Sstring_collate_lessp); + defsubr (&Sstring_collate_equalp); defsubr (&Sappend); defsubr (&Sconcat); defsubr (&Svconcat); === modified file 'src/sysdep.c' --- src/sysdep.c 2014-07-14 19:23:18 +0000 +++ src/sysdep.c 2014-08-23 16:36:39 +0000 @@ -3513,3 +3513,63 @@ } #endif /* !defined (WINDOWSNT) */ + +/* Wide character string collation. */ + +#ifdef __STDC_ISO_10646__ +#include + +#ifdef HAVE_USELOCALE +#include +#endif /* HAVE_USELOCALE */ + +ptrdiff_t +str_collate (Lisp_Object s1, Lisp_Object s2) +{ + register ptrdiff_t res, len, i, i_byte; + wchar_t *p1, *p2; +#ifdef HAVE_USELOCALE + Lisp_Object lc_collate; + locale_t loc = (locale_t) 0, oldloc = (locale_t) 0; +#endif /* HAVE_USELOCALE */ + + USE_SAFE_ALLOCA; + + /* Convert byte stream to code points. */ + len = SCHARS (s1); i = i_byte = 0; + p1 = (wchar_t *) SAFE_ALLOCA ((len+1) * (sizeof *p1)); + while (i < len) + FETCH_STRING_CHAR_ADVANCE (*(p1+i-1), s1, i, i_byte); + *(p1+len) = 0; + + len = SCHARS (s2); i = i_byte = 0; + p2 = (wchar_t *) SAFE_ALLOCA ((len+1) * (sizeof *p2)); + while (i < len) + FETCH_STRING_CHAR_ADVANCE (*(p2+i-1), s2, i, i_byte); + *(p2+len) = 0; + +#ifdef HAVE_USELOCALE + /* Create a new locale object, and set it. */ + lc_collate = + Fgetenv_internal (build_string ("LC_COLLATE"), Vprocess_environment); + + if (STRINGP (lc_collate) + && (loc = newlocale (LC_COLLATE_MASK, SSDATA (lc_collate), (locale_t) 0))) + oldloc = uselocale (loc); +#endif /* HAVE_USELOCALE */ + + res = wcscoll (p1, p2); + +#ifdef HAVE_USELOCALE + /* Free the locale object, and reset. */ + if (loc) + freelocale (loc); + if (oldloc) + uselocale (oldloc); +#endif /* HAVE_USELOCALE */ + + /* Return result. */ + SAFE_FREE (); + return res; +} +#endif /* __STDC_ISO_10646__ */ --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 23 13:33:50 2014 Received: (at 18051) by debbugs.gnu.org; 23 Aug 2014 17:33:51 +0000 Received: from localhost ([127.0.0.1]:50376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLFCI-0004E3-Kk for submit@debbugs.gnu.org; Sat, 23 Aug 2014 13:33:50 -0400 Received: from mtaout24.012.net.il ([80.179.55.180]:51034) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLFCF-0004Dl-7u for 18051@debbugs.gnu.org; Sat, 23 Aug 2014 13:33:48 -0400 Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NAR00200SAR1Q00@mtaout24.012.net.il> for 18051@debbugs.gnu.org; Sat, 23 Aug 2014 20:29:02 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAR00NIKSK8L040@mtaout24.012.net.il>; Sat, 23 Aug 2014 20:29:00 +0300 (IDT) Date: Sat, 23 Aug 2014 20:33:36 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <87a96vuph7.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus Message-id: <8361hjm7pr.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <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> <87ha147gd5.fsf@gmx.de> <83a96vmv80.fsf@gnu.org> <87a96vuph7.fsf@gmx.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org > Date: Sat, 23 Aug 2014 18:42:44 +0200 > > > Btw, I wonder whether we should have a way to pass the locale string > > explicitly, instead of relying on $LC_COLLATE. > > We could add an optional argument to string-collate-*. But this would > break signature equivalence with string-lessp and string-equal, > respectively. > > Or we could introduce a global var, which shall be let-bound to the > locale string. Or have a new optional argument in string-lessp etc., or introduce a new set of APIs which will accept a locale, and have string-lessp etc. call them with that argument nil. > This raises the question, whether we shall use also my first setlocale > approach in case of uselocale absence? I think so, yes. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 23 16:32:26 2014 Received: (at 18051) by debbugs.gnu.org; 23 Aug 2014 20:32:26 +0000 Received: from localhost ([127.0.0.1]:50446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLHz7-000090-I6 for submit@debbugs.gnu.org; Sat, 23 Aug 2014 16:32:26 -0400 Received: from mout.gmx.net ([212.227.17.20]:59901) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLHz3-00008n-Ey for 18051@debbugs.gnu.org; Sat, 23 Aug 2014 16:32:22 -0400 Received: from detlef.gmx.de ([87.146.34.141]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0Mbfyr-1X509J1CwH-00J59h; Sat, 23 Aug 2014 22:32:13 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <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> <87ha147gd5.fsf@gmx.de> <83a96vmv80.fsf@gnu.org> <87a96vuph7.fsf@gmx.de> <8361hjm7pr.fsf@gnu.org> Date: Sat, 23 Aug 2014 22:32:00 +0200 In-Reply-To: <8361hjm7pr.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Aug 2014 20:33:36 +0300") Message-ID: <8738cnuev3.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K0:ejAffMOEA84P74H2y/UyTjAEBqC3/mTY5syIoN3srPinlp6OcKH YWUJQTSpnFZMxlBDRQk1ULN5RJ2OVdDPO1GdjUdKX3uN2rUnfQJ8+SFxsOZpoVjo04eT3gr WD8/WwtjXsB1xBjPh/L9lNkixTywGG0Ju8sKMAHmMjLUnaaSwh+ChvTrWsWAcvopls/rZ2L tMM4MWTlouE7yg+BHaO4A== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> > Btw, I wonder whether we should have a way to pass the locale string >> > explicitly, instead of relying on $LC_COLLATE. >> >> We could add an optional argument to string-collate-*. But this would >> break signature equivalence with string-lessp and string-equal, >> respectively. >> >> Or we could introduce a global var, which shall be let-bound to the >> locale string. > > Or have a new optional argument in string-lessp etc., or introduce a > new set of APIs which will accept a locale, and have string-lessp > etc. call them with that argument nil. An optional argument to string-lessp could be inconvenient. IMHO, the most important use-case of string-lessp is being a PREDICATE of sort. This does not support optional arguments. >> This raises the question, whether we shall use also my first setlocale >> approach in case of uselocale absence? > > I think so, yes. Extended patch appended. Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=collate-patch === modified file 'src/fns.c' --- src/fns.c 2014-08-02 15:56:18 +0000 +++ src/fns.c 2014-08-23 15:57:06 +0000 @@ -40,7 +40,7 @@ #include "xterm.h" #endif -Lisp_Object Qstring_lessp; +Lisp_Object Qstring_lessp, Qstring_collate_lessp, Qstring_collate_equalp; static Lisp_Object Qprovide, Qrequire; static Lisp_Object Qyes_or_no_p_history; Lisp_Object Qcursor_in_echo_area; @@ -343,6 +343,84 @@ } return i1 < SCHARS (s2) ? Qt : Qnil; } + +#ifdef __STDC_ISO_10646__ +/* Defined in sysdep.c. */ +extern ptrdiff_t str_collate (Lisp_Object, Lisp_Object); +#endif /* __STDC_ISO_10646__ */ + +DEFUN ("string-collate-lessp", Fstring_collate_lessp, Sstring_collate_lessp, 2, 2, 0, + doc: /* Return t if first arg string is less than second in collation order. + +Case is significant. Symbols are also allowed; their print names are +used instead. + +This function obeys the conventions for collation order in your +locale settings. For example, punctuation and whitespace characters +are considered less significant for sorting. + +\(sort '\("11" "12" "1 1" "1 2" "1.1" "1.2") 'string-collate-lessp) + => \("11" "1 1" "1.1" "12" "1 2" "1.2") + +If your system does not support a locale environment, this function +behaves like `string-lessp'. + +If the environment variable \"LC_COLLATE\" is set in `process-environment', +it overrides the setting of your current locale. */) + (Lisp_Object s1, Lisp_Object s2) +{ +#ifdef __STDC_ISO_10646__ + /* Check parameters. */ + if (SYMBOLP (s1)) + s1 = SYMBOL_NAME (s1); + if (SYMBOLP (s2)) + s2 = SYMBOL_NAME (s2); + CHECK_STRING (s1); + CHECK_STRING (s2); + + return (str_collate (s1, s2) < 0) ? Qt : Qnil; + +#else + return Fstring_lessp (s1, s2); +#endif /* __STDC_ISO_10646__ */ +} + +DEFUN ("string-collate-equalp", Fstring_collate_equalp, Sstring_collate_equalp, 2, 2, 0, + doc: /* Return t if two strings have identical contents. + +Case is significant. Symbols are also allowed; their print names are +used instead. + +This function obeys the conventions for collation order in your locale +settings. For example, characters with different coding points but +the same meaning are considered as equal, like different grave accent +unicode characters. + +\(string-collate-equalp \(string ?\\uFF40) \(string ?\\u1FEF)) + => t + +If your system does not support a locale environment, this function +behaves like `string-equal'. + +If the environment variable \"LC_COLLATE\" is set in `process-environment', +it overrides the setting of your current locale. */) + (Lisp_Object s1, Lisp_Object s2) +{ +#ifdef __STDC_ISO_10646__ + /* Check parameters. */ + if (SYMBOLP (s1)) + s1 = SYMBOL_NAME (s1); + if (SYMBOLP (s2)) + s2 = SYMBOL_NAME (s2); + CHECK_STRING (s1); + CHECK_STRING (s2); + + return (str_collate (s1, s2) == 0) ? Qt : Qnil; + +#else + return Fstring_equal (s1, s2); +#endif /* __STDC_ISO_10646__ */ +} static Lisp_Object concat (ptrdiff_t nargs, Lisp_Object *args, enum Lisp_Type target_type, bool last_special); @@ -4919,6 +4997,8 @@ defsubr (&Sdefine_hash_table_test); DEFSYM (Qstring_lessp, "string-lessp"); + DEFSYM (Qstring_collate_lessp, "string-collate-lessp"); + DEFSYM (Qstring_collate_equalp, "string-collate-equalp"); DEFSYM (Qprovide, "provide"); DEFSYM (Qrequire, "require"); DEFSYM (Qyes_or_no_p_history, "yes-or-no-p-history"); @@ -4972,6 +5052,8 @@ defsubr (&Sstring_equal); defsubr (&Scompare_strings); defsubr (&Sstring_lessp); + defsubr (&Sstring_collate_lessp); + defsubr (&Sstring_collate_equalp); defsubr (&Sappend); defsubr (&Sconcat); defsubr (&Svconcat); === modified file 'src/sysdep.c' --- src/sysdep.c 2014-07-14 19:23:18 +0000 +++ src/sysdep.c 2014-08-23 20:23:11 +0000 @@ -3513,3 +3513,77 @@ } #endif /* !defined (WINDOWSNT) */ + +/* Wide character string collation. */ + +#ifdef __STDC_ISO_10646__ +#include + +#if defined (HAVE_USELOCALE) || defined (HAVE_SETLOCALE) +#include +#endif /* HAVE_USELOCALE || HAVE_SETLOCALE */ + +ptrdiff_t +str_collate (Lisp_Object s1, Lisp_Object s2) +{ + register ptrdiff_t res, len, i, i_byte; + wchar_t *p1, *p2; + Lisp_Object lc_collate; +#ifdef HAVE_USELOCALE + locale_t loc = (locale_t) 0, oldloc = (locale_t) 0; +#elif defined (HAVE_SETLOCALE) + char *oldloc = NULL; +#endif /* HAVE_USELOCALE */ + + USE_SAFE_ALLOCA; + + /* Convert byte stream to code points. */ + len = SCHARS (s1); i = i_byte = 0; + p1 = (wchar_t *) SAFE_ALLOCA ((len+1) * (sizeof *p1)); + while (i < len) + FETCH_STRING_CHAR_ADVANCE (*(p1+i-1), s1, i, i_byte); + *(p1+len) = 0; + + len = SCHARS (s2); i = i_byte = 0; + p2 = (wchar_t *) SAFE_ALLOCA ((len+1) * (sizeof *p2)); + while (i < len) + FETCH_STRING_CHAR_ADVANCE (*(p2+i-1), s2, i, i_byte); + *(p2+len) = 0; + +#if defined (HAVE_USELOCALE) || defined (HAVE_SETLOCALE) + /* Create a new locale object, and set it. */ + lc_collate = + Fgetenv_internal (build_string ("LC_COLLATE"), Vprocess_environment); + +#ifdef HAVE_USELOCALE + if (STRINGP (lc_collate) + && (loc = newlocale (LC_COLLATE_MASK, SSDATA (lc_collate), (locale_t) 0))) + oldloc = uselocale (loc); +#elif defined (HAVE_SETLOCALE) + if (STRINGP (lc_collate)) + { + oldloc = xstrdup (setlocale (LC_COLLATE, NULL)); + setlocale (LC_COLLATE, SSDATA (lc_collate)); + } +#endif /* HAVE_USELOCALE */ +#endif /* HAVE_USELOCALE || HAVE_SETLOCALE */ + + res = wcscoll (p1, p2); + +#ifdef HAVE_USELOCALE + /* Free the locale object, and reset. */ + if (loc) + freelocale (loc); + if (oldloc) + uselocale (oldloc); +#elif defined (HAVE_SETLOCALE) + /* Restore the original locale. */ + if (oldloc) + setlocale (LC_COLLATE, oldloc); +#endif /* HAVE_USELOCALE */ + + /* Return result. */ + SAFE_FREE (); + return res; +} +#endif /* __STDC_ISO_10646__ */ --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 24 10:54:22 2014 Received: (at 18051) by debbugs.gnu.org; 24 Aug 2014 14:54:22 +0000 Received: from localhost ([127.0.0.1]:51059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLZBV-0003fi-M7 for submit@debbugs.gnu.org; Sun, 24 Aug 2014 10:54:22 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:56418) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLZBS-0003fU-VN for 18051@debbugs.gnu.org; Sun, 24 Aug 2014 10:54:19 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NAT00100FHOJP00@a-mtaout20.012.net.il> for 18051@debbugs.gnu.org; Sun, 24 Aug 2014 17:54:13 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAT0019NG2CGI40@a-mtaout20.012.net.il>; Sun, 24 Aug 2014 17:54:13 +0300 (IDT) Date: Sun, 24 Aug 2014 17:54:18 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <8738cnuev3.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus Message-id: <83zjeukkf9.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <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> <87ha147gd5.fsf@gmx.de> <83a96vmv80.fsf@gnu.org> <87a96vuph7.fsf@gmx.de> <8361hjm7pr.fsf@gnu.org> <8738cnuev3.fsf@gmx.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org > Date: Sat, 23 Aug 2014 22:32:00 +0200 > > >> > Btw, I wonder whether we should have a way to pass the locale string > >> > explicitly, instead of relying on $LC_COLLATE. > >> > >> We could add an optional argument to string-collate-*. But this would > >> break signature equivalence with string-lessp and string-equal, > >> respectively. > >> > >> Or we could introduce a global var, which shall be let-bound to the > >> locale string. > > > > Or have a new optional argument in string-lessp etc., or introduce a > > new set of APIs which will accept a locale, and have string-lessp > > etc. call them with that argument nil. > > An optional argument to string-lessp could be inconvenient. IMHO, the > most important use-case of string-lessp is being a PREDICATE of > sort. This does not support optional arguments. In those cases, we should add the same optional argument to the sort function. > Extended patch appended. Thanks. I wonder what should this do if the new locale cannot be instantiated/installed. As you wrote the code, it will silently use the current locale, but I wonder if that's TRT. Other than that, I think you should install this. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 24 12:18:37 2014 Received: (at 18051) by debbugs.gnu.org; 24 Aug 2014 16:18:37 +0000 Received: from localhost ([127.0.0.1]:51084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLaV2-0005ih-OT for submit@debbugs.gnu.org; Sun, 24 Aug 2014 12:18:37 -0400 Received: from mout.gmx.net ([212.227.17.22]:51710) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLaUz-0005iQ-Nq for 18051@debbugs.gnu.org; Sun, 24 Aug 2014 12:18:34 -0400 Received: from detlef.gmx.de ([87.146.44.27]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0M2cDB-1WWNUK0Xob-00sPvq; Sun, 24 Aug 2014 18:18:25 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <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> <87ha147gd5.fsf@gmx.de> <83a96vmv80.fsf@gnu.org> <87a96vuph7.fsf@gmx.de> <8361hjm7pr.fsf@gnu.org> <8738cnuev3.fsf@gmx.de> <83zjeukkf9.fsf@gnu.org> Date: Sun, 24 Aug 2014 18:18:24 +0200 In-Reply-To: <83zjeukkf9.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 24 Aug 2014 17:54:18 +0300") Message-ID: <87zjetvp2n.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:DmUBqGE58GzVT17qRj19xlvVXj/VkyyVJVMCdHEx5oqphrNcr4y ouo2Kb3sw1m4t3atPJUT+WhGnvh6WWOyWSLJJKqzBsjLDrU2o2to+VIcDBe5qjUzivEPuD1 brMpfXS3uQ1ISqV5V9M6ymS/4vbGP0kmctCGi4kxw+avo2Ov/vGaHE+yf0FPROnnKjPUsvu hOOLfH+zSzHQLQBl46BeQ== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: >> > Or have a new optional argument in string-lessp etc., or introduce a >> > new set of APIs which will accept a locale, and have string-lessp >> > etc. call them with that argument nil. >> >> An optional argument to string-lessp could be inconvenient. IMHO, the >> most important use-case of string-lessp is being a PREDICATE of >> sort. This does not support optional arguments. > > In those cases, we should add the same optional argument to the sort > function. That would be an option. But it would take decades, until all appearences of sort have been adapted. That's why I'm in favor of a global variable, which could be let-bounded. But I don't oppose strongly to your proposal. > I wonder what should this do if the new locale cannot be > instantiated/installed. As you wrote the code, it will silently use > the current locale, but I wonder if that's TRT. We could raise a warning. But if it is used in sort with a huge list of strings, the user would be flooded with those warnings. Maybe we could add a function, which would tell whether a given locale value would have effect. The user could check then. > Other than that, I think you should install this. Done. Next days I'm on the road; the work still missing (extending Elisp manual, writing ert tests, adapting ls-lisp) must be postponed to later this week, or the week after. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 25 01:48:28 2014 Received: (at 18051) by debbugs.gnu.org; 25 Aug 2014 05:48:29 +0000 Received: from localhost ([127.0.0.1]:51288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLn8l-0001BV-VF for submit@debbugs.gnu.org; Mon, 25 Aug 2014 01:48:28 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:43232) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLn8i-0001BE-KQ for 18051@debbugs.gnu.org; Mon, 25 Aug 2014 01:48:25 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 85FCAA6000D; Sun, 24 Aug 2014 22:48:18 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PARLjmuG7dkD; Sun, 24 Aug 2014 22:48:09 -0700 (PDT) Received: from [192.168.1.9] (pool-71-177-17-123.lsanca.dsl-w.verizon.net [71.177.17.123]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 77A26A60007; Sun, 24 Aug 2014 22:48:09 -0700 (PDT) Message-ID: <53FACE18.2060801@cs.ucla.edu> Date: Sun, 24 Aug 2014 22:48:08 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Dmitry Antipov Subject: Re: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> In-Reply-To: <53FAB5F9.9050706@yandex.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, Michael Albinus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Dmitry Antipov wrote: > ../../trunk/src/sysdep.c:3527:1: error: no previous prototype for > ‘str_collate’ [-Werror=missing-prototypes] I fixed that problem, along with some other minor glitches associated with the patch, in trunk bzr 117733. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 25 02:20:01 2014 Received: (at 18051) by debbugs.gnu.org; 25 Aug 2014 06:20:01 +0000 Received: from localhost ([127.0.0.1]:51292 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLndI-0001yt-2k for submit@debbugs.gnu.org; Mon, 25 Aug 2014 02:20:00 -0400 Received: from forward3l.mail.yandex.net ([84.201.143.136]:52009) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLndE-0001yc-Qu for 18051@debbugs.gnu.org; Mon, 25 Aug 2014 02:19:58 -0400 Received: from smtp18.mail.yandex.net (smtp18.mail.yandex.net [95.108.252.18]) by forward3l.mail.yandex.net (Yandex) with ESMTP id 67B7B1500BFD; Mon, 25 Aug 2014 10:19:49 +0400 (MSK) Received: from smtp18.mail.yandex.net (localhost [127.0.0.1]) by smtp18.mail.yandex.net (Yandex) with ESMTP id CD7DA18A0042; Mon, 25 Aug 2014 10:19:48 +0400 (MSK) Received: from unknown (unknown [37.139.80.10]) by smtp18.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id k8PNXLglsH-JmWiAdDn; Mon, 25 Aug 2014 10:19:48 +0400 (using TLSv1.2 with cipher AES128-SHA (128/128 bits)) (Client certificate not present) X-Yandex-Uniq: 0e00a20f-5380-4fcd-ba8e-7b65646358d4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1408947588; bh=+qTJCg7RkuGpcag2tov7A7pkAyGFMwUFUdWKJC9LWiM=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=DrqENATvn8JXNtQsE3tqNa/8WYn8eGhDm2wHuA94Jw1Zn0VT5dIUbybCscXrqLqUf D41VmMYwdQ7j4P2l6c3Q0YpspTuOC+qtx/WUK8OgWc0Am8m7m85ctP7K6jMRmFPK52 EobngrhvY5/ZFhUt9V1KjCYMZuSvlHC2Rl4Yjodk= Authentication-Results: smtp18.mail.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <53FAD584.7070708@yandex.ru> Date: Mon, 25 Aug 2014 10:19:48 +0400 From: Dmitry Antipov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Paul Eggert , Michael Albinus Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> In-Reply-To: <53FACE18.2060801@cs.ucla.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On 08/25/2014 09:48 AM, Paul Eggert wrote: > I fixed that problem, along with some other minor glitches > associated with the patch, in trunk bzr 117733. Thanks. BTW, I think that collation functions with 3rd optional argument to specify locale settings will be a bit more versatile, e.g. (string-collate-lessp a b "es_ES.UTF-8") Dmitry From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 25 02:41:24 2014 Received: (at 18051) by debbugs.gnu.org; 25 Aug 2014 06:41:25 +0000 Received: from localhost ([127.0.0.1]:51297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLny0-0002Y1-Hc for submit@debbugs.gnu.org; Mon, 25 Aug 2014 02:41:24 -0400 Received: from mout.gmx.net ([212.227.15.18]:55467) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLnxx-0002Xl-5Z for 18051@debbugs.gnu.org; Mon, 25 Aug 2014 02:41:22 -0400 Received: from detlef.gmx.de ([93.209.75.16]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MQiB3-1WuXoi0puH-00TybH; Mon, 25 Aug 2014 08:41:05 +0200 From: Michael Albinus To: Dmitry Antipov Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> Date: Mon, 25 Aug 2014 08:41:03 +0200 In-Reply-To: <53FAD584.7070708@yandex.ru> (Dmitry Antipov's message of "Mon, 25 Aug 2014 10:19:48 +0400") Message-ID: <87r405t6kg.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:b1WN9gyP2cP8W/AoyRVRSkckZEerqym/oN68BrC0x+BGZ+KMQ46 /4y1t4vORIc6KoqmWqBnMR44ON+epWJnfrh1hqYiHnuTdw6ZFsNECkdSORGAF2oWKsoLwN3 TDsHRHSkU68FA1KtjUAcJH5WNLiJ9vq8J3gm3neRf1yb/7Dv3zX8Lj3s07auzYoOzs13hvM n5xLebV4SvFQDEDNUXbag== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: Paul Eggert , 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Dmitry Antipov writes: > BTW, I think that collation functions with 3rd optional argument > to specify locale settings will be a bit more versatile, e.g. > > (string-collate-lessp a b "es_ES.UTF-8") We discuss this already, see My major reservation to this approach is that it doesn't fit well using string-collate-lessp as predicate of sort. That's why I have proposed a global variable as alternative, which could be let-bounded. > Dmitry Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 25 11:01:07 2014 Received: (at 18051) by debbugs.gnu.org; 25 Aug 2014 15:01:07 +0000 Received: from localhost ([127.0.0.1]:51827 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLvla-0007zD-Sp for submit@debbugs.gnu.org; Mon, 25 Aug 2014 11:01:07 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:48321) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLvlX-0007z3-HU for 18051@debbugs.gnu.org; Mon, 25 Aug 2014 11:01:04 -0400 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s7PF11iX022832; Mon, 25 Aug 2014 11:01:02 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id C1D22AE093; Mon, 25 Aug 2014 11:01:00 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? Message-ID: References: <87ha2f5gp8.fsf@web.de> <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> <87ha147gd5.fsf@gmx.de> <83a96vmv80.fsf@gnu.org> <87a96vuph7.fsf@gmx.de> <8361hjm7pr.fsf@gnu.org> <8738cnuev3.fsf@gmx.de> <83zjeukkf9.fsf@gnu.org> Date: Mon, 25 Aug 2014 11:01:00 -0400 In-Reply-To: <83zjeukkf9.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 24 Aug 2014 17:54:18 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5044=0 X-NAI-Spam-Version: 2.3.0.9378 : core <5044> : inlines <1204> : streams <1273416> : uri <1806572> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org, Michael Albinus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) >> An optional argument to string-lessp could be inconvenient. IMHO, the >> most important use-case of string-lessp is being a PREDICATE of >> sort. This does not support optional arguments. Of course it does: (sort foo (lambda (x y) (string-lessp x y 'optional-arg))) -- Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 25 11:03:37 2014 Received: (at 18051) by debbugs.gnu.org; 25 Aug 2014 15:03:38 +0000 Received: from localhost ([127.0.0.1]:51834 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLvo1-00083C-Et for submit@debbugs.gnu.org; Mon, 25 Aug 2014 11:03:37 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:51358) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLvnw-00082j-3X for 18051@debbugs.gnu.org; Mon, 25 Aug 2014 11:03:33 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NAV00A00AV1LO00@a-mtaout22.012.net.il> for 18051@debbugs.gnu.org; Mon, 25 Aug 2014 18:03:25 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAV00ACQB5OB350@a-mtaout22.012.net.il>; Mon, 25 Aug 2014 18:03:25 +0300 (IDT) Date: Mon, 25 Aug 2014 18:03:32 +0300 From: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. In-reply-to: <87r405t6kg.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus Message-id: <83mwasligr.fsf@gnu.org> References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: dmantipov@yandex.ru, 18051@debbugs.gnu.org, eggert@cs.ucla.edu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Date: Mon, 25 Aug 2014 08:41:03 +0200 > Cc: Paul Eggert , 18051@debbugs.gnu.org > > > BTW, I think that collation functions with 3rd optional argument > > to specify locale settings will be a bit more versatile, e.g. > > > > (string-collate-lessp a b "es_ES.UTF-8") > > We discuss this already, see > > > My major reservation to this approach is that it doesn't fit well using > string-collate-lessp as predicate of sort. That's why I have proposed a > global variable as alternative, which could be let-bounded. I think that binding a variable will indeed be cleaner. Using process-environment for that purpose should be reserved for the application level. Also, what if LC_COLLATE is not set in the environment, but 'setlocale' does return some value for it? shouldn't we use that? Here are a few more thoughts about related issues: 1. Why does str_collate return a ptrdiff_t value? AFAIK, wcscoll etc. return int data type, and of rather small values. 2. Should we signal an error if the input strings are not pure-ASCII or multibyte? Unibyte strings will at best cause incorrect results. And what about strings with invalid codepoints, e.g. those outside of the Unicode range, which can happen inside Lisp strings? 3. What about errors in wcscoll? The current code ignores them; however, the value returned by wcscoll in case of an error is not documented, so it could be random. Should we signal an error if errno gets set by wcscoll? 4. How to control the optional features of the collating sequence? I mean, for example, the fact that punctuation characters are ignored in the .UTF-8 locales on glibc hosts (or so it seems). At least on Windows, a somewhat higher degree of control is available, but it must be specified separately of the locale ID. E.g., the comparison function accepts flags to ignore punctuation and symbols, width differences, diacritics, etc. Should we have another variable, perhaps w32-specific, to request these features? Alternatively, we could use .UTF-8 on Windows to communicate that, although that sounds like a kludge. 5. The locale names on Windows are different from Posix: Windows uses 3-letter abbreviations of the country and the language, e.g. "fra_FRA" instead of the Posix "fr_FR". Do we want the locale string values used for let-binding the above-mentioned variable to be portable across systems? Then we'd need some conversion database on MS-Windows. 6. I think we will want case-insensitive version of this function. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 25 12:01:50 2014 Received: (at 18051) by debbugs.gnu.org; 25 Aug 2014 16:01:50 +0000 Received: from localhost ([127.0.0.1]:51892 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLwiL-00016h-NZ for submit@debbugs.gnu.org; Mon, 25 Aug 2014 12:01:49 -0400 Received: from mtaout26.012.net.il ([80.179.55.182]:42406) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLwiJ-00016R-FJ for 18051@debbugs.gnu.org; Mon, 25 Aug 2014 12:01:48 -0400 Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0NAV00600DLKDV00@mtaout26.012.net.il> for 18051@debbugs.gnu.org; Mon, 25 Aug 2014 18:59:58 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAV002E5DRYK440@mtaout26.012.net.il>; Mon, 25 Aug 2014 18:59:58 +0300 (IDT) Date: Mon, 25 Aug 2014 19:01:48 +0300 From: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. In-reply-to: <83mwasligr.fsf@gnu.org> X-012-Sender: halo1@inter.net.il To: michael.albinus@gmx.de Message-id: <83iolglfrn.fsf@gnu.org> References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: dmantipov@yandex.ru, 18051@debbugs.gnu.org, eggert@cs.ucla.edu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) This is now implemented for MS-Windows as well. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 25 12:45:12 2014 Received: (at 18051) by debbugs.gnu.org; 25 Aug 2014 16:45:12 +0000 Received: from localhost ([127.0.0.1]:51912 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLxOJ-0002Oa-JO for submit@debbugs.gnu.org; Mon, 25 Aug 2014 12:45:11 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:39732 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLxOG-0002OS-Up for 18051@debbugs.gnu.org; Mon, 25 Aug 2014 12:45:09 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1XLxOF-00006D-VR; Mon, 25 Aug 2014 12:45:08 -0400 From: Glenn Morris To: Michael Albinus Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.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> <87ha147gd5.fsf@gmx.de> <83a96vmv80.fsf@gnu.org> <87a96vuph7.fsf@gmx.de> <8361hjm7pr.fsf@gnu.org> <8738cnuev3.fsf@gmx.de> X-Spook: target Taiwan militia Saddam Hussein War on Terrorism X-Ran: y}l"]%J.PLorDr;beajvR6x.} X-Hue: green X-Debbugs-No-Ack: yes X-Attribution: GM Date: Mon, 25 Aug 2014 12:45:07 -0400 In-Reply-To: <8738cnuev3.fsf@gmx.de> (Michael Albinus's message of "Sat, 23 Aug 2014 22:32:00 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, Eli Zaretskii , 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Michael Albinus wrote: > An optional argument to string-lessp could be inconvenient. IMHO, the > most important use-case of string-lessp is being a PREDICATE of > sort. This does not support optional arguments. So make the argument optional, but defaulting to what the locale says. BTW, this is http://debbugs.gnu.org/2263 (and 12008). From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 25 13:36:04 2014 Received: (at 18051) by debbugs.gnu.org; 25 Aug 2014 17:36:04 +0000 Received: from localhost ([127.0.0.1]:51932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLyBY-0005Hu-9i for submit@debbugs.gnu.org; Mon, 25 Aug 2014 13:36:04 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:52959) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XLyBU-0005HC-KT for 18051@debbugs.gnu.org; Mon, 25 Aug 2014 13:36:02 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NAV00G00HWL0I00@a-mtaout20.012.net.il> for 18051@debbugs.gnu.org; Mon, 25 Aug 2014 20:35:53 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAV00FALI7TRS60@a-mtaout20.012.net.il>; Mon, 25 Aug 2014 20:35:53 +0300 (IDT) Date: Mon, 25 Aug 2014 20:36:01 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: X-012-Sender: halo1@inter.net.il To: Glenn Morris Message-id: <83fvgklbem.fsf@gnu.org> References: <87ha2f5gp8.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> <87ha147gd5.fsf@gmx.de> <83a96vmv80.fsf@gnu.org> <87a96vuph7.fsf@gmx.de> <8361hjm7pr.fsf@gnu.org> <8738cnuev3.fsf@gmx.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Glenn Morris > Cc: Eli Zaretskii , michael_heerdegen@web.de, 18051@debbugs.gnu.org > Date: Mon, 25 Aug 2014 12:45:07 -0400 > > BTW, this is http://debbugs.gnu.org/2263 (and 12008). They should obviously be closed now, both of them. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 04:49:21 2014 Received: (at 18051) by debbugs.gnu.org; 27 Aug 2014 08:49:21 +0000 Received: from localhost ([127.0.0.1]:53190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMYuv-0004xn-By for submit@debbugs.gnu.org; Wed, 27 Aug 2014 04:49:21 -0400 Received: from mout.gmx.net ([212.227.15.19]:60600) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMYuq-0004xY-K3 for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 04:49:17 -0400 Received: from detlef.gmx.de ([87.146.47.172]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MYOkT-1WrZg52nJZ-00V8My; Wed, 27 Aug 2014 10:49:08 +0200 From: Michael Albinus To: Stefan Monnier Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.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> <87ha147gd5.fsf@gmx.de> <83a96vmv80.fsf@gnu.org> <87a96vuph7.fsf@gmx.de> <8361hjm7pr.fsf@gnu.org> <8738cnuev3.fsf@gmx.de> <83zjeukkf9.fsf@gnu.org> Date: Wed, 27 Aug 2014 10:49:05 +0200 In-Reply-To: (Stefan Monnier's message of "Mon, 25 Aug 2014 11:01:00 -0400") Message-ID: <878uma2u7y.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:4eZhRoAZjtICCRiYdbVmRGpJxckzLzYJin4PYgSa752Rq882WRz JuwvCpPw6CkToRHCCAQcT2WaPmemlsEMPJBcDml8nT9TmqNFtn6OEX6TCyZLkNPYHc0RZnz NIDHURLujJT47xRUXOsn8c38vuD+RJOLywDQZYnO7eP8wFx5OJJ2ZJJIRtFF7o0PFtskqzQ jyprylW0J3Gz900rp9qMw== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, Eli Zaretskii , 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Stefan Monnier writes: >>> An optional argument to string-lessp could be inconvenient. IMHO, the >>> most important use-case of string-lessp is being a PREDICATE of >>> sort. This does not support optional arguments. > > Of course it does: > > (sort foo (lambda (x y) (string-lessp x y 'optional-arg))) Yes, but this would also expect optional-arg to be a variable which can be set by the user. That's similar to what I have proposed, I believe. > -- Stefan Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 07:25:06 2014 Received: (at 18051) by debbugs.gnu.org; 27 Aug 2014 11:25:06 +0000 Received: from localhost ([127.0.0.1]:53230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMbLc-0000KV-UJ for submit@debbugs.gnu.org; Wed, 27 Aug 2014 07:25:05 -0400 Received: from mout.gmx.net ([212.227.15.18]:55280) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMbLY-0000Jl-3s for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 07:25:01 -0400 Received: from detlef.gmx.de ([87.146.47.172]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0LpbJm-1WiLBK2RLa-00fObI; Wed, 27 Aug 2014 13:24:52 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> Date: Wed, 27 Aug 2014 13:24:48 +0200 In-Reply-To: <83mwasligr.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 25 Aug 2014 18:03:32 +0300") Message-ID: <87wq9u18fz.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:Leyp+tSa9Dbjum8KIZWp3GvzOwdVChdXBlzrWjhP6XrSAXeYDuj +GoC7pEigQT4D+wme73Iw4FgxLq4WJ3hX0/iKHH0WddSBpfCZnGBs7GXLmfD1KWXxzryHmc 37rjZHgih8X/2epIc4A0HbWBIa9KGIBDdccG3NqqBzUC1Xg9UXPfFpUs3GviMM9ZT/QPVLb 631b1GjytRvbxzlee+lmA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: dmantipov@yandex.ru, 18051@debbugs.gnu.org, eggert@cs.ucla.edu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > Here are a few more thoughts about related issues: > > 1. Why does str_collate return a ptrdiff_t value? AFAIK, wcscoll > etc. return int data type, and of rather small values. Hm, yes. Both wcscoll and w32_compare_strings return int, so I've changed that for str_collate accordingly. > 2. Should we signal an error if the input strings are not pure-ASCII > or multibyte? Unibyte strings will at best cause incorrect > results. Maybe we shall convert the strings to multibyte, via string_to_multibyte()? If the string is already multibyte, it doesn't harm. > And what about strings with invalid codepoints, > e.g. those outside of the Unicode range, which can happen inside > Lisp strings? > 3. What about errors in wcscoll? The current code ignores them; > however, the value returned by wcscoll in case of an error is not > documented, so it could be random. Should we signal an error if > errno gets set by wcscoll? wcscoll sets EINVAL when the codepoint is out of range. I've added a check for this case, returning an error. (string-collate-equalp (string 1) (string ?\U0020FFFF)) => error: Non-Unicode character: 0x20ffff > 4. How to control the optional features of the collating sequence? I > mean, for example, the fact that punctuation characters are ignored > in the .UTF-8 locales on glibc hosts (or so it seems). At least on > Windows, a somewhat higher degree of control is available, but it > must be specified separately of the locale ID. E.g., the > comparison function accepts flags to ignore punctuation and > symbols, width differences, diacritics, etc. Should we have another > variable, perhaps w32-specific, to request these features? > Alternatively, we could use .UTF-8 on Windows to communicate that, > although that sounds like a kludge. In Posix systems, I'm not aware of configuring such optional features via glibc. The most granular selection is what you dou with LC_COLLATE. If we want to offer more granular settings, we would need to use a library like libicu (http://icu-project.org/). Could be done, but should be optional. > 5. The locale names on Windows are different from Posix: Windows uses > 3-letter abbreviations of the country and the language, > e.g. "fra_FRA" instead of the Posix "fr_FR". Do we want the locale > string values used for let-binding the above-mentioned variable to > be portable across systems? Then we'd need some conversion > database on MS-Windows. Here I'm a bit undecided. We could let it to the users to find the proper locale name, but this is inconvenient. OTOH it would be much work to install a mapping system, and we would need to maintain it. What if there would be a new "en_SC" (Scotland) locale? We would need to maintain such changes in Emacs forever ... > 6. I think we will want case-insensitive version of this function. That's also on my todo list. But I'm a little bit undecided whether we shall add it to string-collate-* functions, or whether there shall be further functions. Maybe we could use sort-fold-case for this as indication? Or is this too specific? Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 11:36:59 2014 Received: (at 18051) by debbugs.gnu.org; 27 Aug 2014 15:36:59 +0000 Received: from localhost ([127.0.0.1]:53739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMfHO-00048m-HI for submit@debbugs.gnu.org; Wed, 27 Aug 2014 11:36:58 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:55364) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMfHM-00048W-1h for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 11:36:57 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NAZ00F001IJVX00@a-mtaout22.012.net.il> for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 18:36:49 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAZ00FYB21DNC50@a-mtaout22.012.net.il>; Wed, 27 Aug 2014 18:36:49 +0300 (IDT) Date: Wed, 27 Aug 2014 18:37:01 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <878uma2u7y.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus Message-id: <83lhqaj65e.fsf@gnu.org> References: <87ha2f5gp8.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> <87ha147gd5.fsf@gmx.de> <83a96vmv80.fsf@gnu.org> <87a96vuph7.fsf@gmx.de> <8361hjm7pr.fsf@gnu.org> <8738cnuev3.fsf@gmx.de> <83zjeukkf9.fsf@gnu.org> <878uma2u7y.fsf@gmx.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Cc: Eli Zaretskii , michael_heerdegen@web.de, 18051@debbugs.gnu.org > Date: Wed, 27 Aug 2014 10:49:05 +0200 > > Stefan Monnier writes: > > >>> An optional argument to string-lessp could be inconvenient. IMHO, the > >>> most important use-case of string-lessp is being a PREDICATE of > >>> sort. This does not support optional arguments. > > > > Of course it does: > > > > (sort foo (lambda (x y) (string-lessp x y 'optional-arg))) > > Yes, but this would also expect optional-arg to be a variable which can > be set by the user. That's similar to what I have proposed, I believe. True. So I suggest to define a new variable, say, string-collate-options, which is a key-value list with up to 2 members: ':locale' (a string), and ':case-fold' (a flag). If the locale's codeset is UTF-8, the collation on Windows will emulate what glibc evidently does. Lisp programs will bind string-collate-options to the value they need. Then we can remove the reference to process-environment from the code of string_collate. WDYT? From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 11:40:18 2014 Received: (at 18051) by debbugs.gnu.org; 27 Aug 2014 15:40:18 +0000 Received: from localhost ([127.0.0.1]:53743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMfKb-0004E9-CY for submit@debbugs.gnu.org; Wed, 27 Aug 2014 11:40:18 -0400 Received: from mtaout26.012.net.il ([80.179.55.182]:54528) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMfKY-0004Du-4t for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 11:40:15 -0400 Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0NAZ00G00235AL00@mtaout26.012.net.il> for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 18:38:23 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAZ006B223Y0IA0@mtaout26.012.net.il>; Wed, 27 Aug 2014 18:38:23 +0300 (IDT) Date: Wed, 27 Aug 2014 18:40:20 +0300 From: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. In-reply-to: <87wq9u18fz.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus Message-id: <83k35uj5zv.fsf@gnu.org> References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: dmantipov@yandex.ru, 18051@debbugs.gnu.org, eggert@cs.ucla.edu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Cc: dmantipov@yandex.ru, eggert@cs.ucla.edu, 18051@debbugs.gnu.org > Date: Wed, 27 Aug 2014 13:24:48 +0200 > > > 2. Should we signal an error if the input strings are not pure-ASCII > > or multibyte? Unibyte strings will at best cause incorrect > > results. > > Maybe we shall convert the strings to multibyte, via string_to_multibyte()? That will not help. I say code that invokes these functions with unibyte non-ASCII strings has a bug that should be flagged. > > 5. The locale names on Windows are different from Posix: Windows uses > > 3-letter abbreviations of the country and the language, > > e.g. "fra_FRA" instead of the Posix "fr_FR". Do we want the locale > > string values used for let-binding the above-mentioned variable to > > be portable across systems? Then we'd need some conversion > > database on MS-Windows. > > Here I'm a bit undecided. We could let it to the users to find the > proper locale name, but this is inconvenient. OTOH it would be much work > to install a mapping system, and we would need to maintain it. What if > there would be a new "en_SC" (Scotland) locale? We would need to > maintain such changes in Emacs forever ... I think these interfaces will almost always be used with the current locale. So with that in mind, I think we can document this issue, and then safely leave this problem to the code that needs to use non-default locales. > > 6. I think we will want case-insensitive version of this function. > > That's also on my todo list. But I'm a little bit undecided whether we > shall add it to string-collate-* functions, or whether there shall be > further functions. > > Maybe we could use sort-fold-case for this as indication? Or is this too > specific? See my suggestion in the other message. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 11:48:40 2014 Received: (at 18051) by debbugs.gnu.org; 27 Aug 2014 15:48:40 +0000 Received: from localhost ([127.0.0.1]:53763 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMfSh-0004TF-Qz for submit@debbugs.gnu.org; Wed, 27 Aug 2014 11:48:40 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:56509 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMfSf-0004T6-2g for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 11:48:37 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1XMfSe-00060c-AF; Wed, 27 Aug 2014 11:48:36 -0400 From: Glenn Morris To: Michael Albinus Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <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> <87ha147gd5.fsf@gmx.de> <83a96vmv80.fsf@gnu.org> <87a96vuph7.fsf@gmx.de> <8361hjm7pr.fsf@gnu.org> <8738cnuev3.fsf@gmx.de> <83zjeukkf9.fsf@gnu.org> <878uma2u7y.fsf@gmx.de> X-Spook: genetic MIT-LL Craig Livingstone Serbian COSCO Plame X-Ran: ])7c.b?R9nC9YpeyN=clWze0Ux0=q8m{5$9i@g4%va/p-Y<9mI,xxPXvRVWaQ_p=4fyj@" X-Hue: cyan X-Debbugs-No-Ack: yes X-Attribution: GM Date: Wed, 27 Aug 2014 11:48:36 -0400 In-Reply-To: <878uma2u7y.fsf@gmx.de> (Michael Albinus's message of "Wed, 27 Aug 2014 10:49:05 +0200") Message-ID: <4yzjeqq6gb.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Michael Albinus wrote: >> (sort foo (lambda (x y) (string-lessp x y 'optional-arg))) > > Yes, but this would also expect optional-arg to be a variable which can > be set by the user. 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. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 12:53:22 2014 Received: (at 18051) by debbugs.gnu.org; 27 Aug 2014 16:53:22 +0000 Received: from localhost ([127.0.0.1]:53783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMgTJ-0007MN-SI for submit@debbugs.gnu.org; Wed, 27 Aug 2014 12:53:22 -0400 Received: from mtaout27.012.net.il ([80.179.55.183]:50693) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMgTH-0007M4-SS for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 12:53:20 -0400 Received: from conversion-daemon.mtaout27.012.net.il by mtaout27.012.net.il (HyperSendmail v2007.08) id <0NAZ00L004ZWCS00@mtaout27.012.net.il> for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 19:47:51 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout27.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAZ00KPD5BRFP20@mtaout27.012.net.il>; Wed, 27 Aug 2014 19:47:51 +0300 (IDT) Date: Wed, 27 Aug 2014 19:53:25 +0300 From: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? In-reply-to: <4yzjeqq6gb.fsf@fencepost.gnu.org> X-012-Sender: halo1@inter.net.il To: Glenn Morris Message-id: <83egw1kh6i.fsf@gnu.org> References: <87ha2f5gp8.fsf@web.de> <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> <87ha147gd5.fsf@gmx.de> <83a96vmv80.fsf@gnu.org> <87a96vuph7.fsf@gmx.de> <8361hjm7pr.fsf@gnu.org> <8738cnuev3.fsf@gmx.de> <83zjeukkf9.fsf@gnu.org> <878uma2u7y.fsf@gmx.de> <4yzjeqq6gb.fsf@fencepost.gnu.org> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Glenn Morris > Date: Wed, 27 Aug 2014 11:48:36 -0400 > Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org > > Normally one controls functions through their arguments, not the > environment. We also have the other variety, e.g. see coding-system-for-read. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 14:02:25 2014 Received: (at 18051) by debbugs.gnu.org; 27 Aug 2014 18:02:25 +0000 Received: from localhost ([127.0.0.1]:53803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMhY8-0000d0-68 for submit@debbugs.gnu.org; Wed, 27 Aug 2014 14:02:24 -0400 Received: from mout.gmx.net ([212.227.15.15]:55041) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMhY5-0000cj-Tk for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 14:02:22 -0400 Received: from detlef.gmx.de ([87.146.47.172]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0Lkx9B-1WmoMb1lFl-00aq03; Wed, 27 Aug 2014 20:02:12 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.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> <87ha147gd5.fsf@gmx.de> <83a96vmv80.fsf@gnu.org> <87a96vuph7.fsf@gmx.de> <8361hjm7pr.fsf@gnu.org> <8738cnuev3.fsf@gmx.de> <83zjeukkf9.fsf@gnu.org> <878uma2u7y.fsf@gmx.de> <83lhqaj65e.fsf@gnu.org> Date: Wed, 27 Aug 2014 20:02:08 +0200 In-Reply-To: <83lhqaj65e.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 27 Aug 2014 18:37:01 +0300") Message-ID: <87sikhu7z3.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:j2zj0X8pKdrSAfE33jNFhFwtVuQvghKyxZ5SeyNbn9LOLpRQLI2 1UBWmA6TYzxJwIXDutUXxPMeKQPvtRq1Oet6mWoepJAKrs/B+EZnB+vlJ4y4aZz4RkNCagL HfDY2phcItnyqfQhEUen3MHvyB0n9MFQG73+v5gn0dfBYfhVon3+0KX6zcRZ1XCWNsGAgor jBwRoE8taeaKOl9DYz1bw== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org, monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > True. So I suggest to define a new variable, say, > string-collate-options, which is a key-value list with up to 2 > members: ':locale' (a string), and ':case-fold' (a flag). If the > locale's codeset is UTF-8, the collation on Windows will emulate what > glibc evidently does. Lisp programs will bind string-collate-options > to the value they need. > > Then we can remove the reference to process-environment from the code > of string_collate. > > WDYT? Sounds OK to me. Nest regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 14:08:44 2014 Received: (at 18051) by debbugs.gnu.org; 27 Aug 2014 18:08:44 +0000 Received: from localhost ([127.0.0.1]:53808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMheF-0000m8-Ed for submit@debbugs.gnu.org; Wed, 27 Aug 2014 14:08:43 -0400 Received: from mout.gmx.net ([212.227.15.18]:65353) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMheC-0000lu-DJ for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 14:08:41 -0400 Received: from detlef.gmx.de ([87.146.47.172]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MbgKD-1X4LRh3olp-00J1yG; Wed, 27 Aug 2014 20:08:29 +0200 From: Michael Albinus To: Glenn Morris Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.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> <87ha147gd5.fsf@gmx.de> <83a96vmv80.fsf@gnu.org> <87a96vuph7.fsf@gmx.de> <8361hjm7pr.fsf@gnu.org> <8738cnuev3.fsf@gmx.de> <83zjeukkf9.fsf@gnu.org> <878uma2u7y.fsf@gmx.de> <4yzjeqq6gb.fsf@fencepost.gnu.org> Date: Wed, 27 Aug 2014 20:08:25 +0200 In-Reply-To: <4yzjeqq6gb.fsf@fencepost.gnu.org> (Glenn Morris's message of "Wed, 27 Aug 2014 11:48:36 -0400") Message-ID: <87oav5u7om.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:j/r+JCfdxZCFks32W+P1ggO+uG+jPb6fVsvKyEjGLU6D/QUMuVY dYb/dMrIwzrkyZ9bb0uaC0OPlXzW668jyNx1unGaDcLF8JSBaRbejWc2DkXt0VMcjgk2+Nv Gw+nKxNVfx6W+jTFht2J5SrSZLvd8oG9ljhzBKHFSwWUnt5YY3g8eA1G8YNsMaIquCuvSGY qC1XufUS0NJoNWM8gm5uA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Glenn Morris 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. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 14:12:30 2014 Received: (at 18051) by debbugs.gnu.org; 27 Aug 2014 18:12:30 +0000 Received: from localhost ([127.0.0.1]:53812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMhhs-0000rn-P4 for submit@debbugs.gnu.org; Wed, 27 Aug 2014 14:12:29 -0400 Received: from mout.gmx.net ([212.227.15.18]:55321) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMhhq-0000rZ-HM for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 14:12:27 -0400 Received: from detlef.gmx.de ([87.146.47.172]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MfW5D-1WyGq33K4h-00P6ER; Wed, 27 Aug 2014 20:12:17 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <83k35uj5zv.fsf@gnu.org> Date: Wed, 27 Aug 2014 20:12:12 +0200 In-Reply-To: <83k35uj5zv.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 27 Aug 2014 18:40:20 +0300") Message-ID: <87k35tu7ib.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:rtfLWtpuzI1Wx3zma8MIIy/GC7xdWGJVW2tFCL7CKmWiJUVny7B DrR9Qh3CItVUglmZ+4mM37omwh51pYGUQsZBcQCMx7lb8fwEeDtpQ6BKNPgHJQAxuCB59hs Txxxhyx486f2TE+/D6lbfoCWJdm8OpjQ5tsWvGpWx/EoyMvQ/iFY0ViWrX/+mPG33nPRT+5 8MDWNtVxD+sDbq/j71qFQ== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: dmantipov@yandex.ru, 18051@debbugs.gnu.org, eggert@cs.ucla.edu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: >> > 2. Should we signal an error if the input strings are not pure-ASCII >> > or multibyte? Unibyte strings will at best cause incorrect >> > results. >> >> Maybe we shall convert the strings to multibyte, via string_to_multibyte()? > > That will not help. > > I say code that invokes these functions with unibyte non-ASCII strings > has a bug that should be flagged. Well, you have much more experience with unicode than I have. >> > 5. The locale names on Windows are different from Posix: Windows uses >> > 3-letter abbreviations of the country and the language, >> > e.g. "fra_FRA" instead of the Posix "fr_FR". Do we want the locale >> > string values used for let-binding the above-mentioned variable to >> > be portable across systems? Then we'd need some conversion >> > database on MS-Windows. >> >> Here I'm a bit undecided. We could let it to the users to find the >> proper locale name, but this is inconvenient. OTOH it would be much work >> to install a mapping system, and we would need to maintain it. What if >> there would be a new "en_SC" (Scotland) locale? We would need to >> maintain such changes in Emacs forever ... > > I think these interfaces will almost always be used with the current > locale. So with that in mind, I think we can document this issue, and > then safely leave this problem to the code that needs to use > non-default locales. I don't get this. What do you propose here? Set the locale specific to the system Emacs is running, or do you propose a mapping to something which is portable over system boundaries? > Thanks. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 14:26:38 2014 Received: (at 18051) by debbugs.gnu.org; 27 Aug 2014 18:26:38 +0000 Received: from localhost ([127.0.0.1]:53829 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMhvZ-0001E8-OP for submit@debbugs.gnu.org; Wed, 27 Aug 2014 14:26:38 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:50995) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMhvX-0001Dt-1t for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 14:26:36 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NAZ00H009UOJ100@a-mtaout22.012.net.il> for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 21:26:28 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAZ00GDE9W4X8A0@a-mtaout22.012.net.il>; Wed, 27 Aug 2014 21:26:28 +0300 (IDT) Date: Wed, 27 Aug 2014 21:26:41 +0300 From: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. In-reply-to: <87k35tu7ib.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus Message-id: <837g1tkcv2.fsf@gnu.org> References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <83k35uj5zv.fsf@gnu.org> <87k35tu7ib.fsf@gmx.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: dmantipov@yandex.ru, 18051@debbugs.gnu.org, eggert@cs.ucla.edu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Cc: dmantipov@yandex.ru, eggert@cs.ucla.edu, 18051@debbugs.gnu.org > Date: Wed, 27 Aug 2014 20:12:12 +0200 > > >> > 5. The locale names on Windows are different from Posix: Windows uses > >> > 3-letter abbreviations of the country and the language, > >> > e.g. "fra_FRA" instead of the Posix "fr_FR". Do we want the locale > >> > string values used for let-binding the above-mentioned variable to > >> > be portable across systems? Then we'd need some conversion > >> > database on MS-Windows. > >> > >> Here I'm a bit undecided. We could let it to the users to find the > >> proper locale name, but this is inconvenient. OTOH it would be much work > >> to install a mapping system, and we would need to maintain it. What if > >> there would be a new "en_SC" (Scotland) locale? We would need to > >> maintain such changes in Emacs forever ... > > > > I think these interfaces will almost always be used with the current > > locale. So with that in mind, I think we can document this issue, and > > then safely leave this problem to the code that needs to use > > non-default locales. > > I don't get this. What do you propose here? Set the locale specific to > the system Emacs is running, or do you propose a mapping to something > which is portable over system boundaries? The former. IOW, the (rare, IMO) Lisp program that wants to override the default locale will have to figure out how to do that in a way that works on all the supported platforms. E.g., one way is (let ((locale (if (eq system-type 'windows-nt) "enu_USA" "en_US"))) ... From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 14:30:25 2014 Received: (at 18051) by debbugs.gnu.org; 27 Aug 2014 18:30:25 +0000 Received: from localhost ([127.0.0.1]:53835 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMhzE-0001Kr-Gr for submit@debbugs.gnu.org; Wed, 27 Aug 2014 14:30:24 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:59643 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMhzA-0001Kg-Kh for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 14:30:21 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1XMhz9-0002Tr-J9; Wed, 27 Aug 2014 14:30:19 -0400 From: Glenn Morris To: Michael Albinus Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? References: <87ha2f5gp8.fsf@web.de> <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> <87ha147gd5.fsf@gmx.de> <83a96vmv80.fsf@gnu.org> <87a96vuph7.fsf@gmx.de> <8361hjm7pr.fsf@gnu.org> <8738cnuev3.fsf@gmx.de> <83zjeukkf9.fsf@gnu.org> <878uma2u7y.fsf@gmx.de> <4yzjeqq6gb.fsf@fencepost.gnu.org> <87oav5u7om.fsf@gmx.de> X-Spook: S Key ASLET Mole STARLAN Echelon bemd Panama government X-Ran: R:o[+?t0RVdk#8gWioM-~}&/2!lpb$CdLe!Q>s_zghhFbv&32Lj3NL*!DGDY8..n9R9,ku X-Hue: black X-Debbugs-No-Ack: yes X-Attribution: GM Date: Wed, 27 Aug 2014 14:30:19 -0400 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, 18051@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) You don't know how this feature will be used, because you just added it. Sometimes people will want to use it to "sort in the user's specified locale", sometimes they will want to use it to "sort according to some specific locale". An optional argument defaulting to LC_COLLATE makes both uses easy. (Adding a global lisp variable that overrides LC_COLLATE seems pointless but harmless to me.) Anyway, at this point I give up trying to get an optional argument added to a function. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 15:00:52 2014 Received: (at 18051) by debbugs.gnu.org; 27 Aug 2014 19:00:52 +0000 Received: from localhost ([127.0.0.1]:53856 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMiSh-00026n-FN for submit@debbugs.gnu.org; Wed, 27 Aug 2014 15:00:51 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:37965) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMiSc-00026X-Sz for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 15:00:48 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 9481739E8014; Wed, 27 Aug 2014 12:00:40 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xBgw7O+1HTf1; Wed, 27 Aug 2014 12:00:32 -0700 (PDT) Received: from [192.168.1.9] (pool-71-177-17-123.lsanca.dsl-w.verizon.net [71.177.17.123]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id EEC25A60005; Wed, 27 Aug 2014 12:00:31 -0700 (PDT) Message-ID: <53FE2ACD.10502@cs.ucla.edu> Date: Wed, 27 Aug 2014 12:00:29 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Michael Albinus , Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> In-Reply-To: <87wq9u18fz.fsf@gmx.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 18051 Cc: dmantipov@yandex.ru, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) I found the following issues and installed what I hope are fixes as trunk bzr 117751. First, the code should use wcscoll_t rather than uselocale, as uselocale modifies thread state and this is less robust; for example, it wasn't safe to call 'error' right after the first call to uselocale. Second, if the locale is invalid, string-collate-lessp should throw an error, the same way it throws an error when the strings are invalid. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 15:09:10 2014 Received: (at 18051) by debbugs.gnu.org; 27 Aug 2014 19:09:10 +0000 Received: from localhost ([127.0.0.1]:53865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMiaj-0002JT-EU for submit@debbugs.gnu.org; Wed, 27 Aug 2014 15:09:09 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:38346) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMiah-0002JF-F1 for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 15:09:07 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 99440A60011; Wed, 27 Aug 2014 12:09:01 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hXlELmWmtvHk; Wed, 27 Aug 2014 12:08:53 -0700 (PDT) Received: from [192.168.1.9] (pool-71-177-17-123.lsanca.dsl-w.verizon.net [71.177.17.123]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id E13AB39E8014; Wed, 27 Aug 2014 12:08:52 -0700 (PDT) Message-ID: <53FE2CC4.9060308@cs.ucla.edu> Date: Wed, 27 Aug 2014 12:08:52 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Michael Albinus , Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> In-Reply-To: <53FE2ACD.10502@cs.ucla.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 18051 Cc: dmantipov@yandex.ru, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) A couple more things. First, the current algorithm looks only at LC_COLLATE, but the usual approach is to default LC_COLLATE to LANG if LC_COLLATE isn't set, and to have LC_ALL override LC_COLLATE. Shouldn't Emacs take a similar approach, for compatibility? More generally, it strikes me that string-collate-lessp will be quite slow due to the overhead of looking up the locale environment string and creating and destroying a locale for each string comparison. Instead, shouldn't Emacs should have a locale object that the Emacs Lisp programmer can create, an object that encapsulates the low level locale_t object, and which can be passed as an optional argument to string-collate-lessp? That way, string-collate-p would never have to inspect the environment itself, or to create or destroy a locale. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 15:54:52 2014 Received: (at 18051) by debbugs.gnu.org; 27 Aug 2014 19:54:52 +0000 Received: from localhost ([127.0.0.1]:53883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMjIx-0003QT-83 for submit@debbugs.gnu.org; Wed, 27 Aug 2014 15:54:51 -0400 Received: from mtaout26.012.net.il ([80.179.55.182]:42363) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMjIu-0003QD-92 for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 15:54:49 -0400 Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0NAZ00J00DEMK000@mtaout26.012.net.il> for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 22:52:56 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAZ00IYADW89J20@mtaout26.012.net.il>; Wed, 27 Aug 2014 22:52:56 +0300 (IDT) Date: Wed, 27 Aug 2014 22:54:54 +0300 From: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. In-reply-to: <53FE2CC4.9060308@cs.ucla.edu> X-012-Sender: halo1@inter.net.il To: Paul Eggert Message-id: <834mwxk8s1.fsf@gnu.org> References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> <53FE2CC4.9060308@cs.ucla.edu> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, dmantipov@yandex.ru, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Wed, 27 Aug 2014 12:08:52 -0700 > From: Paul Eggert > CC: dmantipov@yandex.ru, 18051@debbugs.gnu.org > > First, the current algorithm looks only at LC_COLLATE, but the usual > approach is to default LC_COLLATE to LANG if LC_COLLATE isn't set, and > to have LC_ALL override LC_COLLATE. Shouldn't Emacs take a similar > approach, for compatibility? I think we agreed to have a variable that holds the non-default locale as a Lisp string. LANG and LC_COLLATE will then be used internally by newlocale and/or wcscoll_t, as users expect. I don't think it's appropriate for a primitive to take arguments from environment variables, certainly not those on process-environment. If some Lisp application would want to do that, let them. > More generally, it strikes me that string-collate-lessp will be quite > slow due to the overhead of looking up the locale environment string and > creating and destroying a locale for each string comparison. The lookup will no longer be relevant, when we switch to a variable. As for creating and destroying the locale, I guess you are right. > Instead, shouldn't Emacs should have a locale object that the Emacs > Lisp programmer can create, an object that encapsulates the low > level locale_t object, and which can be passed as an optional > argument to string-collate-lessp? That's what Guile does. But it will complicate using these functions in sorting routines. Perhaps binding a variable to the object will do. Alternatively, a simple one-slot cache internal to string_collate will probably remove most of the overhead. (You will see that w32_compare_strings already employs a similar cache.) From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 17:28:08 2014 Received: (at 18051) by debbugs.gnu.org; 27 Aug 2014 21:28:08 +0000 Received: from localhost ([127.0.0.1]:53897 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMklD-0005iq-5x for submit@debbugs.gnu.org; Wed, 27 Aug 2014 17:28:08 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:44945) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMkl9-0005iH-KT for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 17:28:04 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 63B29A6000F; Wed, 27 Aug 2014 14:27:57 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 849AgblPArx6; Wed, 27 Aug 2014 14:27:51 -0700 (PDT) Received: from [192.168.1.9] (pool-71-177-17-123.lsanca.dsl-w.verizon.net [71.177.17.123]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 5D192A60013; Wed, 27 Aug 2014 14:27:51 -0700 (PDT) Message-ID: <53FE4D56.3070504@cs.ucla.edu> Date: Wed, 27 Aug 2014 14:27:50 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> <53FE2CC4.9060308@cs.ucla.edu> <834mwxk8s1.fsf@gnu.org> In-Reply-To: <834mwxk8s1.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, dmantipov@yandex.ru, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Eli Zaretskii wrote: > I think we agreed to have a variable that holds the non-default locale > as a Lisp string. Ah, sorry, missed that (it is a long thread...). Makes sense. I assume this is on someone's TODO list since it's not done that way now. > Perhaps binding a variable to the object will do. We could do both: i.e., give the comparison function an optional argument that defaults to the value of the bound variable. I'd think the value should be a locale object, though, not a string like "en_US". And perhaps the object should also record whether the comparison is case-sensitive, and other stuff like that. > Alternatively, a simple one-slot cache internal to string_collate will > probably remove most of the overhead. It would now, but it would also add another obstacle to adding multithreading capabilities, as the locking around the cache would inhibit scalability. So I'd rather avoid such a cache if it's easy. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 17:38:04 2014 Received: (at 18051) by debbugs.gnu.org; 27 Aug 2014 21:38:04 +0000 Received: from localhost ([127.0.0.1]:53901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMkuq-0005yJ-3C for submit@debbugs.gnu.org; Wed, 27 Aug 2014 17:38:04 -0400 Received: from mout.gmx.net ([212.227.17.21]:57315) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMkuo-0005xo-6I for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 17:38:03 -0400 Received: from detlef.gmx.de ([87.146.47.172]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0MWxtA-1Wqpur06ku-00Vtwc; Wed, 27 Aug 2014 23:37:41 +0200 From: Michael Albinus To: Paul Eggert Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> <53FE2CC4.9060308@cs.ucla.edu> <834mwxk8s1.fsf@gnu.org> <53FE4D56.3070504@cs.ucla.edu> Date: Wed, 27 Aug 2014 23:37:35 +0200 In-Reply-To: <53FE4D56.3070504@cs.ucla.edu> (Paul Eggert's message of "Wed, 27 Aug 2014 14:27:50 -0700") Message-ID: <87zjepsjfk.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:osmGz5Uco6FScPUXu4Qwh20jiG9YLEl5AzTgfPVIgi41A1Nlb8Q 5nJPycJarZd8u5mSejoZebFwEqFMCjVT9LVimM02ilx0VwgJLk4fwz6jsKoSauaoadKOGVZ B2m/aSzul1IL4FrHcpP0e/sxUmiuSMY095U7mOogf/TsWg5tuJA0gAWFTIot4OetpLRbjQj ANkAaI+LFbQTG9ckm4Fww== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: Eli Zaretskii , dmantipov@yandex.ru, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Paul Eggert writes: > Ah, sorry, missed that (it is a long thread...). Makes sense. I > assume this is on someone's TODO list since it's not done that way > now. Eli, that means you or me :-) I do not want to interfere your work, but in case you are busy with other tasks, I could do. Pls let me know. >> Perhaps binding a variable to the object will do. > > We could do both: i.e., give the comparison function an optional > argument that defaults to the value of the bound variable. I'd think > the value should be a locale object, though, not a string like > "en_US". And perhaps the object should also record whether the > comparison is case-sensitive, and other stuff like that. Good idea, that would also make Glenn happy. (That's not a joke, I mean it seriously!) Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 19:57:18 2014 Received: (at 18051) by debbugs.gnu.org; 27 Aug 2014 23:57:18 +0000 Received: from localhost ([127.0.0.1]:53930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMn5a-0000xJ-7T for submit@debbugs.gnu.org; Wed, 27 Aug 2014 19:57:18 -0400 Received: from mail-hampton.hostforweb.net ([205.234.186.191]:42172 helo=hampton.hostforweb.net) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMn5W-0000x0-Ew for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 19:57:16 -0400 Received: from localhost.localdomain ([127.0.0.1]:59346 helo=localhost) by hampton.hostforweb.net with smtp (Exim 4.82) (envelope-from ) id 1XMn5K-0044Vh-DH; Wed, 27 Aug 2014 18:57:07 -0500 Date: Thu, 28 Aug 2014 08:57:19 +0900 Message-ID: From: Katsumi Yamaoka To: Paul Eggert Subject: Re: trunk r117751: Improve robustness of new string-collation code. References: Organization: Emacsen advocacy group X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.130012 (=?iso-2022-jp?B?GyRCPz8bKEI=?= Gnus v0.12) Emacs/24.4.50 (i686-pc-cygwin) Cancel-Lock: sha1:yoRwniHfUquawU+h+Hzv3FmFdsg= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-OutGoing-Spam-Status: No, score=-2.9 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hampton.hostforweb.net X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Get-Message-Sender-Via: hampton.hostforweb.net: acl_c_authenticated_local_user: yamaoka X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Wed, 27 Aug 2014 18:56:52 +0000, Paul Eggert wrote: > ------------------------------------------------------------ > revno: 117751 [...] > message: > Improve robustness of new string-collation code. > * configure.ac (newlocale): Check for this, not for uselocale. > * src/sysdep.c (LC_COLLATE, LC_COLLATE_MASK, freelocale, locale_t) > (newlocale, wcscoll_l): Define substitutes for platforms that > lack them, so as to simplify the mainline code. > (str_collate): Simplify the code by assuming the above definitions. > Use wcscoll_l, not uselocale, as uselocale is too fragile. For > example, the old version left the Emacs in the wrong locale if > wcscoll reported an error. Use 'int', not ptrdiff_t, for the int > result. Report an error if newlocale fails. Emacs build gets stopped on Cygwin probably due to this change. gcc [...options below...] sysdep.c sysdep.c: In function 'str_collate': sysdep.c:3706:33: error: 'LC_COLLATE_MASK' undeclared (first use in this function) locale_t loc = newlocale (LC_COLLATE_MASK, SSDATA (lc_collate), 0); ^ sysdep.c:3706:33: note: each undeclared identifier is reported only once for each function it appears in Makefile:336: recipe for target 'sysdep.o' failed make[1]: *** [sysdep.o] Error 1 Thanks. gcc options: -std=gnu99 -c -Demacs -I. -I. -I../lib -I../lib -D_REENTRANT -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ I/usr/include/cairo --I/usr/include/pango-1.0 I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo I/usr/include/pixman-1 --I/usr/include/freetype2 I/usr/include/libpng15 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng15 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/freetype2 I/usr/include/libpng15 --D_REENTRANT -I/usr/include/librsvg-2.0 I/usr/include/gdk-pixbuf-2.0 --I/usr/include/libpng15 I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 I/usr/include/freetype2 --I/usr/include/libpng15 -fopenmp I/usr/include/ImageMagick --I/usr/include/libpng15 I/usr/include/libxml2 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -D_REENTRANT I/usr/include/glib-2.0 --I/usr/lib/glib-2.0/include D_REENTRANT -I/usr/include/gconf/2 --I/usr/include/dbus-1.0 I/usr/lib/dbus-1.0/include --I/usr/include/glib-2.0 I/usr/lib/glib-2.0/include --I/usr/include/glib-2.0 I/usr/lib/glib-2.0/include --I/usr/include/freetype2 I/usr/include/libpng15 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/freetype2 I/usr/include/libpng15 --MMD -MF deps/sysdep.d -MP I/usr/include/p11-kit-1 -D_REENTRANT --I/usr/include/glib-2.0 I/usr/lib/glib-2.0/include -g3 -O2 From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 20:51:55 2014 Received: (at 18051) by debbugs.gnu.org; 28 Aug 2014 00:51:56 +0000 Received: from localhost ([127.0.0.1]:53934 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMnwQ-0002KG-OJ for submit@debbugs.gnu.org; Wed, 27 Aug 2014 20:51:55 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:52806) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMnwL-0002Jo-Jh for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 20:51:50 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 1866C39E8012; Wed, 27 Aug 2014 17:51:43 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uqBkXTStSnpt; Wed, 27 Aug 2014 17:51:34 -0700 (PDT) Received: from [192.168.1.9] (pool-71-177-17-123.lsanca.dsl-w.verizon.net [71.177.17.123]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 97C5439E8014; Wed, 27 Aug 2014 17:51:34 -0700 (PDT) Message-ID: <53FE7D16.5060803@cs.ucla.edu> Date: Wed, 27 Aug 2014 17:51:34 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Katsumi Yamaoka Subject: Re: trunk r117751: Improve robustness of new string-collation code. References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Katsumi Yamaoka wrote: > sysdep.c:3706:33: error: 'LC_COLLATE_MASK' undeclared Thanks, I installed a fix in trunk bzr 117753. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 22:39:03 2014 Received: (at 18051) by debbugs.gnu.org; 28 Aug 2014 02:39:03 +0000 Received: from localhost ([127.0.0.1]:53950 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMpc5-0004zc-Tn for submit@debbugs.gnu.org; Wed, 27 Aug 2014 22:39:02 -0400 Received: from mtaout29.012.net.il ([80.179.55.185]:43933) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMpbz-0004z0-Go for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 22:38:57 -0400 Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NAZ00I00WA1YG00@mtaout29.012.net.il> for 18051@debbugs.gnu.org; Thu, 28 Aug 2014 05:38:40 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAZ00EIJWOG0C50@mtaout29.012.net.il>; Thu, 28 Aug 2014 05:38:40 +0300 (IDT) Date: Thu, 28 Aug 2014 05:39:02 +0300 From: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. In-reply-to: <87zjepsjfk.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus Message-id: <8338chjq2h.fsf@gnu.org> References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> <53FE2CC4.9060308@cs.ucla.edu> <834mwxk8s1.fsf@gnu.org> <53FE4D56.3070504@cs.ucla.edu> <87zjepsjfk.fsf@gmx.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, eggert@cs.ucla.edu, dmantipov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Cc: Eli Zaretskii , dmantipov@yandex.ru, 18051@debbugs.gnu.org > Date: Wed, 27 Aug 2014 23:37:35 +0200 > > Paul Eggert writes: > > > Ah, sorry, missed that (it is a long thread...). Makes sense. I > > assume this is on someone's TODO list since it's not done that way > > now. > > Eli, that means you or me :-) > > I do not want to interfere your work, but in case you are busy with > other tasks, I could do. Pls let me know. Feel free, and thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 23:09:40 2014 Received: (at 18051) by debbugs.gnu.org; 28 Aug 2014 03:09:40 +0000 Received: from localhost ([127.0.0.1]:53956 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMq5k-0005mD-5T for submit@debbugs.gnu.org; Wed, 27 Aug 2014 23:09:40 -0400 Received: from mail-hampton.hostforweb.net ([205.234.186.191]:40911 helo=hampton.hostforweb.net) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMq5h-0005lv-3B for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 23:09:38 -0400 Received: from localhost.localdomain ([127.0.0.1]:46217 helo=localhost) by hampton.hostforweb.net with smtp (Exim 4.82) (envelope-from ) id 1XMq5Z-002Ma7-G2; Wed, 27 Aug 2014 22:09:30 -0500 Date: Thu, 28 Aug 2014 12:09:48 +0900 Message-ID: From: Katsumi Yamaoka To: Paul Eggert Subject: Re: trunk r117751: Improve robustness of new string-collation code. References: <53FE7D16.5060803@cs.ucla.edu> Organization: Emacsen advocacy group X-Face: #kKnN,xUnmKia.'[pp`; Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu; B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.130012 (=?iso-2022-jp?B?GyRCPz8bKEI=?= Gnus v0.12) Emacs/24.4.50 (i686-pc-cygwin) Cancel-Lock: sha1:GUngIpp6bok1Q1hdsM2HQQYBKR4= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-OutGoing-Spam-Status: No, score=-2.9 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - hampton.hostforweb.net X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Get-Message-Sender-Via: hampton.hostforweb.net: acl_c_authenticated_local_user: yamaoka X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Wed, 27 Aug 2014 17:51:34 -0700, Paul Eggert wrote: > Katsumi Yamaoka wrote: >> sysdep.c:3706:33: error: 'LC_COLLATE_MASK' undeclared > Thanks, I installed a fix in trunk bzr 117753. Now the new build is running. Thank you! From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 27 23:24:03 2014 Received: (at 18051) by debbugs.gnu.org; 28 Aug 2014 03:24:03 +0000 Received: from localhost ([127.0.0.1]:53964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMqJf-00068k-5b for submit@debbugs.gnu.org; Wed, 27 Aug 2014 23:24:03 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:48778) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XMqJc-00068J-FC for 18051@debbugs.gnu.org; Wed, 27 Aug 2014 23:24:01 -0400 Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s7S3NwPB032402; Wed, 27 Aug 2014 23:23:59 -0400 Received: by ceviche.home (Postfix, from userid 20848) id ABF72660C4; Wed, 27 Aug 2014 23:23:58 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#18051: 24.3.92; ls-lisp: Sorting; make ls-lisp-string-lessp a normal function? Message-ID: References: <87ha2f5gp8.fsf@web.de> <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> <87ha147gd5.fsf@gmx.de> <83a96vmv80.fsf@gnu.org> <87a96vuph7.fsf@gmx.de> <8361hjm7pr.fsf@gnu.org> <8738cnuev3.fsf@gmx.de> <83zjeukkf9.fsf@gnu.org> <878uma2u7y.fsf@gmx.de> <4yzjeqq6gb.fsf@fencepost.gnu.org> <83egw1kh6i.fsf@gnu.org> Date: Wed, 27 Aug 2014 23:23:58 -0400 In-Reply-To: <83egw1kh6i.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 27 Aug 2014 19:53:25 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5046=0 X-NAI-Spam-Version: 2.3.0.9378 : core <5046> : inlines <1219> : streams <1275662> : uri <1807501> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 18051 Cc: michael_heerdegen@web.de, Glenn Morris , 18051@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) >> Normally one controls functions through their arguments, not the >> environment. > We also have the other variety, e.g. see coding-system-for-read. Yes, we have a lot of that, but that's only used when adding an optional argument was not really practical, in which case dynamic scoping comes to the rescue (but with several caveats). In the present case I don't see why we can't use an optional argument, so an optional arg would be preferable. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 29 05:00:11 2014 Received: (at 18051) by debbugs.gnu.org; 29 Aug 2014 09:00:12 +0000 Received: from localhost ([127.0.0.1]:53118 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNI2U-0001VL-LS for submit@debbugs.gnu.org; Fri, 29 Aug 2014 05:00:11 -0400 Received: from mout.gmx.net ([212.227.17.22]:58665) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNI2S-0001Tq-89 for 18051@debbugs.gnu.org; Fri, 29 Aug 2014 05:00:09 -0400 Received: from [188.22.46.255] ([188.22.46.255]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0McPvw-1Xeoux10DY-00HeAU; Fri, 29 Aug 2014 10:59:47 +0200 Message-ID: <540040F9.1000806@gmx.at> Date: Fri, 29 Aug 2014 10:59:37 +0200 From: martin rudalics MIME-Version: 1.0 To: Michael Albinus , Paul Eggert Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> <53FE2CC4.9060308@cs.ucla.edu> <834mwxk8s1.fsf@gnu.org> <53FE4D56.3070504@cs.ucla.edu> <87zjepsjfk.fsf@gmx.de> In-Reply-To: <87zjepsjfk.fsf@gmx.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:SrwrhUvo1aIH/7+8IDxvz/hisN0clsiw24B1B+/7Bjz9NnuXxRY Qkix5oLjwZovT2B6Hjzh1151ObclvUdk2GOyE6n8FgpFZZixjqbuqODGQfvHtoKVV1kRy7m Ql1e1VKlRiV+C9M40fJ660hYwqj4PHd0j79214j6fglyL5/EWUvvEJuIOb58oMjAf1pHP66 YEeYy+k0wZ2hTMp0534Gw== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: dmantipov@yandex.ru, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > Good idea, that would also make Glenn happy. (That's not a joke, I mean > it seriously!) It would make me happy as well. I have not yet started to convert my fairly insane sorting functions to the new ones because mine are generally based on case-insensitiveness. Also I'm not yet sure how the new predicates will relate to functions like `compare-strings' (which IIUC is needed until now to make sorting case-insensitive), `sort-lines', `sort-subr' and the like. I'd hope that all of these could profit from the new functions. In any case, many thanks to you and Eli for the work. martin From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 29 05:59:16 2014 Received: (at 18051) by debbugs.gnu.org; 29 Aug 2014 09:59:16 +0000 Received: from localhost ([127.0.0.1]:53139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNIxg-0002wx-3W for submit@debbugs.gnu.org; Fri, 29 Aug 2014 05:59:16 -0400 Received: from mout.gmx.net ([212.227.17.20]:54009) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNIxd-0002wh-ML for 18051@debbugs.gnu.org; Fri, 29 Aug 2014 05:59:14 -0400 Received: from detlef.gmx.de ([93.209.87.79]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MMkgl-1XVpg62Gj9-008dXM; Fri, 29 Aug 2014 11:59:05 +0200 From: Michael Albinus To: martin rudalics Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> <53FE2CC4.9060308@cs.ucla.edu> <834mwxk8s1.fsf@gnu.org> <53FE4D56.3070504@cs.ucla.edu> <87zjepsjfk.fsf@gmx.de> <540040F9.1000806@gmx.at> Date: Fri, 29 Aug 2014 11:59:00 +0200 In-Reply-To: <540040F9.1000806@gmx.at> (martin rudalics's message of "Fri, 29 Aug 2014 10:59:37 +0200") Message-ID: <87zjenr50b.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:Fw3DgZWkKpZHk2bY4DFcia3RxszBAt/gxJtH3y3ooW9/cFRiTY9 kcWIREPrmU9et4OtmAfCA973PJsTr4ZTatJR1R1Ygul7O7hOsKMgmXWNOw8VKe6MksLdnZb reC0Jx8EnT2fetKw/3udnKezL3o+llZcN/NCMXS1Wfl431t2Q+8V9QH3xUTbkBr4Rn4EC+C Q5Fm2jNhvqKOpz4F8xsKA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, Paul Eggert , dmantipov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) martin rudalics writes: > I have not yet started to convert my > fairly insane sorting functions to the new ones because mine are > generally based on case-insensitiveness. I'm just working on this. `string-collate-lessp' will have the signature (string-collate-lessp S1 S2 &optional LOCALE IGNORE-CASE) > Also I'm not yet sure how the > new predicates will relate to functions like `compare-strings' (which > IIUC is needed until now to make sorting case-insensitive), Likely, there shall also be `collate-strings'. > `sort-lines', `sort-subr' and the like. I'd hope that all of these > could profit from the new functions. `sort-subr' has PREDICATE as argument, you could take `string-collate-lessp'. Maybe with some adaptions in `sort-subr', in order to use also LOCALE and IGNORE-CASE. `sort-lines' uses `sort-subr', without PREDIACATE. Might be also extended. > martin Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 29 06:06:23 2014 Received: (at 18051) by debbugs.gnu.org; 29 Aug 2014 10:06:24 +0000 Received: from localhost ([127.0.0.1]:53143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNJ4Z-000395-BH for submit@debbugs.gnu.org; Fri, 29 Aug 2014 06:06:23 -0400 Received: from mtaout28.012.net.il ([80.179.55.184]:59851) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNJ4W-00038o-7z for 18051@debbugs.gnu.org; Fri, 29 Aug 2014 06:06:21 -0400 Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0NB200000BRWSM00@mtaout28.012.net.il> for 18051@debbugs.gnu.org; Fri, 29 Aug 2014 13:05:10 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NB2001JHC0MA600@mtaout28.012.net.il>; Fri, 29 Aug 2014 13:05:10 +0300 (IDT) Date: Fri, 29 Aug 2014 13:06:13 +0300 From: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. In-reply-to: <540040F9.1000806@gmx.at> X-012-Sender: halo1@inter.net.il To: martin rudalics Message-id: <83ha0vip9m.fsf@gnu.org> References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> <53FE2CC4.9060308@cs.ucla.edu> <834mwxk8s1.fsf@gnu.org> <53FE4D56.3070504@cs.ucla.edu> <87zjepsjfk.fsf@gmx.de> <540040F9.1000806@gmx.at> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, eggert@cs.ucla.edu, michael.albinus@gmx.de, dmantipov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Fri, 29 Aug 2014 10:59:37 +0200 > From: martin rudalics > Cc: dmantipov@yandex.ru, 18051@debbugs.gnu.org > > > Good idea, that would also make Glenn happy. (That's not a joke, I mean > > it seriously!) > > It would make me happy as well. I have not yet started to convert my > fairly insane sorting functions to the new ones because mine are > generally based on case-insensitiveness. Also I'm not yet sure how the > new predicates will relate to functions like `compare-strings' (which > IIUC is needed until now to make sorting case-insensitive), > `sort-lines', `sort-subr' and the like. I'd hope that all of these > could profit from the new functions. Case-insensitive versions of the new functions are yet to be written; stay tuned. For now, on MS-Windows, you can have that if you use the NORM_IGNORECASE flag as the second argument of CompareStringW inside w32_compare_strings. For Posix, I guess we should run the 2 strings through towupper (or towupper_l, if it exists), and then compare the results with wcscoll/wcscoll_l. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 29 13:22:17 2014 Received: (at 18051) by debbugs.gnu.org; 29 Aug 2014 17:22:17 +0000 Received: from localhost ([127.0.0.1]:53720 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNPsO-0008Cc-HF for submit@debbugs.gnu.org; Fri, 29 Aug 2014 13:22:16 -0400 Received: from mout.gmx.net ([212.227.15.15]:55045) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNPsL-0008CM-Qj for 18051@debbugs.gnu.org; Fri, 29 Aug 2014 13:22:14 -0400 Received: from [178.191.141.82] ([178.191.141.82]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MO77c-1XStVz17nY-005VWy; Fri, 29 Aug 2014 19:22:07 +0200 Message-ID: <5400B6B5.5020607@gmx.at> Date: Fri, 29 Aug 2014 19:21:57 +0200 From: martin rudalics MIME-Version: 1.0 To: Michael Albinus Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> <53FE2CC4.9060308@cs.ucla.edu> <834mwxk8s1.fsf@gnu.org> <53FE4D56.3070504@cs.ucla.edu> <87zjepsjfk.fsf@gmx.de> <540040F9.1000806@gmx.at> <87zjenr50b.fsf@gmx.de> In-Reply-To: <87zjenr50b.fsf@gmx.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:02k4mI74FCanJPDN+zVgbBdQ0t7oPT+Lud5V3ohX6vXl0TkgfBo PnweKcacWCiGV7XRFif/kcnXFeSMBKAChsHWbm5t5JQmLyAlxZpNqk/vvRZuCPF1xS767YV O0B5EBz9c8EaY/b+F+LY18qjMHDfAoQQ7t2htonCn4N5OFfejPYiHznrPg7dxVokDWjhCv2 08TW96Nxu9aNLEBdsuWSg== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, Paul Eggert , dmantipov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > I'm just working on this. `string-collate-lessp' will have the signature > > (string-collate-lessp S1 S2 &optional LOCALE IGNORE-CASE) Fine. One additional question: Couldn't we also try to fix searching http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13041 with the new functions? martin From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 29 13:56:21 2014 Received: (at 18051) by debbugs.gnu.org; 29 Aug 2014 17:56:21 +0000 Received: from localhost ([127.0.0.1]:53725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNQPM-0000aX-GC for submit@debbugs.gnu.org; Fri, 29 Aug 2014 13:56:21 -0400 Received: from mout.gmx.net ([212.227.17.21]:60984) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNQPE-0000aE-Ay for 18051@debbugs.gnu.org; Fri, 29 Aug 2014 13:56:18 -0400 Received: from detlef.gmx.de ([93.209.87.79]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0M2L60-1YFFRZ3IEm-00s5UN; Fri, 29 Aug 2014 19:56:05 +0200 From: Michael Albinus To: martin rudalics Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> <53FE2CC4.9060308@cs.ucla.edu> <834mwxk8s1.fsf@gnu.org> <53FE4D56.3070504@cs.ucla.edu> <87zjepsjfk.fsf@gmx.de> <540040F9.1000806@gmx.at> <87zjenr50b.fsf@gmx.de> <5400B6B5.5020607@gmx.at> Date: Fri, 29 Aug 2014 19:56:00 +0200 In-Reply-To: <5400B6B5.5020607@gmx.at> (martin rudalics's message of "Fri, 29 Aug 2014 19:21:57 +0200") Message-ID: <87r3zzqixb.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:SqSnK30pN6kIufVhhJ+lAOFjSIbfDeUJcVEpkjiedtudT4cFpCh /n0RJVN6SWINjJeZp0ldeO/7QMjEdm0PxwiwQdN9lyc/ps0XXkJ3u2ue1zJPvlEbeNVOVjV gwNW51Nl/skny/069Chjvz35pSkXp+saDsUO/xXm1ycfAX3FQXlMMGvZ7tU6YAjHdaceQp7 zUb2/Fb75pUkbpJjLncPQ== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, Paul Eggert , dmantipov@yandex.ru X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) martin rudalics writes: > Fine. One additional question: Couldn't we also try to fix searching > > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=13041 > > with the new functions? Don't know (yet). Pushed on my TODO. > martin Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 29 14:02:20 2014 Received: (at 18051) by debbugs.gnu.org; 29 Aug 2014 18:02:20 +0000 Received: from localhost ([127.0.0.1]:53729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNQV9-0000kZ-Vx for submit@debbugs.gnu.org; Fri, 29 Aug 2014 14:02:20 -0400 Received: from mout.gmx.net ([212.227.15.19]:53716) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNQV7-0000kM-Az for 18051@debbugs.gnu.org; Fri, 29 Aug 2014 14:02:18 -0400 Received: from detlef.gmx.de ([93.209.87.79]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MWk3f-1XvFCZ085b-00Xt8f; Fri, 29 Aug 2014 20:01:56 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> <53FE2CC4.9060308@cs.ucla.edu> <834mwxk8s1.fsf@gnu.org> <53FE4D56.3070504@cs.ucla.edu> <87zjepsjfk.fsf@gmx.de> <540040F9.1000806@gmx.at> <83ha0vip9m.fsf@gnu.org> Date: Fri, 29 Aug 2014 20:01:50 +0200 In-Reply-To: <83ha0vip9m.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 29 Aug 2014 13:06:13 +0300") Message-ID: <87mwanqinl.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:U7+4DKwW/I9334qyBpdo6ePZE714+3xk1c2JT/1KS19tqZgkGcn fcunhzCoiNoU/6Dpa6qQVrmBWx+ye0VaD/3ph9NvCy5Up8s+UGUBZ4watCwTC1IZu95ZCuN q9JkDMWPRE2HsIg5r1eG5+Bs/K5/OxubBNEErTgqfHAHd+6YzdzbcbiS6KSiysWzH+ey0kW OQhun9H6Gm4ocZINpvWjw== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: martin rudalics , eggert@cs.ucla.edu, dmantipov@yandex.ru, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > Case-insensitive versions of the new functions are yet to be written; > stay tuned. I've just committed a patch to the trunk which adds optional arguments LOCALE and IGNORE-CASE to the collation functions. > For now, on MS-Windows, you can have that if you use the > NORM_IGNORECASE flag as the second argument of CompareStringW inside > w32_compare_strings. As usual, this I haven't implemented. I would let it to you, Eli. > For Posix, I guess we should run the 2 strings through towupper (or > towupper_l, if it exists), and then compare the results with > wcscoll/wcscoll_l. Yes. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 29 15:32:00 2014 Received: (at 18051) by debbugs.gnu.org; 29 Aug 2014 19:32:00 +0000 Received: from localhost ([127.0.0.1]:53778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNRtv-0005QV-Jh for submit@debbugs.gnu.org; Fri, 29 Aug 2014 15:32:00 -0400 Received: from mtaout25.012.net.il ([80.179.55.181]:36233) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNRtr-0005QB-Ch for 18051@debbugs.gnu.org; Fri, 29 Aug 2014 15:31:57 -0400 Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NB300I001EZU100@mtaout25.012.net.il> for 18051@debbugs.gnu.org; Fri, 29 Aug 2014 22:26:29 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NB300GE42053E40@mtaout25.012.net.il>; Fri, 29 Aug 2014 22:26:29 +0300 (IDT) Date: Fri, 29 Aug 2014 22:31:49 +0300 From: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. In-reply-to: <87mwanqinl.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus Message-id: <838um7hz2y.fsf@gnu.org> References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> <53FE2CC4.9060308@cs.ucla.edu> <834mwxk8s1.fsf@gnu.org> <53FE4D56.3070504@cs.ucla.edu> <87zjepsjfk.fsf@gmx.de> <540040F9.1000806@gmx.at> <83ha0vip9m.fsf@gnu.org> <87mwanqinl.fsf@gmx.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: rudalics@gmx.at, eggert@cs.ucla.edu, dmantipov@yandex.ru, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Albinus > Cc: martin rudalics , eggert@cs.ucla.edu, dmantipov@yandex.ru, 18051@debbugs.gnu.org > Date: Fri, 29 Aug 2014 20:01:50 +0200 > > Eli Zaretskii writes: > > > Case-insensitive versions of the new functions are yet to be written; > > stay tuned. > > I've just committed a patch to the trunk which adds optional arguments > LOCALE and IGNORE-CASE to the collation functions. Thanks. > > For now, on MS-Windows, you can have that if you use the > > NORM_IGNORECASE flag as the second argument of CompareStringW inside > > w32_compare_strings. > > As usual, this I haven't implemented. I would let it to you, Eli. As usual, done. I needed to introduce a w32-specific variable, which needs to be bound to a non-nil value in order to have UTS#10 (a.k.a. "Unicode Collation Algorithm", or "UCA") compliant collation order, which ignores punctuation differences, on MS-Windows. This is because Windows doesn't support UTF-8 as a codeset in its locales (and Windows locales have different names anyway). This means that if a Lisp program needs to make sure it gets a UCA-compliant collation order on all platforms, it will have to pass a "xx_YY.UTF-8" locale on Posix platforms, and on Windows bind that w32-specific variable to a non-nil value. Btw, I think we will need a lot of verbiage in the ELisp manual to make sure people understand what to expect from these functions. In particular, the results are extremely locale- and platform-specific, so one cannot expect exactly the same results in all cases, only something similar. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 29 17:01:32 2014 Received: (at 18051) by debbugs.gnu.org; 29 Aug 2014 21:01:32 +0000 Received: from localhost ([127.0.0.1]:53825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNTIZ-0007lM-MQ for submit@debbugs.gnu.org; Fri, 29 Aug 2014 17:01:31 -0400 Received: from mout.gmx.net ([212.227.17.21]:62940) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XNTIW-0007l7-S7 for 18051@debbugs.gnu.org; Fri, 29 Aug 2014 17:01:29 -0400 Received: from detlef.gmx.de ([93.209.87.79]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LdHLB-1Y5ZcW3KxV-00iV38; Fri, 29 Aug 2014 23:01:14 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> <53FE2CC4.9060308@cs.ucla.edu> <834mwxk8s1.fsf@gnu.org> <53FE4D56.3070504@cs.ucla.edu> <87zjepsjfk.fsf@gmx.de> <540040F9.1000806@gmx.at> <83ha0vip9m.fsf@gnu.org> <87mwanqinl.fsf@gmx.de> <838um7hz2y.fsf@gnu.org> Date: Fri, 29 Aug 2014 23:01:05 +0200 In-Reply-To: <838um7hz2y.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 29 Aug 2014 22:31:49 +0300") Message-ID: <87iolbqacu.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:oIKnaT/s0wu/moH305T2nxsdJiPFdIAGDyVAPCI4S4+vf8wGNRC Fb/jH6WISp2GGLeRmpsuXzCI7Jutmt/TMBlLaCLM0fCTX7k8s5sA1RXSgpn0GR+JoMozhc2 /K//ORbK0Z1JR7LqLEH9wveNpex4kM5n6tYltL98mmBwKQhJy1co5cjNuhs8wncWfUqkFu/ dQa14ETiw78uRz5X872RA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: rudalics@gmx.at, eggert@cs.ucla.edu, dmantipov@yandex.ru, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > Btw, I think we will need a lot of verbiage in the ELisp manual to > make sure people understand what to expect from these functions. In > particular, the results are extremely locale- and platform-specific, > so one cannot expect exactly the same results in all cases, only > something similar. Oh yes. I will start on this next days (as usual, I'm short in time) as well as adding test cases to fns-tests.el. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 01 11:21:02 2014 Received: (at 18051) by debbugs.gnu.org; 1 Sep 2014 15:21:02 +0000 Received: from localhost ([127.0.0.1]:55827 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOTPh-0004VK-IR for submit@debbugs.gnu.org; Mon, 01 Sep 2014 11:21:02 -0400 Received: from mtaout26.012.net.il ([80.179.55.182]:52070) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOTPe-0004Up-G5 for 18051@debbugs.gnu.org; Mon, 01 Sep 2014 11:20:59 -0400 Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0NB800500AI15100@mtaout26.012.net.il> for 18051@debbugs.gnu.org; Mon, 01 Sep 2014 18:18:58 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NB8001XTAJMM430@mtaout26.012.net.il>; Mon, 01 Sep 2014 18:18:58 +0300 (IDT) Date: Mon, 01 Sep 2014 18:20:58 +0300 From: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. In-reply-to: <87iolbqacu.fsf@gmx.de> X-012-Sender: halo1@inter.net.il To: Michael Albinus , michael_heerdegen@web.de Message-id: <83wq9nfjtx.fsf@gnu.org> References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> <53FE2CC4.9060308@cs.ucla.edu> <834mwxk8s1.fsf@gnu.org> <53FE4D56.3070504@cs.ucla.edu> <87zjepsjfk.fsf@gmx.de> <540040F9.1000806@gmx.at> <83ha0vip9m.fsf@gnu.org> <87mwanqinl.fsf@gmx.de> <838um7hz2y.fsf@gnu.org> <87iolbqacu.fsf@gmx.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051 Cc: rudalics@gmx.at, 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) In trunk revision 117797, ls-lisp acquired the ability to sort file names using the new string-collate-lessp function, thus producing results that should be similar, if not identical, to what GNU ls does, at least on GNU/Linux in the same locale. (On MS-Windows, the behavior will be similar; it cannot be identical because Windows doesn't implement UTS#10 (a.k.a. "UCA", the Unicode Collation Algorithm) to the letter in its locale-dependent collation routines.) Trunk revision 117798 implements the GNU ls -v switch in ls-lisp. Michael (Heerdegen), as you were the one who requested these features, please give them some testing and see if you like them. Many thanks to Michael Albinus for all the hard work on the infrastructure that made this possible. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 01 16:46:57 2014 Received: (at 18051) by debbugs.gnu.org; 1 Sep 2014 20:46:57 +0000 Received: from localhost ([127.0.0.1]:55930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOYV6-0005a7-ES for submit@debbugs.gnu.org; Mon, 01 Sep 2014 16:46:56 -0400 Received: from mout.web.de ([212.227.17.11]:52323) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOYV2-0005Zn-IP for 18051@debbugs.gnu.org; Mon, 01 Sep 2014 16:46:53 -0400 Received: from drachen.dragon ([90.186.111.105]) by smtp.web.de (mrweb102) with ESMTPSA (Nemesis) id 0MKa2F-1XOHVx1lt1-001xwQ; Mon, 01 Sep 2014 22:46:46 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> <53FE2CC4.9060308@cs.ucla.edu> <834mwxk8s1.fsf@gnu.org> <53FE4D56.3070504@cs.ucla.edu> <87zjepsjfk.fsf@gmx.de> <540040F9.1000806@gmx.at> <83ha0vip9m.fsf@gnu.org> <87mwanqinl.fsf@gmx.de> <838um7hz2y.fsf@gnu.org> <87iolbqacu.fsf@gmx.de> <83wq9nfjtx.fsf@gnu.org> Date: Mon, 01 Sep 2014 22:46:42 +0200 In-Reply-To: <83wq9nfjtx.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 01 Sep 2014 18:20:58 +0300") Message-ID: <8761h7t6fh.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:tnfVLjpCcJzPPbGnR8/vywxHzsb2SHa1HL5MTnBBIVQ0IybNowp wPG/fPI1tSLSZVwOwswRpqs4WUdOj+psUbd5kSk7mZRZN1D5+Vyuv9NSh6RK+DE18br5Pmw 6HXjWo3L8Zn1AmYkr5usUkY0fzY4sN3A8Mpo3pHS8N14dyzPJ1O1Rdttj6aqFPo+laooFhF p++SlGNtFRZVLYT6eRxjA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: 18051 Cc: 18051@debbugs.gnu.org, Michael Albinus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: > Michael (Heerdegen), as you were the one who requested these features, > please give them some testing and see if you like them. I'll try and test ASAP. > Many thanks to Michael Albinus for all the hard work on the > infrastructure that made this possible. I have to thank both of you! Presumably it was not easy. Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Oct 17 16:26:44 2014 Received: (at 18051) by debbugs.gnu.org; 17 Oct 2014 20:26:44 +0000 Received: from localhost ([127.0.0.1]:47695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XfE6l-0002Uw-9S for submit@debbugs.gnu.org; Fri, 17 Oct 2014 16:26:43 -0400 Received: from mout.web.de ([212.227.15.14]:55811) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XfE6i-0002Uk-NW for 18051@debbugs.gnu.org; Fri, 17 Oct 2014 16:26:41 -0400 Received: from drachen.dragon ([90.186.169.32]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0MKNl8-1XgsX52XVG-001lxT; Fri, 17 Oct 2014 22:26:38 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> <53FE2CC4.9060308@cs.ucla.edu> <834mwxk8s1.fsf@gnu.org> <53FE4D56.3070504@cs.ucla.edu> <87zjepsjfk.fsf@gmx.de> <540040F9.1000806@gmx.at> <83ha0vip9m.fsf@gnu.org> <87mwanqinl.fsf@gmx.de> <838um7hz2y.fsf@gnu.org> <87iolbqacu.fsf@gmx.de> <83wq9nfjtx.fsf@gnu.org> <8761h7t6fh.fsf@web.de> Date: Fri, 17 Oct 2014 22:26:32 +0200 In-Reply-To: <8761h7t6fh.fsf@web.de> (Michael Heerdegen's message of "Mon, 01 Sep 2014 22:46:42 +0200") Message-ID: <87tx32a1dz.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:Dyv3tR7rQ3l9tmJ7Wzt+IQOXJfPRSXbD4uKFV+DsiM5boqNeWCT qdAK67RefhRzt/NDV1njrRQ5kURelKNb/h2CeGoHnKnW9i76NTV7OCEGEthG8CeJmpj9s4N HBnz632O4cAlid/HzTMMPhDoxVkVcxQGL4lNEG5TngqAUbvgxaGdeDvTFUe30uG4dc8JJLN QrfhwWdSEXIqULEsd4uZQ== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051 Cc: Michael Albinus , 18051@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: michael_heerdegen@web.de List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Hi Eli and Michael, > > Michael (Heerdegen), as you were the one who requested these features, > > please give them some testing and see if you like them. > > I'll try and test ASAP. I used that stuff for a while now, and I think everything worked as expected. If I remember correctly, I saw just one tiny inconsistency: with the new ls-lisp -v switch the sorting position of a backup file named foo~ was different from ls -v when also numbered backup files foo~n~ of the same file existed. Dunno if this is relevant, it's a corner case. For string collation and locales, I must say that I'm no expert at that field and don't really know what tests could be useful for testing. I can only say that everything seems to be ok with the locales I am using. Let me know when you think that I could nonetheless be of any help there. Thanks both of you again for your work, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 18 01:38:52 2014 Received: (at 18051-done) by debbugs.gnu.org; 18 Oct 2014 05:38:52 +0000 Received: from localhost ([127.0.0.1]:47827 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XfMj5-00082n-GP for submit@debbugs.gnu.org; Sat, 18 Oct 2014 01:38:51 -0400 Received: from mtaout21.012.net.il ([80.179.55.169]:62717) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XfMj2-00082b-Pt for 18051-done@debbugs.gnu.org; Sat, 18 Oct 2014 01:38:50 -0400 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0NDM00K00KU65P00@a-mtaout21.012.net.il> for 18051-done@debbugs.gnu.org; Sat, 18 Oct 2014 08:38:47 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NDM00KIUL0M3G40@a-mtaout21.012.net.il>; Sat, 18 Oct 2014 08:38:47 +0300 (IDT) Date: Sat, 18 Oct 2014 08:38:31 +0300 From: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. In-reply-to: <87tx32a1dz.fsf@web.de> X-012-Sender: halo1@inter.net.il To: michael_heerdegen@web.de Message-id: <83zjcudjjc.fsf@gnu.org> References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> <53FE2CC4.9060308@cs.ucla.edu> <834mwxk8s1.fsf@gnu.org> <53FE4D56.3070504@cs.ucla.edu> <87zjepsjfk.fsf@gmx.de> <540040F9.1000806@gmx.at> <83ha0vip9m.fsf@gnu.org> <87mwanqinl.fsf@gmx.de> <838um7hz2y.fsf@gnu.org> <87iolbqacu.fsf@gmx.de> <83wq9nfjtx.fsf@gnu.org> <8761h7t6fh.fsf@web.de> <87tx32a1dz.fsf@web.de> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18051-done Cc: michael.albinus@gmx.de, 18051-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Heerdegen > Cc: 18051@debbugs.gnu.org, Michael Albinus > Date: Fri, 17 Oct 2014 22:26:32 +0200 > > If I remember correctly, I saw just one tiny inconsistency: with the new > ls-lisp -v switch the sorting position of a backup file named foo~ was > different from ls -v when also numbered backup files foo~n~ of the same > file existed. Is that on Windows or on Unix? On Windows, this is expected, as only an approximation to the Unicode Collation Algorithm is available there. On GNU/Linux, it would be strange, since 'ls' uses the same functions as Emacs now does in ls-lisp. > For string collation and locales, I must say that I'm no expert at that > field and don't really know what tests could be useful for testing. I > can only say that everything seems to be ok with the locales I am using. That's good enough for me, so I'm closing the bug. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 18 10:27:54 2014 Received: (at 18051-done) by debbugs.gnu.org; 18 Oct 2014 14:27:54 +0000 Received: from localhost ([127.0.0.1]:48573 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XfUz3-0006SX-VI for submit@debbugs.gnu.org; Sat, 18 Oct 2014 10:27:54 -0400 Received: from mout.web.de ([212.227.15.3]:52184) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XfUz1-0006SP-QL for 18051-done@debbugs.gnu.org; Sat, 18 Oct 2014 10:27:52 -0400 Received: from drachen.dragon ([90.187.245.94]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0LlWFD-1YFfLW1z6d-00bGsn; Sat, 18 Oct 2014 16:27:49 +0200 From: Michael Heerdegen To: Eli Zaretskii Subject: Re: bug#18051: [Emacs-diffs] trunk r117726: Add string collation. References: <53FAB5F9.9050706@yandex.ru> <53FACE18.2060801@cs.ucla.edu> <53FAD584.7070708@yandex.ru> <87r405t6kg.fsf@gmx.de> <83mwasligr.fsf@gnu.org> <87wq9u18fz.fsf@gmx.de> <53FE2ACD.10502@cs.ucla.edu> <53FE2CC4.9060308@cs.ucla.edu> <834mwxk8s1.fsf@gnu.org> <53FE4D56.3070504@cs.ucla.edu> <87zjepsjfk.fsf@gmx.de> <540040F9.1000806@gmx.at> <83ha0vip9m.fsf@gnu.org> <87mwanqinl.fsf@gmx.de> <838um7hz2y.fsf@gnu.org> <87iolbqacu.fsf@gmx.de> <83wq9nfjtx.fsf@gnu.org> <8761h7t6fh.fsf@web.de> <87tx32a1dz.fsf@web.de> <83zjcudjjc.fsf@gnu.org> Date: Sat, 18 Oct 2014 16:27:45 +0200 In-Reply-To: <83zjcudjjc.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 18 Oct 2014 08:38:31 +0300") Message-ID: <87wq7xsba6.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:3mb1lQbiqNE7DkXdaKbc0vttuWPl4Z9EySPfP/SSnZ0ujUsyIHy IoobLy2UxOpe84YeLBehzeVD/Hl/FD6xufp8+SgkR1yiMB9fMDAXhz3P1epxg812AphbXy0 tlMizDFoCw3ikB7drq58Ket0uXwDKbplAXgVdcdKw2S7OI2UwZMvMT4fosblpq/Bmsvy6uV HcDMrlWjrjPZYikbV+PfQ== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18051-done Cc: michael.albinus@gmx.de, 18051-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > > with the new ls-lisp -v switch the sorting position of a backup file > > named foo~ was different from ls -v when also numbered backup files > > foo~n~ of the same file existed. > On GNU/Linux, it would be strange, since 'ls' uses the same functions > as Emacs now does in ls-lisp. Gnu/Linux. But I can't reproduce this anymore, it works as expected, probably I was mistaken. Thanks, Michael. From unknown Wed Jun 25 10:47:28 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 16 Nov 2014 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator