emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sebastian Reuße" <seb@wirrsal.net>
To: emacs-orgmode@gnu.org
Cc: "Sebastian Reuße" <seb@wirrsal.net>
Subject: [PATCH] Fix alphabetic string matching operators
Date: Sun, 11 Mar 2018 17:09:32 +0100	[thread overview]
Message-ID: <20180311160932.28086-1-seb@wirrsal.net> (raw)
In-Reply-To: <20180311154352.16920-2-seb@wirrsal.net>

* 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

  reply	other threads:[~2018-03-11 16:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-11 15:43 [PATCH 1/6] Fix alphabetic sorting for tables, plain lists Sebastian Reuße
2018-03-11 15:43 ` [PATCH 2/6] Fix alphabetic string matching operators Sebastian Reuße
2018-03-11 16:09   ` Sebastian Reuße [this message]
2018-03-13  8:13     ` [PATCH] " Nicolas Goaziou
2018-03-11 16:11   ` [PATCH 2/6] " Sebastian Reuße
2018-03-11 15:43 ` [PATCH 3/6] Fix org-table-sort-lines test Sebastian Reuße
2018-03-13  8:13   ` Nicolas Goaziou
2018-03-11 15:43 ` [PATCH 4/6] Fix string-collate-lessp shim Sebastian Reuße
2018-03-13  8:12   ` Nicolas Goaziou
2018-03-11 15:43 ` [PATCH 5/6] org-table-sort-lines: Fix case-sensitive sorting Sebastian Reuße
2018-03-13  8:13   ` Nicolas Goaziou
2018-03-11 15:43 ` [PATCH 6/6] Improve ‘org-sort-list’ test Sebastian Reuße
2018-03-13  8:13   ` Nicolas Goaziou
2018-03-13  8:12 ` [PATCH 1/6] Fix alphabetic sorting for tables, plain lists Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180311160932.28086-1-seb@wirrsal.net \
    --to=seb@wirrsal.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).