From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Sebastian=20Reu=C3=9Fe?= Subject: [PATCH] Fix alphabetic string matching operators Date: Sun, 11 Mar 2018 17:09:32 +0100 Message-ID: <20180311160932.28086-1-seb@wirrsal.net> References: <20180311154352.16920-2-seb@wirrsal.net> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ev3Xx-0003LU-5j for emacs-orgmode@gnu.org; Sun, 11 Mar 2018 12:10:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ev3Xu-0001oD-0i for emacs-orgmode@gnu.org; Sun, 11 Mar 2018 12:10:05 -0400 Received: from wirrsal.net ([188.68.36.149]:43372 helo=mail.wirrsal.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ev3Xt-0001nP-NM for emacs-orgmode@gnu.org; Sun, 11 Mar 2018 12:10:01 -0400 In-Reply-To: <20180311154352.16920-2-seb@wirrsal.net> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Cc: =?UTF-8?q?Sebastian=20Reu=C3=9Fe?= * 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 &optional 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 &optional 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