From 409a62e5c93e78b250146c6accd5c5c3cd07fcdb Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 13 Mar 2018 09:26:53 +0100 Subject: [PATCH] Move some string functions to "org-macs.el" * lisp/org.el (org-string<): (org-string<=): (org-string>=): (org-string>): (org-string<>): Move to... * lisp/org-macs.el: ... here. --- lisp/org-macs.el | 16 ++++++++++++++++ lisp/org.el | 5 ----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lisp/org-macs.el b/lisp/org-macs.el index f919dadee..d4531c25a 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -335,6 +335,22 @@ if it fails." ;;; String manipulation +(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))) + (defsubst org-trim (s &optional keep-lead) "Remove whitespace at the beginning and the end of string S. When optional argument KEEP-LEAD is non-nil, removing blank lines diff --git a/lisp/org.el b/lisp/org.el index 24923ad4f..76bc60c88 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -14054,11 +14054,6 @@ When DOWNCASE is non-nil, expand downcased TAGS." (nth (if (eq stringp 'time) 2 (if stringp 1 0)) op)) (defun org<> (a b) (not (= 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))) (defun org-time<= (a b) (setq a (org-2ft a) b (org-2ft b)) (and (> a 0) (> b 0) (<= a b))) -- 2.11.4.GIT