[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/org-drill 502961433b 196/251: Remove savehist dependency
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/org-drill 502961433b 196/251: Remove savehist dependency |
Date: |
Mon, 17 Jan 2022 18:59:17 -0500 (EST) |
branch: elpa/org-drill
commit 502961433b28e8146c92ebbaa5a180f7f09e334d
Author: Phillip Lord <phillip.lord@russet.org.uk>
Commit: Phillip Lord <phillip.lord@russet.org.uk>
Remove savehist dependency
savehist involves switching on a minor mode which does not seem
optimal.
---
org-drill.el | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/org-drill.el b/org-drill.el
index 69a8f744e0..5f64d397eb 100644
--- a/org-drill.el
+++ b/org-drill.el
@@ -51,12 +51,11 @@
;;; Code:
-(require 'eieio)
(require 'cl-lib)
+(require 'eieio)
(require 'org)
(require 'org-agenda)
(require 'org-id)
-(require 'savehist)
(require 'seq)
(defgroup org-drill nil
@@ -437,16 +436,20 @@ algorithm. The matrix is saved at the end of each drill
session.
Over time, values in the matrix will adapt to the individual user's
pace of learning.")
+(defvar org-drill-persist-location
+ (concat user-emacs-directory "org-drill-sm5-optimal-factor-matrix"))
-(add-to-list 'savehist-additional-variables
- 'org-drill-sm5-optimal-factor-matrix)
-
-;; TODO This is used to save -- org-drill-sm5-optimal-factor-matrix
-;; but clearly saves everything else as well. We need a better
-;; solution here.
-(unless savehist-mode
- (savehist-mode 1))
+(when (file-exists-p org-drill-persist-location)
+ (with-temp-buffer
+ (insert-file-contents org-drill-persist-location)
+ (setq org-drill-sm5-optimal-factor-matrix
+ (read (current-buffer)))))
+(defun org-drill-persist ()
+ (with-temp-buffer
+ (print org-drill-sm5-optimal-factor-matrix (current-buffer))
+ (write-region (point-min) (point-max) org-drill-persist-location
+ nil 'quiet)))
(defun org-drill--transfer-optimal-factor-matrix ()
(if (and org-drill-optimal-factor-matrix
@@ -3068,10 +3071,8 @@ work correctly with older versions of org mode. Your org
mode version (%s) appea
(message nil)
))))
-
(defun org-drill-save-optimal-factor-matrix ()
- (savehist-autosave))
-
+ (org-drill-persist))
(defun org-drill-cram (&optional scope drill-match)
"Run an interactive drill session in 'cram mode'. In cram mode,
- [nongnu] elpa/org-drill 1801524221 178/251: Fix call to format, (continued)
- [nongnu] elpa/org-drill 1801524221 178/251: Fix call to format, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 2f056255e6 192/251: Re-namespace with-hidden-cloze-text, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 61807adc7f 166/251: Remove spell-number.el dependency, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 0eaacf2a2d 176/251: Remove legacy code, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 8ebb0d27d6 194/251: package-lint cleaning, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill c59c49a4df 172/251: Remove call to cl, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill c65634b454 195/251: Remove hi-lock dependency, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 5d4f60d49d 167/251: Silence more unused variable messages, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 3b0f44592f 186/251: Add compatibility hacks to support org-mode 8, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 2811c3f562 174/251: Replace dynamic scoping with let, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 502961433b 196/251: Remove savehist dependency,
ELPA Syncer <=
- [nongnu] elpa/org-drill 362c643163 182/251: Fix more compile error messages, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill dd55dbe699 187/251: Fix call to org-drill-entry-overdue-p, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill de11158c99 171/251: Replace more dynamic scoping, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill d6d940c9c5 170/251: Improve poll, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 8644cfd761 184/251: Fix more byte compile errors, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 56ddd56396 213/251: Update documentation, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 03551ffa3c 231/251: Show LaTex overlays after clearing them, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill 7adb9aab5a 207/251: Update documentation, ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill d2fe915d7a 236/251: Merge branch 'fix/latex-overlays' into 'master', ELPA Syncer, 2022/01/17
- [nongnu] elpa/org-drill de1e419ae3 215/251: All more README tests, ELPA Syncer, 2022/01/17