[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-drill f9b4c257af 067/251: Check that org version is >=
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-drill f9b4c257af 067/251: Check that org version is >= 7.9.3f (the 'org-schedule' function in older |
Date: |
Mon, 17 Jan 2022 18:59:01 -0500 (EST) |
branch: elpa/org-drill
commit f9b4c257af821ce3bbcd26fa6b5fef4423b7ed43
Author: eeeickythump <devnull@localhost>
Commit: eeeickythump <devnull@localhost>
Check that org version is >= 7.9.3f (the 'org-schedule' function in older
versions is incompatible).
Cloze fontification now uses the 'official' org mode mechanism for adding
fontification.
---
org-drill.el | 64 ++++++++++++++++++++++++++++++++++++++++--------------------
1 file changed, 43 insertions(+), 21 deletions(-)
diff --git a/org-drill.el b/org-drill.el
index f559a0d4c7..e5b0d49780 100644
--- a/org-drill.el
+++ b/org-drill.el
@@ -2,7 +2,7 @@
;;; org-drill.el - Self-testing using spaced repetition
;;;
;;; Author: Paul Sexton <eeeickythump@gmail.com>
-;;; Version: 2.4.0
+;;; Version: 2.4.1
;;; Repository at http://bitbucket.org/eeeickythump/org-drill/
;;;
;;;
@@ -577,9 +577,9 @@ value."
"Randomly permute the elements of LIST (all permutations equally likely)."
;; Adapted from 'shuffle-vector' in cookie1.el
(let ((i 0)
- j
- temp
- (len (length list)))
+ j
+ temp
+ (len (length list)))
(while (< i len)
(setq j (+ i (random* (- len i))))
(setq temp (nth i list))
@@ -1013,16 +1013,16 @@ Returns a list: (INTERVAL REPEATS EF FAILURES MEAN
TOTAL-REPEATS OFMATRIX), wher
(defun get-optimal-factor-sm5 (n ef of-matrix)
(let ((factors (assoc n of-matrix)))
(or (and factors
- (let ((ef-of (assoc ef (cdr factors))))
- (and ef-of (cdr ef-of))))
- (initial-optimal-factor-sm5 n ef))))
+ (let ((ef-of (assoc ef (cdr factors))))
+ (and ef-of (cdr ef-of))))
+ (initial-optimal-factor-sm5 n ef))))
(defun inter-repetition-interval-sm5 (last-interval n ef &optional of-matrix)
(let ((of (get-optimal-factor-sm5 n ef (or of-matrix
org-drill-optimal-factor-matrix))))
(if (= 1 n)
- of
+ of
(* of last-interval))))
@@ -2498,6 +2498,16 @@ If RESUME-P is non-nil, resume a suspended drill session
rather
than starting a new one."
(interactive)
+ ;; Check org version. Org 7.9.3f introduced a backwards-incompatible change
+ ;; to the arguments accepted by `org-schedule'. At the time of writing there
+ ;; are still lots of people using versions of org older than this.
+ (let ((majorv (first (mapcar 'string-to-number (split-string (org-release)
"[.]")))))
+ (if (and (< majorv 8)
+ (not (string-match-p "universal prefix argument" (documentation
'org-schedule))))
+ (read-char-exclusive
+ (format "Warning: org-drill requires org mode 7.9.3f or newer.
Scheduling of failed cards will not
+work correctly with older versions of org mode. Your org mode version (%s)
appears to be older than
+7.9.3f. Please consider installing a more recent version of org mode."
(org-release)))))
(let ((end-pos nil)
(overdue-data nil)
(cnt 0))
@@ -2712,24 +2722,36 @@ values as `org-drill-scope'."
(message "Done.")))
-
(defun org-drill-add-cloze-fontification ()
- (when (eql major-mode 'org-mode)
- ;; Compute local versions of the regexp for cloze deletions, in case
- ;; the left and right delimiters are redefined locally.
- (setq-local org-drill-cloze-regexp (org-drill--compute-cloze-regexp))
- (setq-local org-drill-cloze-keywords (org-drill--compute-cloze-keywords))
- (when org-drill-use-visible-cloze-face-p
- (font-lock-add-keywords nil ;'org-mode
- org-drill-cloze-keywords
- nil))))
+ ;; Compute local versions of the regexp for cloze deletions, in case
+ ;; the left and right delimiters are redefined locally.
+ (setq-local org-drill-cloze-regexp (org-drill--compute-cloze-regexp))
+ (setq-local org-drill-cloze-keywords (org-drill--compute-cloze-keywords))
+ (when org-drill-use-visible-cloze-face-p
+ (add-to-list 'org-font-lock-extra-keywords
+ (first org-drill-cloze-keywords))))
+
+(add-hook 'org-font-lock-set-keywords-hook 'org-drill-add-cloze-fontification)
;; Can't add to org-mode-hook, because local variables won't have been loaded
;; yet.
-(add-hook 'hack-local-variables-hook
- 'org-drill-add-cloze-fontification)
-(org-drill-add-cloze-fontification)
+;; (defun org-drill-add-cloze-fontification ()
+;; (when (eql major-mode 'org-mode)
+;; ;; Compute local versions of the regexp for cloze deletions, in case
+;; ;; the left and right delimiters are redefined locally.
+;; (setq-local org-drill-cloze-regexp (org-drill--compute-cloze-regexp))
+;; (setq-local org-drill-cloze-keywords
(org-drill--compute-cloze-keywords))
+;; (when org-drill-use-visible-cloze-face-p
+;; (font-lock-add-keywords nil ;'org-mode
+;; org-drill-cloze-keywords
+;; nil))))
+
+;; XXX
+;; (add-hook 'hack-local-variables-hook
+;; 'org-drill-add-cloze-fontification)
+;;
+;; (org-drill-add-cloze-fontification)
;;; Synching card collections =================================================
- [nongnu] elpa/org-drill 612848a840 068/251: Added tag 2.4.1 for changeset 97f51d64df45, (continued)
- [nongnu] elpa/org-drill 612848a840 068/251: Added tag 2.4.1 for changeset 97f51d64df45, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill d987e8d734 081/251: Added tag 2.5.0 for changeset 9b098bf2648d, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill ec7b5a0cf0 048/251: Added tag 2.3.4 for changeset e472512f0be7, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill d5c55b69f4 061/251: Any LaTeX math fragments in an item will now be rendered inline (if possible), ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill c71a218c68 074/251: Added tag 2.4.4 for changeset 0571437aa238, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill eb95d9415a 059/251: New global variable 'org-drill-match'. Now possible to specify a tags/property/, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill ce1a76c6c9 076/251: Added tag 2.4.5 for changeset 69dde321b38c, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 45237da768 046/251: Added tag 2.3.3 for changeset 1b0cc92cbb6a, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill bd452b9fe1 054/251: The string which separates a hint from the rest of the contents of a cloze is, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill b2f4874178 051/251: - Fixes to try and force display of images during drill sessions., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill f9b4c257af 067/251: Check that org version is >= 7.9.3f (the 'org-schedule' function in older,
ELPA Syncer <=
- [nongnu] elpa/org-drill e52080c97b 047/251: New option: org-drill-sm5-initial-interval. Allows users of SM5 algorithm to adjust the first, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 8618a532c7 049/251: - Improved progress bar while collecting due items. It is no longer able to overflow, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 88de357a6c 084/251: Undo previous version change to 2.5.0. The current version is 2.4.7., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 9ea35e11b6 006/251: Added implementation of SM2 algorithm., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 1daa7d6de5 009/251: Separate counts of pending new, old, and failed items are displayed in custom colours, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 2ba02542f8 015/251: Fixed bug causing items to sometimes appear multiple times during a single drill session., ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 2f92356145 016/251: Added tag 1.5 for changeset 42f3700bc748, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 34f0c03f9a 005/251: Added tag 1.0 for changeset a3f5efca0221, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 9ab44310d5 021/251: - New option: org-drill-hide-item-headings-p. If non-nil, item headings will be made, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 17c34adec5 028/251: - At the end of a drill session, when re-presenting items that were failed, ELPA Syncer, 2022/01/17