summaryrefslogtreecommitdiff
path: root/org-fc.el
diff options
context:
space:
mode:
authorLeon Rische <leon.rische@me.com>2020-09-19 00:32:51 +0200
committerLeon Rische <leon.rische@me.com>2020-09-19 00:32:51 +0200
commit0c5a82084d6d0f353efd116800b519ac710f6a01 (patch)
tree2512f0a1c5144d494d19fd964a7d9b3fedb1428b /org-fc.el
parent66e3707ca042353d19386e8977d05aa483200532 (diff)
Don't write empty review history to file
Diffstat (limited to 'org-fc.el')
-rw-r--r--org-fc.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/org-fc.el b/org-fc.el
index 44076db..b6f7a7e 100644
--- a/org-fc.el
+++ b/org-fc.el
@@ -1341,17 +1341,17 @@ EASE, BOX and INTERVAL are the current parameters of the card."
(defun org-fc-review-history-save ()
"Save all history entries in the current session."
- (when org-fc--session
+ (when (and org-fc--session (oref org-fc--session history))
(append-to-file
(concat
(mapconcat
(lambda (elements) (mapconcat #'identity elements "\t"))
- (reverse (slot-value org-fc--session 'history))
+ (reverse (oref org-fc--session history))
"\n")
"\n")
nil
org-fc-review-history-file)
- (setf (slot-value org-fc--session 'history) nil)))
+ (setf (oref org-fc--session history) nil)))
;; Make sure the history is saved even if Emacs is killed
(add-hook 'kill-emacs-hook #'org-fc-review-history-save)