emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 5ec8be1d589: ; * lisp/subr.el (string-suffix-p, string-prefix-p


From: Eli Zaretskii
Subject: emacs-29 5ec8be1d589: ; * lisp/subr.el (string-suffix-p, string-prefix-p): Doc fix.
Date: Thu, 14 Sep 2023 09:09:22 -0400 (EDT)

branch: emacs-29
commit 5ec8be1d58922eb7af95f720882dbb56410129d4
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    ; * lisp/subr.el (string-suffix-p, string-prefix-p): Doc fix.
---
 lisp/subr.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lisp/subr.el b/lisp/subr.el
index ce23a699624..426e8145cae 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -5494,9 +5494,11 @@ See also `string-equal'."
   (eq t (compare-strings string1 0 nil string2 0 nil t)))
 
 (defun string-prefix-p (prefix string &optional ignore-case)
-  "Return non-nil if PREFIX is a prefix of STRING.
+  "Return non-nil if STRING begins with PREFIX.
+PREFIX should be a string; the function returns non-nil if the
+characters at the beginning of STRING compare equal with PREFIX.
 If IGNORE-CASE is non-nil, the comparison is done without paying attention
-to case differences."
+to letter-case differences."
   (declare (pure t) (side-effect-free t))
   (let ((prefix-length (length prefix)))
     (if (> prefix-length (length string)) nil
@@ -5504,9 +5506,11 @@ to case differences."
                             0 prefix-length ignore-case)))))
 
 (defun string-suffix-p (suffix string  &optional ignore-case)
-  "Return non-nil if SUFFIX is a suffix of STRING.
+  "Return non-nil if STRING ends with SUFFIX.
+SUFFIX should be a string; the function returns non-nil if the
+characters at end of STRING compare equal with SUFFIX.
 If IGNORE-CASE is non-nil, the comparison is done without paying
-attention to case differences."
+attention to letter-case differences."
   (declare (pure t) (side-effect-free t))
   (let ((start-pos (- (length string) (length suffix))))
     (and (>= start-pos 0)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]