diff options
| author | Phillip Lord <phillip.lord@russet.org.uk> | 2019-06-24 22:27:14 +0100 |
|---|---|---|
| committer | Phillip Lord <phillip.lord@russet.org.uk> | 2019-06-24 22:27:14 +0100 |
| commit | 3b0f44592f857b1e849f2190ef92835a7ea6b84f (patch) | |
| tree | 262b3aea207f40dba3b20d1167bacf3fc5a64b76 | |
| parent | ac7ca1346f7d9d42b12c7d82b3ec643a65d0b503 (diff) | |
| download | org-drill-3b0f44592f857b1e849f2190ef92835a7ea6b84f.tar.gz org-drill-3b0f44592f857b1e849f2190ef92835a7ea6b84f.zip | |
Add compatibility hacks to support org-mode 8
We do not really need to support org-mode 8 but as it is the default
install it makes it easier to test from a clean emacs.
| -rw-r--r-- | org-drill.el | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/org-drill.el b/org-drill.el index c808ebb..d6ac8cf 100644 --- a/org-drill.el +++ b/org-drill.el @@ -65,8 +65,6 @@ :tag "Org-Drill" :group 'org-link) - - (defcustom org-drill-question-tag "drill" "Tag which topics must possess in order to be identified as review topics @@ -649,7 +647,6 @@ random number to another language.") :documentation "An org-drill session object carries data about the current state of a particular org-drill session." ) - (defvar org-drill-current-session nil) (defvar org-drill-last-session nil) @@ -706,6 +703,22 @@ regardless of whether the test was successful.") (put 'org-drill-right-cloze-delimiter 'safe-local-variable 'stringp) +;;; Org compatability hacks +(defvar org-drill-org-8-p (string-prefix-p "8" org-version)) +(when org-drill-org-8-p + (advice-add 'org-get-tags :around #'org-drill-get-tags-advice)) + +(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)) + (funcall orig-fun))) + +(when org-drill-org-8-p + (defun org-toggle-latex-fragment (&rest args) + (apply 'org-prefix-latex-fragment args))) + ;;;; Utilities ================================================================ |
