From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#55787: 29.0.50; inconsistent sort order with ls-lisp-version-lessp Date: Sat, 04 Jun 2022 10:44:04 +0300 Message-ID: <83h750c1q3.fsf@gnu.org> References: <87tu91fi43.fsf@yfb02119.nifty.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23462"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 55787@debbugs.gnu.org To: TAKAHASHI Yoshio Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 04 09:45:58 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nxOTt-00060W-Dg for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Jun 2022 09:45:57 +0200 Original-Received: from localhost ([::1]:35182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxOTp-00087D-U5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Jun 2022 03:45:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxOT0-00086U-N3 for bug-gnu-emacs@gnu.org; Sat, 04 Jun 2022 03:45:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxOT0-00055L-DN for bug-gnu-emacs@gnu.org; Sat, 04 Jun 2022 03:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nxOT0-0005eS-4o for bug-gnu-emacs@gnu.org; Sat, 04 Jun 2022 03:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Jun 2022 07:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55787 X-GNU-PR-Package: emacs Original-Received: via spool by 55787-submit@debbugs.gnu.org id=B55787.165432865621636 (code B ref 55787); Sat, 04 Jun 2022 07:45:02 +0000 Original-Received: (at 55787) by debbugs.gnu.org; 4 Jun 2022 07:44:16 +0000 Original-Received: from localhost ([127.0.0.1]:57560 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nxOSF-0005cu-Vz for submit@debbugs.gnu.org; Sat, 04 Jun 2022 03:44:16 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46744) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nxOSE-0005ce-S7 for 55787@debbugs.gnu.org; Sat, 04 Jun 2022 03:44:15 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:46530) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxOS8-0004zi-A5; Sat, 04 Jun 2022 03:44:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=iwl2AxZeKLfD/fDAlTIgxM4lwiLdb5zuebShxzQ7sMg=; b=lpUinMkaYm6w emc+J3Exn/mPp+2c7O/eX69zAlsdUuvyy9/oxdp7BTXPYYT5xlDhahcixAFn+4aOFTM2EmqjJrzG7 Th0K+d5TlDN4wN/mMh0dMwBRmbC3AjluuB++4A6+j6+P6/0Te7pKpvl/z314yKGNalET2k6Dnp/9K 8uZkGgJAi87H637p+Z5SZtPCDQYLYsLOscUfGWZisY7DsqabSC8sfEAzZRc6/srnAuk9hKG98zS78 D1H06MUQORf3UW9fy3wpKbASpmTfD0Haa+EnZIYKgS3sjvsRk7MvWXOZIN87ueQ1azTHowBgCtco2 tZeu50sPAhjsg4VWmgRx7w==; Original-Received: from [87.69.77.57] (port=1903 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxOS7-000165-PQ; Sat, 04 Jun 2022 03:44:08 -0400 In-Reply-To: <87tu91fi43.fsf@yfb02119.nifty.com> (message from TAKAHASHI Yoshio on Sat, 04 Jun 2022 08:21:48 +0900) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:233640 Archived-At: > From: TAKAHASHI Yoshio > Date: Sat, 04 Jun 2022 08:21:48 +0900 > > I encounter an inconsistent sort result. The position of "01.0" and/or > "01.2" seems wrong. > > > $ cat /tmp/test.el > (require 'ls-lisp) > (print (sort (vector "01.0" "10" "010" "01.2") > (lambda (x y) > (ls-lisp-version-lessp x y)))) > $ emacs -Q --batch -l /tmp/test.el > > ["01.0" "10" "010" "01.2"] Why do you think this is wrong? This function is not meant to compare dotted versions with undotted ones, only dotted to dotted or undotted to undotted. The strings are supposed to be file names, where a dot begins an extension. See the node "More details about version sort" in the GNU Coreutils manual for more info. If you want a general-purpose version-comparison function, use version< instead.