diff options
| -rw-r--r-- | lisp/documents.el | 97 |
1 files changed, 50 insertions, 47 deletions
diff --git a/lisp/documents.el b/lisp/documents.el index 969225a..6341c98 100644 --- a/lisp/documents.el +++ b/lisp/documents.el @@ -95,14 +95,14 @@ ;; Global keybindings for my Org workflow. :bind - ("C-c a" . (lambda () (interactive) (org-agenda nil "d"))) + ("C-c a" . org-agenda) ("C-c c" . (lambda () (interactive) (org-capture nil "c"))) ("C-c t" . (lambda () (interactive) (org-capture nil "t"))) :init (setq org-todo-keywords - '((sequence "TODO(t)" "|" "DONE(d)") - (sequence "IN-PROGRESS(i)" "BLOCKED(b)" "DBE(r)" "|" "OBE(o)"))) + '((sequence "TODO(t)" "|" "DONE(d)") + (sequence "IN-PROGRESS(i)" "BLOCKED(b)" "DBE(r)" "|" "OBE(o)"))) ;; Use Counsel's functionality for adding tags. :bind @@ -281,53 +281,56 @@ Visits LINK, or if LINK names a subdirectory of (org-agenda-overriding-header "Needs Processing:")))) ((org-agenda-compact-blocks t) (org-agenda-overriding-columns-format "%TODO %EFFORT %ITEM %CATEGORY %TAGS")))))) - ;; 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))))) + ;; Track the date and time that tasks are marked as DONE. + (setq org-log-done 'time) - ;; Patch in an offset for tag alignment. (Without this, they will warp in a - ;; way which I do not like.) - :config/el-patch - (defun org-agenda-align-tags (&optional line) - "Align all tags in agenda items to `org-agenda-tags-column'. + ;; Functionality 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 + (el-patch-defun org-agenda-align-tags (&optional line) + "Align all tags in agenda items to `org-agenda-tags-column'. When optional argument LINE is non-nil, align tags only on the current line." - (let ((inhibit-read-only t) - (org-agenda-tags-column (if (eq 'auto org-agenda-tags-column) - (el-patch-swap (window-max-chars-per-line) (- 2 (window-max-chars-per-line))) - org-agenda-tags-column)) - (end (and line (line-end-position))) - l c) - (save-excursion - (goto-char (if line (line-beginning-position) (point-min))) - (while (re-search-forward org-tag-group-re end t) - (add-text-properties - (match-beginning 1) (match-end 1) - (list 'face (delq nil (let ((prop (get-text-property - (match-beginning 1) 'face))) - (or (listp prop) (setq prop (list prop))) - (if (memq 'org-tag prop) - prop - (cons 'org-tag prop)))))) - (setq l (string-width (match-string 1)) - c (if (< org-agenda-tags-column 0) - (- (abs org-agenda-tags-column) l) - org-agenda-tags-column)) - (goto-char (match-beginning 1)) - (delete-region (save-excursion (skip-chars-backward " \t") (point)) - (point)) - (insert (org-add-props - (make-string (max 1 (- c (current-column))) ?\s) - (plist-put (copy-sequence (text-properties-at (point))) - 'face nil)))) - (goto-char (point-min)) - (org-font-lock-add-tag-faces (point-max))))))) + (let ((inhibit-read-only t) + (org-agenda-tags-column (if (eq 'auto org-agenda-tags-column) + (el-patch-swap (window-max-chars-per-line) (- 2 (window-max-chars-per-line))) + org-agenda-tags-column)) + (end (and line (line-end-position))) + l c) + (save-excursion + (goto-char (if line (line-beginning-position) (point-min))) + (while (re-search-forward org-tag-group-re end t) + (add-text-properties + (match-beginning 1) (match-end 1) + (list 'face (delq nil (let ((prop (get-text-property + (match-beginning 1) 'face))) + (or (listp prop) (setq prop (list prop))) + (if (memq 'org-tag prop) + prop + (cons 'org-tag prop)))))) + (setq l (string-width (match-string 1)) + c (if (< org-agenda-tags-column 0) + (- (abs org-agenda-tags-column) l) + org-agenda-tags-column)) + (goto-char (match-beginning 1)) + (delete-region (save-excursion (skip-chars-backward " \t") (point)) + (point)) + (insert (org-add-props + (make-string (max 1 (- c (current-column))) ?\s) + (plist-put (copy-sequence (text-properties-at (point))) + 'face nil)))) + (goto-char (point-min)) + (org-font-lock-add-tag-faces (point-max)))))) (use-package org-drill ;; org-drill in upstream Org is unmaintained, and as described in [1], no |