diff options
| author | Jakob L. Kreuze | 2022-06-16 20:40:51 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze | 2022-06-16 20:56:30 -0400 |
| commit | 57578ae5116aa2cce74f08ac4281a72b52e61d2d (patch) | |
| tree | b179ebedb9dc5881d6547ba5a4ec759639267105 | |
| parent | b42dbfcacb6c144593df2e28377523eeab9ba55c (diff) | |
[org] Add `log-todo-creation-date`
| -rw-r--r-- | lisp/documents.el | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lisp/documents.el b/lisp/documents.el index 4687ac3..e14aac7 100644 --- a/lisp/documents.el +++ b/lisp/documents.el @@ -90,7 +90,8 @@ :bind (:map org-mode-map ("C-c s" . org-goto) - ("C-c M-q" . auto-fill-mode)) + ("C-c M-q" . auto-fill-mode) + ("C-M-<return>" . log-todo-creation-date)) ;; Global keybindings for my Org workflow. :bind @@ -262,6 +263,16 @@ Visits LINK, or if LINK names a subdirectory of (org-agenda-skip-function ,subtree-is-habit) (org-agenda-overriding-header "Week Ahead:")))) ((org-agenda-compact-blocks t))))))) + ;; Finctionality to add a `CREATED' property -- I don't need something so + ;; intrusive that it inserts it for every heading. I can use my own + ;; discretion. + (defun log-todo-creation-date (&rest ignore) + "Log TODO creation time in the property drawer under the key 'CREATED'." + (interactive) + (when (and (org-get-todo-state) + (not (org-entry-get nil "CREATED"))) + (org-entry-put nil "CREATED" (format-time-string (cdr org-time-stamp-formats))))) + ;; Patch in an offset for tag alignment. (Without this, they will warp in a ;; way which I do not like.) :config/el-patch |