From 09e7b60505d80db038eefcd8519c7bd64b31e030 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 21 Dec 2023 17:11:01 -0600 Subject: [PATCH] Tidy: Compatibility aliases for Org 9.6 --- org-ql-search.el | 14 ++++++++++++-- org-ql.el | 8 +++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/org-ql-search.el b/org-ql-search.el index f726891..57215f8 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -58,6 +58,16 @@ ((fboundp 'org-store-link-props) #'org-store-link-props) (t (error "org-ql: Unable to define alias `org-ql-search--org-link-store-props'. Please report this as a bug")))) +(defalias 'org-ql--org-hide-archived-subtrees + (if (version<= "9.6" org-version) + 'org-fold-hide-archived-subtrees + 'org-hide-archived-subtrees)) + +(defalias 'org-ql--org-show-context + (if (version<= "9.6" org-version) + 'org-fold-show-context + 'org-show-context)) + ;;;; Variables (defvar org-ql-block-header nil @@ -126,10 +136,10 @@ Runs `org-occur-hook' after making the sparse tree." query)))) (org-ql-select buffer query :action (lambda () - (org-show-context 'occur-tree) + (org-ql--org-show-context 'occur-tree) (cl-incf num-results))) (unless org-sparse-tree-open-archived-trees - (org-hide-archived-subtrees (point-min) (point-max))) + (org-ql--org-hide-archived-subtrees (point-min) (point-max))) (run-hooks 'org-occur-hook) (unless (get-buffer-window buffer) (pop-to-buffer buffer)) diff --git a/org-ql.el b/org-ql.el index 29d515c..d9f834b 100644 --- a/org-ql.el +++ b/org-ql.el @@ -96,6 +96,12 @@ Necessary because of backward-incompatible changes in Org `org-bracket-link-regexp' was marked as an obsolete alias for it, but the match groups were changed, so they are not compatible.") +;;;; Compatibility +(defalias 'org-ql--org-timestamp-format + (if (version<= "9.6" org-version) + 'org-format-timestamp + 'org-timestamp-format)) + ;;;; Variables (defvar org-ql--today nil) @@ -2478,7 +2484,7 @@ Deadline is considered before scheduled." A and B are Org timestamp elements." (cl-macrolet ((ts (ts) `(when ,ts - (org-timestamp-format ,ts "%s")))) + (org-ql--org-timestamp-format ,ts "%s")))) (let* ((a-ts (ts a)) (b-ts (ts b))) (cond ((and a-ts b-ts)