diff options
| -rw-r--r-- | modules/org-config.el | 2 | ||||
| -rw-r--r-- | modules/org-roam-config.el | 2 | ||||
| -rw-r--r-- | tests/test-org-config-org-log-done.el | 25 |
3 files changed, 27 insertions, 2 deletions
diff --git a/modules/org-config.el b/modules/org-config.el index 31ed7f6c..bd51828a 100644 --- a/modules/org-config.el +++ b/modules/org-config.el @@ -117,7 +117,7 @@ (setq org-deadline-warning-days 7) ;; warn me w/in a week of deadlines (setq org-treat-insert-todo-heading-as-state-change nil) ;; log task creation (setq org-log-into-drawer nil) ;; don't log into drawer - (setq org-log-done nil) ;; don't log completions + (setq org-log-done 'time) ;; record a CLOSED timestamp on TODO->DONE ;; inherit parents properties (sadly not schedules or deadlines) (setq org-use-property-inheritance t)) diff --git a/modules/org-roam-config.el b/modules/org-roam-config.el index 0382976b..da4b0657 100644 --- a/modules/org-roam-config.el +++ b/modules/org-roam-config.el @@ -61,7 +61,7 @@ :map org-mode-map ("C-M-i" . completion-at-point)) :config - (setq org-log-done 'time) + ;; org-log-done is set once in org-config.el (cj/org-todo-settings). (setq org-agenda-timegrid-use-ampm t) (when (fboundp 'cj/build-org-refile-targets) diff --git a/tests/test-org-config-org-log-done.el b/tests/test-org-config-org-log-done.el new file mode 100644 index 00000000..2eedef2a --- /dev/null +++ b/tests/test-org-config-org-log-done.el @@ -0,0 +1,25 @@ +;;; test-org-config-org-log-done.el --- Lock org-log-done to one home -*- lexical-binding: t; -*- + +;;; Commentary: +;; `org-log-done' had two setters: `cj/org-todo-settings' in org-config.el set +;; it nil and org-roam-config.el set it to 'time, so the effective value was +;; load-order-dependent. `cj/org-todo-settings' is now the single home and +;; sets 'time, which records a CLOSED timestamp on TODO->DONE — the behavior +;; the dated-completion workflow depends on. This test calls the settings +;; function in isolation (no org-roam-config required) so it would fail if the +;; nil value or the org-roam duplicate ever came back. + +;;; Code: + +(require 'ert) +(require 'org) ;; declares org-log-done special so the let below is dynamic +(require 'org-config) + +(ert-deftest test-org-config-org-log-done-set-to-time () + "Normal: cj/org-todo-settings sets org-log-done to 'time." + (let ((org-log-done nil)) + (cj/org-todo-settings) + (should (eq org-log-done 'time)))) + +(provide 'test-org-config-org-log-done) +;;; test-org-config-org-log-done.el ends here |
