automate creation timestamps for new org headings

This commit is contained in:
ndwarshuis 2018-11-27 23:56:48 -05:00
parent 3d8a8af723
commit 940eb7b6ea
1 changed files with 15 additions and 0 deletions

View File

@ -665,6 +665,11 @@ Enable shortcuts for embedding code in org text bodies.
(add-to-list 'org-structure-template-alist
'("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC"))
#+END_SRC
*** todo insertion
Make todo insertion respect contents
#+BEGIN_SRC emacs-lisp
(setq org-insert-heading-respect-content t)
#+END_SRC
*** interactive commands
Some useful additional commands for org buffers.
#+BEGIN_SRC emacs-lisp
@ -748,6 +753,15 @@ and reverts all todo keywords to TODO."
(setq newhead (org-get-heading)))
(org-agenda-change-all-lines newhead hdmarker)
(beginning-of-line 1))))
(defun nd/org-insert-todo-heading-inactive-timestamp ()
"Insert a todo heading but also insert inactive timestamp set to now."
(interactive)
(call-interactively 'org-insert-todo-heading)
(insert "\n")
(funcall-interactively 'org-time-stamp-inactive '(16))
(previous-line))
#+END_SRC
** column view
#+BEGIN_SRC emacs-lisp
@ -2963,6 +2977,7 @@ These are for mode-specific bindings that can/should be outside of the evil maps
#+BEGIN_SRC emacs-lisp
(add-hook 'org-mode-hook
(lambda ()
(local-set-key (kbd "M-S-<return>") 'nd/org-insert-todo-heading-inactive-timestamp)
(local-set-key (kbd "C-c C-x x") 'nd/mark-subtree-done)
(local-set-key (kbd "C-c C-x c") 'nd/org-clone-subtree-with-time-shift)))