From: Andreas Gerler Date: Wed, 15 Mar 2017 10:38:39 +0000 (+0100) Subject: workhours.org X-Git-Url: http://git.bundesbrandschatzamt.de/?a=commitdiff_plain;h=fbf6b15624ad91e8c8725829345511f89112a527;p=emacsconfig.git workhours.org - automate adding new headings if month is missing. Signed-off-by: Andreas Gerler --- diff --git a/bba.org b/bba.org index 298e1def..6389d2f1 100644 --- a/bba.org +++ b/bba.org @@ -3792,8 +3792,14 @@ Split and show workhours: (find-file "~/org/workhours.org") (beginning-of-buffer) (org-shifttab 3) - (re-search-forward (concat "^\*\* "(format-time-string "%Y-%m"))) - (org-beginning-of-line) + (if (re-search-forward (concat "^\*\* "(format-time-string "%Y-%m")) nil t) + (org-beginning-of-line) + (progn + (beginning-of-buffer) + (org-next-visible-heading '1) + (org-meta-return) + (insert (format-time-string "%Y-%m")) + )) )) #+END_SRC