[Top][All Lists]

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

One more string functions change

From: Dmitry Antipov
Subject: One more string functions change
Date: Fri, 27 Jun 2014 19:27:21 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

I would like to convert string-equal and string-lessp to
(defun string-equal s1 s2 &optional ignore-case) and
(defun string-lessp s1 s2 &optional ignore-case), respectively.
The goals are 1) to provide more consistent interface similar
to compare-strings and 2) to avoid an endless and annoying Elisp
up/downcasing like:

(defun gnus-string< (s1 s2)
  "Return t if first arg string is less than second in lexicographic order.
Case is significant if and only if `case-fold-search' is nil.
Symbols are also allowed; their print names are used instead."
  (if case-fold-search
      (string-lessp (downcase (if (symbolp s1) (symbol-name s1) s1))
                    (downcase (if (symbolp s2) (symbol-name s2) s2)))
    (string-lessp s1 s2)))

Note that unlike previous compare-strings change, this shouldn't break
backward compatibility.



Attachment: string_comparison.patch
Description: Text Data

reply via email to

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