From 4e6243b3e32b6ad65e519eb0320b98aab4be3d32 Mon Sep 17 00:00:00 2001 From: contrapunctus Date: Sat, 4 Sep 2021 14:14:47 +0530 Subject: [PATCH] Update call sites for create-file --- elisp/chronometrist.el | 10 +++------- elisp/chronometrist.org | 12 +++--------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/elisp/chronometrist.el b/elisp/chronometrist.el index f5224f4..5f22bab 100644 --- a/elisp/chronometrist.el +++ b/elisp/chronometrist.el @@ -1096,10 +1096,6 @@ button action." (interactive) (chronometrist-sexp-open-log)) -(defun chronometrist-common-create-file () - "Create `chronometrist-file' if it doesn't already exist." - (chronometrist-sexp-create-file)) - (defun chronometrist-task-active-p (task) "Return t if TASK is currently clocked in, else nil." (equal (chronometrist-current-task (chronometrist-active-backend)) task)) @@ -1523,7 +1519,7 @@ run `chronometrist-statistics'." (cond ((or (not (file-exists-p chronometrist-file)) (chronometrist-common-file-empty-p chronometrist-file)) ;; first run - (chronometrist-common-create-file) + (chronometrist-create-file (chronometrist-active-backend)) (let ((inhibit-read-only t)) (erase-buffer) (insert "Welcome to Chronometrist! Hit RET to ") @@ -1734,7 +1730,7 @@ current week. Otherwise, display data from the week specified by (kill-buffer buffer)) (t (unless keep-date (setq chronometrist-report--ui-date nil)) - (chronometrist-common-create-file) + (chronometrist-create-file (chronometrist-active-backend)) (chronometrist-report-mode) (switch-to-buffer buffer) (chronometrist-report-refresh-file nil) @@ -1965,7 +1961,7 @@ specified by `chronometrist-statistics--ui-state'." (setq chronometrist-statistics--ui-state `(:mode week :start ,week-start :end ,week-end))) - (chronometrist-common-create-file) + (chronometrist-create-file (chronometrist-active-backend)) (chronometrist-statistics-mode) (switch-to-buffer buffer) (chronometrist-statistics-refresh)))))) diff --git a/elisp/chronometrist.org b/elisp/chronometrist.org index 45bf801..e5eca01 100644 --- a/elisp/chronometrist.org +++ b/elisp/chronometrist.org @@ -2161,12 +2161,6 @@ button action." (interactive) (chronometrist-sexp-open-log)) #+END_SRC -**** create-file :procedure: -#+BEGIN_SRC emacs-lisp -(defun chronometrist-common-create-file () - "Create `chronometrist-file' if it doesn't already exist." - (chronometrist-sexp-create-file)) -#+END_SRC **** task-active-p :reader: #+BEGIN_SRC emacs-lisp (defun chronometrist-task-active-p (task) @@ -2665,7 +2659,7 @@ run `chronometrist-statistics'." (cond ((or (not (file-exists-p chronometrist-file)) (chronometrist-common-file-empty-p chronometrist-file)) ;; first run - (chronometrist-common-create-file) + (chronometrist-create-file (chronometrist-active-backend)) (let ((inhibit-read-only t)) (erase-buffer) (insert "Welcome to Chronometrist! Hit RET to ") @@ -2911,7 +2905,7 @@ current week. Otherwise, display data from the week specified by (kill-buffer buffer)) (t (unless keep-date (setq chronometrist-report--ui-date nil)) - (chronometrist-common-create-file) + (chronometrist-create-file (chronometrist-active-backend)) (chronometrist-report-mode) (switch-to-buffer buffer) (chronometrist-report-refresh-file nil) @@ -3175,7 +3169,7 @@ specified by `chronometrist-statistics--ui-state'." (setq chronometrist-statistics--ui-state `(:mode week :start ,week-start :end ,week-end))) - (chronometrist-common-create-file) + (chronometrist-create-file (chronometrist-active-backend)) (chronometrist-statistics-mode) (switch-to-buffer buffer) (chronometrist-statistics-refresh))))))