[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.
Objections?
Dmitry
string_comparison.patch
Description: Text Data
- One more string functions change,
Dmitry Antipov <=
- Re: One more string functions change, Andreas Schwab, 2014/06/27
- Re: One more string functions change, Paul Eggert, 2014/06/27
- Re: One more string functions change, Eli Zaretskii, 2014/06/27
- Re: One more string functions change, Dmitry Antipov, 2014/06/28
- Re: One more string functions change, Eli Zaretskii, 2014/06/28
- Re: One more string functions change, Dmitry Antipov, 2014/06/28
- Re: One more string functions change, Eli Zaretskii, 2014/06/29
- Re: One more string functions change, Dmitry Antipov, 2014/06/29