diff options
| author | Craig Jennings <c@cjennings.net> | 2025-11-13 13:45:14 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2025-11-13 13:45:14 -0600 |
| commit | b2f663e93cc255115a8ec2e5a1195130e9f98853 (patch) | |
| tree | 6f84728eb93e0f2914b6dd6ac81d73a02862bf90 | |
| parent | cc5cb037e923174684bd2cf7aa8b185283679a29 (diff) | |
| download | org-drill-b2f663e93cc255115a8ec2e5a1195130e9f98853.tar.gz org-drill-b2f663e93cc255115a8ec2e5a1195130e9f98853.zip | |
Fix missing return value in org-drill-get-tags-advice
Added fallback to original function when org-get-local-tags doesn't exist.
Changes:
- Removed underscore from orig-fun parameter (now used)
- Added else clause to fallback to (apply orig-fun args)
- Added explanatory comment
Impact: In older org-mode versions where org-get-local-tags doesn't exist,
the function now properly falls back to the original org-get-tags behavior
instead of returning nil, fixing tag functionality.
Fixes severity A bug in todo.org
| -rw-r--r-- | org-drill.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/org-drill.el b/org-drill.el index 16133c5..781d63e 100644 --- a/org-drill.el +++ b/org-drill.el @@ -701,11 +701,14 @@ regardless of whether the test was successful.") (when (version< org-version "9.2") (advice-add 'org-get-tags :around #'org-drill-get-tags-advice)) -(defun org-drill-get-tags-advice (_orig-fun &rest args) +(defun org-drill-get-tags-advice (orig-fun &rest args) ;; the two arg call obsoletes get-local-tags (if (= 2 (length args)) ;; and we don't want any byte compile errors - (if (fboundp 'org-get-local-tags) (org-get-local-tags)) + (if (fboundp 'org-get-local-tags) + (org-get-local-tags) + ;; Fallback to original function if org-get-local-tags doesn't exist + (apply orig-fun args)) ;; the non-arg version doesn't return inherited tags, but ;; org-get-tags does. (org-get-tags))) |
