Re: [O] [PATCH] Fix alphabetic string matching operators

2018-03-13 Thread Nicolas Goaziou
Sebastian Reuße  writes:

> * org.el (org-string<): Add.
> (org-op-to-function): Use it.
> (org-string> etc.): Use collated comparison.
>
> Cf. commit 551d2f1fe.

Applied. Thank you.



[O] [PATCH] Fix alphabetic string matching operators

2018-03-11 Thread Sebastian Reuße
* org.el (org-string<): Add.
(org-op-to-function): Use it.
(org-string> etc.): Use collated comparison.

Cf. commit 551d2f1fe.
---
 lisp/org.el | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index ac1ad3c75..24923ad4f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -14045,7 +14045,7 @@ (defun org-op-to-function (op  stringp)
   "Turn an operator into the appropriate function."
   (setq op
(cond
-((equal  op   "<"   ) '(< string<  org-time<))
+((equal  op   "<"   ) '(< org-string<  org-time<))
 ((equal  op   ">"   ) '(> org-string>  org-time>))
 ((member op '("<=" "=<")) '(<=org-string<= org-time<=))
 ((member op '(">=" "=>")) '(>=org-string>= org-time>=))
@@ -14054,9 +14054,10 @@ (defun org-op-to-function (op  stringp)
   (nth (if (eq stringp 'time) 2 (if stringp 1 0)) op))
 
 (defun org<> (a b) (not (= a b)))
-(defun org-string<= (a b) (or (string= a b) (string< a b)))
-(defun org-string>= (a b) (not (string< a b)))
-(defun org-string>  (a b) (and (not (string= a b)) (not (string< a b
+(defun org-string<  (a b) (org-string-collate-lessp a b))
+(defun org-string<= (a b) (or (string= a b) (org-string-collate-lessp a b)))
+(defun org-string>= (a b) (not (org-string-collate-lessp a b)))
+(defun org-string>  (a b) (and (not (string= a b)) (not 
(org-string-collate-lessp a b
 (defun org-string<> (a b) (not (string= a b)))
 (defun org-time=  (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 
0) (= a b)))
 (defun org-time<  (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 
0) (< a b)))
-- 
2.16.2