unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ulrich Mueller <ulm@gentoo.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 72486@debbugs.gnu.org
Subject: bug#72486: 31.0.50; string> not documented in the lispref manual
Date: Tue, 06 Aug 2024 18:08:32 +0200	[thread overview]
Message-ID: <uplqlbpmn@gentoo.org> (raw)
In-Reply-To: <86ed71q3hc.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 06 Aug 2024 14:45:35 +0300")

[-- Attachment #1: Type: text/plain, Size: 344 bytes --]

>>>>> 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.


[-- Attachment #2: 0001-Update-description-of-string-comparison-functions.patch --]
[-- Type: text/plain, Size: 4980 bytes --]

From 4dc9e99349d23f6c7fc43f02d5f1e8c50f473183 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@gentoo.org>
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


  reply	other threads:[~2024-08-06 16:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-06  4:22 bug#72486: 31.0.50; string> not documented in the lispref manual Ulrich Mueller
2024-08-06 11:45 ` Eli Zaretskii
2024-08-06 16:08   ` Ulrich Mueller [this message]
2024-08-06 16:27     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=uplqlbpmn@gentoo.org \
    --to=ulm@gentoo.org \
    --cc=72486@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).