Skip to content

Fix logdone by writing CLOSED timestamps on TODO completion - #1124

Open
chadhs wants to merge 2 commits into
200ok-ch:masterfrom
chadhs:fix/980-logdone-closed-timestamp
Open

Fix logdone by writing CLOSED timestamps on TODO completion#1124
chadhs wants to merge 2 commits into
200ok-ch:masterfrom
chadhs:fix/980-logdone-closed-timestamp

Conversation

@chadhs

@chadhs chadhs commented Aug 11, 2026

Copy link
Copy Markdown

Summary

  • Honor #+STARTUP: logdone / :LOGGING: logdone when completing TODOs by writing a CLOSED: planning timestamp (and remove it when leaving a done state)
  • Fixes Closing TODOs does not log as per logdone #980 by matching Emacs org-log-done / time behavior for non-repeating tasks
  • Document the new in-buffer options in README.org

Verification

Reproduced the reporter's exact fixture from #980:

#+STARTUP: logdone
* TODO clean up here in prep for going to alno

After advancing TODO → DONE, export contains:

* DONE clean up here in prep for going to alno
  CLOSED: [2024-04-17 Wed 15:03]

Unit tests cover STARTUP/property detection, CLOSED add/remove, SCHEDULED preservation, and the no-logdone default.

Test plan

  • yarn test --testPathPattern='(org\.unit\.test|OrgFile\.unit\.test)'
  • Reproduce Closing TODOs does not log as per logdone #980 fixture and confirm CLOSED: is written on completion
  • Manually toggle TODO → DONE in the UI with #+STARTUP: logdone
  • Confirm nologdone and missing logdone do not write CLOSED:
  • Confirm un-completing a DONE header removes CLOSED:
chadhs added 2 commits August 10, 2026 23:39
Honor #+STARTUP: logdone and :LOGGING: logdone so completing a TODO
adds a CLOSED planning timestamp, matching Emacs org-log-done behavior.
@chadhs
chadhs marked this pull request as ready for review August 11, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant