diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2018-04-11 17:26:15 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2018-04-11 17:26:15 -0700 |
commit | 6c4148985cb88acf4b3b200b6bf26d71867e808c (patch) | |
tree | 35595bdc847c96f31064a4b362cf142dd9eabf3b | |
parent | dfd0ca952e3a947df363fbcb55a18e9b9d2299db (diff) |
redtick--save-history does nothing if redtick-history-file is nil
That means the user who doesn't want to save history can set/customise
redtick-history-file to nil and there will be no error when
redtick-after-rest-hook fires.
-rw-r--r-- | redtick.el | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -249,14 +249,15 @@ (defun redtick--save-history () "Adding current-pomodoro info to history file." - (let ((history (redtick--load redtick-history-file))) - (redtick--save redtick-history-file - (add-to-list 'history - (list redtick--pomodoro-started-at - redtick-work-interval - redtick-rest-interval - redtick--pomodoro-description) - t)))) + (when redtick-history-file + (let ((history (redtick--load redtick-history-file))) + (redtick--save redtick-history-file + (add-to-list 'history + (list redtick--pomodoro-started-at + redtick-work-interval + redtick-rest-interval + redtick--pomodoro-description) + t))))) (add-hook 'redtick-after-rest-hook #'redtick--save-history) |