From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ulrich Mueller Newsgroups: gmane.emacs.bugs Subject: bug#72486: 31.0.50; string> not documented in the lispref manual Date: Tue, 06 Aug 2024 18:08:32 +0200 Message-ID: References: <86ed71q3hc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4884"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 72486@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 06 18:10:42 2024 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 1sbMll-000174-53 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Aug 2024 18:10:41 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbMlR-00082s-6g; Tue, 06 Aug 2024 12:10:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbMkl-0007eL-Cr for bug-gnu-emacs@gnu.org; Tue, 06 Aug 2024 12:09:45 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbMkk-0002s1-Pz for bug-gnu-emacs@gnu.org; Tue, 06 Aug 2024 12:09:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=VjqEo1b8Uq0YG+atiJ0rzQpYF66QvnWI8I2SNo1k3Gc=; b=C5SqyohW91g1vPHbejl1sx1tZLDST51zSmMUdhoXw7Krx/yjgktXziMw5EwdzQGW4jCOOBnCipxe9wdQ1hmtDCTnt3zT3IfghcJjTn0ZQZ+AgqsNUqvd5MmW4CbTXwvIiRHIYODP5SuaK/LUOCyYfTYew/voLVRn5GMbg6M3tXTAQUNhkvRbTpy0nqOy/iy00gSSkYZKchP/sFxOfqbWbtN+I97pp56Q45mA1dIqzvP90cqyMhVRylXOey2Mm8FIP9UYZg2qNkGKRwLY8mhdStRY4VADj5Xb++K9Tg7a7OMdayAcGZcYQ62Iv6hdmBi/O1mMrmk/ayIDdvu4I7dEOg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sbMl8-0002VZ-4h for bug-gnu-emacs@gnu.org; Tue, 06 Aug 2024 12:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ulrich Mueller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Aug 2024 16:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72486 X-GNU-PR-Package: emacs Original-Received: via spool by 72486-submit@debbugs.gnu.org id=B72486.17229605919621 (code B ref 72486); Tue, 06 Aug 2024 16:10:02 +0000 Original-Received: (at 72486) by debbugs.gnu.org; 6 Aug 2024 16:09:51 +0000 Original-Received: from localhost ([127.0.0.1]:32937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbMkx-0002V5-2P for submit@debbugs.gnu.org; Tue, 06 Aug 2024 12:09:51 -0400 Original-Received: from woodpecker.gentoo.org ([140.211.166.183]:43748 helo=smtp.gentoo.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sbMku-0002Ul-QE for 72486@debbugs.gnu.org; Tue, 06 Aug 2024 12:09:50 -0400 In-Reply-To: <86ed71q3hc.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 06 Aug 2024 14:45:35 +0300") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289840 Archived-At: --=-=-= Content-Type: text/plain >>>>> On Tue, 06 Aug 2024, Eli Zaretskii wrote: > Thanks, but: > . this should go to the release branch > . the truth is that string-greaterp is the function and string> is > its alias, not the other way around, so I'd reverse the > description (and likewise for string<) Same for string-equal and string=. Updated patch below. --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=0001-Update-description-of-string-comparison-functions.patch >From 4dc9e99349d23f6c7fc43f02d5f1e8c50f473183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrich=20M=C3=BCller?= Date: Tue, 6 Aug 2024 18:04:46 +0200 Subject: [PATCH] Update description of string comparison functions * doc/lispref/strings.texi (Text Comparison): Swap descriptions of 'string-equal' (the function) and 'string=' (its alias). Same for 'string-lessp' and 'string<'. Document 'string>'. (Bug#72486) * doc/lispref/sequences.texi (Sequence Functions): Update cross reference to 'string-lessp'. --- doc/lispref/sequences.texi | 5 +++-- doc/lispref/strings.texi | 45 ++++++++++++++++++++------------------ 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi index 9b0a0d74f30..079fc6094c3 100644 --- a/doc/lispref/sequences.texi +++ b/doc/lispref/sequences.texi @@ -468,8 +468,9 @@ Sequence Functions @item Numbers are compared using @code{<} (@pxref{definition of <}). @item -Strings are compared using @code{string<} (@pxref{definition of -string<}) and symbols are compared by comparing their names as strings. +Strings are compared using @code{string-lessp} (@pxref{definition of +string-lessp}) and symbols are compared by comparing their names as +strings. @item Conses, lists, vectors and records are compared lexicographically. This means that the two sequences are compared element-wise from left to diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index d29665ac19b..09ab93ded27 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -502,7 +502,7 @@ Text Comparison @end example @end defun -@defun string= string1 string2 +@defun string-equal string1 string2 This function returns @code{t} if the characters of the two strings match exactly. Symbols are also allowed as arguments, in which case the symbol names are used. Case is always significant, regardless of @@ -513,25 +513,25 @@ Text Comparison the two strings are ignored; use @code{equal-including-properties} if you need to distinguish between strings that differ only in their text properties. However, unlike @code{equal}, if either argument is not a -string or symbol, @code{string=} signals an error. +string or symbol, @code{string-equal} signals an error. @example -(string= "abc" "abc") +(string-equal "abc" "abc") @result{} t -(string= "abc" "ABC") +(string-equal "abc" "ABC") @result{} nil -(string= "ab" "ABC") +(string-equal "ab" "ABC") @result{} nil @end example A unibyte and a multibyte string are equal in the sense of -@code{string=} if and only if they contain the same sequence of +@code{string-equal} if and only if they contain the same sequence of character codes all being in the range 0--127 (@acronym{ASCII}). @xref{Text Representations}. @end defun -@defun string-equal string1 string2 -@code{string-equal} is another name for @code{string=}. +@defun string= string1 string2 +@code{string=} is another name for @code{string-equal}. @end defun @defun string-equal-ignore-case string1 string2 @@ -597,9 +597,8 @@ Text Comparison @end defun @cindex lexical comparison of strings -@anchor{definition of string<} -@defun string< string1 string2 -@c (findex string< causes problems for permuted index!!) +@anchor{definition of string-lessp} +@defun string-lessp string1 string2 This function compares two strings a character at a time. It scans both the strings at the same time to find the first pair of corresponding characters that do not match. If the lesser character of these two is @@ -618,11 +617,11 @@ Text Comparison @example @group -(string< "abc" "abd") +(string-lessp "abc" "abd") @result{} t -(string< "abd" "abc") +(string-lessp "abd" "abc") @result{} nil -(string< "123" "abc") +(string-lessp "123" "abc") @result{} t @end group @end example @@ -634,15 +633,15 @@ Text Comparison @example @group -(string< "" "abc") +(string-lessp "" "abc") @result{} t -(string< "ab" "abc") +(string-lessp "ab" "abc") @result{} t -(string< "abc" "") +(string-lessp "abc" "") @result{} nil -(string< "abc" "ab") +(string-lessp "abc" "ab") @result{} nil -(string< "" "") +(string-lessp "" "") @result{} nil @end group @end example @@ -651,8 +650,8 @@ Text Comparison are compared. @end defun -@defun string-lessp string1 string2 -@code{string-lessp} is another name for @code{string<}. +@defun string< string1 string2 +@code{string<} is another name for @code{string-lessp}. @end defun @defun string-greaterp string1 string2 @@ -661,6 +660,10 @@ Text Comparison @code{(string-lessp @var{string2} @var{string1})}. @end defun +@defun string> string1 string2 +@code{string>} is another name for @code{string-greaterp}. +@end defun + @cindex locale-dependent string comparison @defun string-collate-lessp string1 string2 &optional locale ignore-case This function returns @code{t} if @var{string1} is less than -- 2.45.2 --=-=-=--