From 56af936f82ea3261f50164412fe53b7e36f0d55f Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Sat, 24 Dec 2022 14:09:31 +0100 Subject: [PATCH] fix bba-clock-in and bba-clock-out Signed-off-by: Andreas Gerler --- bba-orgmode.org | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bba-orgmode.org b/bba-orgmode.org index 8aaa8228..e34d2afb 100644 --- a/bba-orgmode.org +++ b/bba-orgmode.org @@ -1576,7 +1576,9 @@ is not working in my configuration. (defun bba-clock-in () "Clock in of workhours." (interactive) - (find-file "~/org/workhours.org") + (if (get-buffer "workhours.org") + (pop-to-buffer "workhours.org") + (find-file "~/org/workhours.org")) (goto-char (point-min)) (if (re-search-forward (concat "^\*\* "(format-time-string "%Y-%m")) nil t) (progn (org-beginning-of-line) @@ -1592,7 +1594,9 @@ is not working in my configuration. (defun bba-clock-out () "Clock out of workhours." (interactive) - (find-file "~/org/workhours.org") + (if (get-buffer "workhours.org") + (pop-to-buffer "workhours.org") + (find-file "~/org/workhours.org")) (goto-char (point-min)) (if (re-search-forward (concat "^\*\* "(format-time-string "%Y-%m")) nil t) (progn (org-beginning-of-line) -- 2.47.3