]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
add calendar-insert-date
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Fri, 4 Oct 2019 13:28:43 +0000 (15:28 +0200)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Fri, 4 Oct 2019 13:28:43 +0000 (15:28 +0200)
bba.org

diff --git a/bba.org b/bba.org
index e52f1c076cb8d924b9f5ddd6de6284106921d72c..dba9e7bcc02538af6b04976b87aff4fef84e8775 100644 (file)
--- a/bba.org
+++ b/bba.org
@@ -277,6 +277,19 @@ Keep track of your important stuff!
     )
 #+END_SRC
 
+* calendar
+[2019-09-30 Mon 10:30]
+
+#+begin_src emacs-lisp :tangle yes
+  (defun calendar-insert-date ()
+    "Capture the date at point, exit the Calendar, insert the date."
+    (interactive)
+    (seq-let (month day year) (save-match-data (calendar-cursor-to-date))
+      (calendar-exit)
+      (insert (format "%d-%02d-%02d" year month day))))
+
+  (define-key calendar-mode-map (kbd "RET") 'calendar-insert-date)
+#+end_src
 * magit
 
 For annotated tags prepare message with commit messages since last tag.