From 75b16019e0cd8de4213719df552b6d4c5a2a699e Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 5 May 2026 09:08:25 -0500 Subject: build: bump Org dep to 9.6 to match unguarded org-fold-* calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit org-drill calls org-fold-show-entry and org-fold-show-subtree from seven sites without fboundp guards. Both functions arrived in Org 9.6. But the package declared org 9.3 (Package-Requires) / org 9.2 (Cask), so users on older Org would silently void-function at runtime instead of getting a clear install-time mismatch error. Bumped both declarations to org 9.6. Wrapping each of the seven call sites with fboundp would be the alternative, but Org 9.6 was released October 2022 — three-and-a-half years ago — and we already have a follow-up TODO to drop the legacy time-to-inactive fallback that this version bump unblocks. Two tests verify the declared dep and that the org-fold APIs are actually bound on the running Org version. --- Cask | 2 +- org-drill.el | 2 +- tests/test-org-drill-org-9.6-dep.el | 44 +++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 tests/test-org-drill-org-9.6-dep.el diff --git a/Cask b/Cask index 5da2b9a..7192f02 100644 --- a/Cask +++ b/Cask @@ -10,5 +10,5 @@ (depends-on "undercover") (depends-on "package-lint") (depends-on "elisp-lint")) -(depends-on "org" "9.2") +(depends-on "org" "9.6") diff --git a/org-drill.el b/org-drill.el index 1573c1a..e2d8310 100644 --- a/org-drill.el +++ b/org-drill.el @@ -5,7 +5,7 @@ ;; Maintainer: Phillip Lord ;; Author: Paul Sexton ;; Version: 2.7.0 -;; Package-Requires: ((emacs "25.3") (seq "2.14") (org "9.3") (persist "0.3")) +;; Package-Requires: ((emacs "25.3") (seq "2.14") (org "9.6") (persist "0.3")) ;; Keywords: games, outlines, multimedia ;; URL: https://gitlab.com/phillord/org-drill/issues diff --git a/tests/test-org-drill-org-9.6-dep.el b/tests/test-org-drill-org-9.6-dep.el new file mode 100644 index 0000000..74a3f2a --- /dev/null +++ b/tests/test-org-drill-org-9.6-dep.el @@ -0,0 +1,44 @@ +;;; test-org-drill-org-9.6-dep.el --- Test Org dep declarations match runtime needs -*- lexical-binding: t; -*- + +;;; Commentary: +;; org-drill calls `org-fold-show-entry' and `org-fold-show-subtree' +;; from seven sites without `fboundp' guards. Both functions arrived +;; in Org 9.6. Pre-fix the package declared `(org "9.3")' / +;; `(depends-on "org" "9.2")', so users on older Org would silently +;; void-function at runtime instead of getting a clear install-time +;; error. +;; +;; Bumping the dep to 9.6 makes the requirement explicit and lets us +;; call the new APIs without per-site guards. Tests verify the +;; declared deps and that the API symbols are actually bound. + +;;; Code: + +(require 'ert) +(require 'org) +(require 'org-drill) + +;;;; Dep declarations + +(ert-deftest test-org-drill-package-requires-org-9.6-or-newer () + "The Package-Requires header declares org 9.6+ — matches the runtime +need for org-fold-show-entry/-subtree." + (let ((header-line + (with-temp-buffer + (insert-file-contents + (locate-library "org-drill") nil 0 4096) + (goto-char (point-min)) + (when (re-search-forward "Package-Requires:.*$" nil t) + (match-string 0))))) + (should header-line) + (should (string-match-p "(org \"9\\.6\\|9\\.[7-9]\\|[1-9][0-9]" header-line)))) + +(ert-deftest test-org-drill-org-fold-functions-bound () + "On any supported Org version (>= 9.6), the org-fold APIs we call +without guards are actually bound." + (should (fboundp 'org-fold-show-entry)) + (should (fboundp 'org-fold-show-subtree))) + +(provide 'test-org-drill-org-9.6-dep) + +;;; test-org-drill-org-9.6-dep.el ends here -- cgit v1.2.3