[org] Work in doom discourse feedback for my goPersonio export

This commit is contained in:
Sebastian Schulze 2022-11-16 22:49:45 +01:00
parent 868dfe17cb
commit 5442d327f6
No known key found for this signature in database
GPG Key ID: F6BA63C6A7D3044E
1 changed files with 11 additions and 4 deletions

View File

@ -281,21 +281,28 @@
;; Export current clock subtree to Personio
(defun bascht/org-clock-to-personio ()
(interactive)
(when (org-clock-is-active)
(org-clock-out))
(evil-window-left 0)
(persp-switch "@Org")
(find-file "/home/bascht/Documents/Zettelkasten/CustomerAlfaview.org")
(goto-char (org-find-exact-headline-in-buffer "Arbeitszeiten"))
(goto-char (org-find-exact-headline-in-buffer (format-time-string "%Y-%m")))
(search-forward ":LOGBOOK:")
(search-forward ":END:")
(while (not (s-equals? (s-trim (thing-at-point 'line t)) ":LOGBOOK:"))
(forward-line -1)
(while '(not (string-equal (s-trim (thing-at-point 'line t)) ":END:"))
(message "(while) at line [%s]" (s-trim (thing-at-point 'line t)))
(forward-line 1)
;; (sleep-for 0.2)
;; (message "Processing line [%s]: %s" (s-trim (thing-at-point 'line t)) (not (s-equals? (s-trim (thing-at-point 'line t)) ":LOGBOOK:")))
;; (sleep-for 0.2)
(let* ((line (s-trim (thing-at-point 'line t)))
(re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*"
org-clock-string
"[ \t]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=>[ \t]+\\([0-9]+\\):\\([0-9]+\\)\\)")))
(re-search-forward re)
;; (nonincremental-re-search-forward re)
(string-match re line)
;; (sleep-for 0.2)
(message "Matching %s in %s" line (match-string 0)))))
;; Temporary test-function to re-trigger the export and get the logs