diff --git a/README.org b/README.org index 3ac0cf5..f3a79b5 100644 --- a/README.org +++ b/README.org @@ -363,6 +363,11 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience /Note:/ Breaking changes may be made before version 1.0, but in the event of major changes, attempts at backward compatibility will be made with obsolescence declarations, translation of arguments, etc. Users who need stability guarantees before 1.0 may choose to use tagged stable releases. +** 0.3.1 + +*Fixed* ++ Compatibility with Org 9.2. Thanks to [[https://github.com/leungbk][Brian Leung]]. + ** 0.3 *Added* diff --git a/org-ql.el b/org-ql.el index e90dd8a..7d17352 100644 --- a/org-ql.el +++ b/org-ql.el @@ -2,7 +2,7 @@ ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql -;; Version: 0.3 +;; Version: 0.3.1 ;; Package-Requires: ((emacs "26.1") (dash "2.13") (dash-functional "1.2.0") (org "9.0") (org-super-agenda "1.2-pre") (ov "1.0.6") (peg "0.6") (s "1.12.0") (ts "0.2-pre")) ;; Keywords: hypermedia, outlines, Org, agenda @@ -44,17 +44,6 @@ (require 'dash-functional) (require 'ts) -;;;; Compatibility - -(if (version< org-version "9.2") - (progn - (defalias 'org-timestamp-to-time #'org-timestamp--to-internal-time) - (defun org-ql--get-tags (&optional pos local) - (org-get-tags-at pos local))) - (defun org-ql--get-tags (&rest _ignore) - "Call `org-get-tags', ignoring arguments." - (org-get-tags))) - ;;;; Constants ;; Note the use of the `rx' `blank' keyword, which matches "horizontal" whitespace. @@ -76,6 +65,13 @@ match group.") "Regular expression matching Org \"planning\" lines. That is, \"CLOSED:\", \"DEADLINE:\", or \"SCHEDULED:\".") +(defconst org-ql-tag-line-re + "^\\*+ \\(?:.*[ \t]\\)?\\(:\\([[:alnum:]_@#%:]+\\):\\)[ \t]*$" + ;; Copied from `org-tag-line-re' from org.el. + "Regexp matching tags in a headline. +Tags are stored in match group 1. Match group 2 stores the tags +without the enclosing colons.") + ;;;; Variables (defvar org-ql--today nil) @@ -383,7 +379,8 @@ Returns cons (INHERITED-TAGS . LOCAL-TAGS)." ('org-ql-nil nil) (_ cached-result)) ;; Not found in cache: get tags and cache them. - (let* ((local-tags (or (org-ql--get-tags position 'local) + (let* ((local-tags (or (when (looking-at org-ql-tag-line-re) + (split-string (match-string-no-properties 2) ":" t)) 'org-ql-nil)) (inherited-tags (or (when org-use-tag-inheritance (save-excursion