]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
fix bba-clock-in and bba-clock-out
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Sat, 24 Dec 2022 13:09:31 +0000 (14:09 +0100)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Sat, 24 Dec 2022 13:09:31 +0000 (14:09 +0100)
Signed-off-by: Andreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
bba-orgmode.org

index 8aaa8228b5939e2d9c9f657c03c1fb5dc91b788f..e34d2afb32b1baaf11d80e1880a427169d1eec1d 100644 (file)
@@ -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)