diff options
author | Leon Rische <leon.rische@me.com> | 2020-09-19 00:32:51 +0200 |
---|---|---|
committer | Leon Rische <leon.rische@me.com> | 2020-09-19 00:32:51 +0200 |
commit | 0c5a82084d6d0f353efd116800b519ac710f6a01 (patch) | |
tree | 2512f0a1c5144d494d19fd964a7d9b3fedb1428b | |
parent | 66e3707ca042353d19386e8977d05aa483200532 (diff) |
Don't write empty review history to file
-rw-r--r-- | org-fc.el | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) |