Skip to content

Commit

Permalink
Simplifying version check code
Browse files Browse the repository at this point in the history
  • Loading branch information
sympodius committed May 22, 2024
1 parent 6a55b60 commit 2b07550
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions org-novelist.el
Original file line number Diff line number Diff line change
Expand Up @@ -681,11 +681,9 @@ The resultant string should be suitable for the current operating system."
"Run the deprecated org-show-all when Org version is less than 9.6.
Otherwise, run org-fold-show-all."
(unless orgn--org-version-checked-p
(if (or (> (string-to-number (nth 0 (split-string (org-version) "\\."))) 9)
(and (= (string-to-number (nth 0 (split-string (org-version) "\\."))) 9)
(>= (string-to-number (nth 1 (split-string (org-version) "\\."))) 6)))
(setq orgn--org-9.6-or-above-p t)
(setq orgn--org-9.6-or-above-p nil))
(if (string-version-lessp (org-version) "9.6")
(setq orgn--org-9.6-or-above-p nil)
(setq orgn--org-9.6-or-above-p t))
(setq orgn--org-version-checked-p t))
(if orgn--org-9.6-or-above-p
(org-fold-show-all)
Expand All @@ -697,11 +695,9 @@ Otherwise, run `format-time-string'.
FORMAT-STRING is the output format.
TIME-ZONE is the given time. If omitted or nil, use local time."
(unless orgn--org-version-checked-p
(if (or (> (string-to-number (nth 0 (split-string (org-version) "\\."))) 9)
(and (= (string-to-number (nth 0 (split-string (org-version) "\\."))) 9)
(>= (string-to-number (nth 1 (split-string (org-version) "\\."))) 6)))
(setq orgn--org-9.6-or-above-p t)
(setq orgn--org-9.6-or-above-p nil))
(if (string-version-lessp (org-version) "9.6")
(setq orgn--org-9.6-or-above-p nil)
(setq orgn--org-9.6-or-above-p t))
(setq orgn--org-version-checked-p t))
(if orgn--org-9.6-or-above-p
(format-time-string format-string time-zone)
Expand Down

0 comments on commit 2b07550

Please sign in to comment.