aboutsummaryrefslogtreecommitdiff
path: root/tests/test-prog-webdev-format.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-24 14:33:21 -0500
committerCraig Jennings <c@cjennings.net>2026-05-24 14:33:21 -0500
commita24d14bab5e07612dd2d3bf77021cbe1f9a9b253 (patch)
treee8165a89b214a7723ddaf432bc559cf2343b08ff /tests/test-prog-webdev-format.el
parente86298561140aafc3d522492521dc1cc45b859ec (diff)
downloaddotemacs-a24d14bab5e07612dd2d3bf77021cbe1f9a9b253.tar.gz
dotemacs-a24d14bab5e07612dd2d3bf77021cbe1f9a9b253.zip
fix(org-roam): guard move-branch-to-roam against data loss
cj/move-org-branch-to-roam cut the subtree from the source buffer before writing the new roam file, so a failure in the demote/format/write/db-sync steps left the subtree gone from the source and not persisted anywhere — a destructive operation with no rollback. Reordered so the node file is written and verified on disk before org-cut-subtree runs; a failed write now aborts with the source untouched. Added a no-clobber guard (refuse an existing target file) and a confirmation prompt for large subtrees (>= cj/move-org-branch-confirm-lines, 30) or buffers with unsaved changes. The source buffer is deliberately left modified and undoable rather than auto-saved, so the move stays reversible. New test drives the write-failure-preserves-source invariant via an unwritable roam dir; the existing creates-roam-file test gained the confirm mock.
Diffstat (limited to 'tests/test-prog-webdev-format.el')
0 files changed, 0 insertions, 0 deletions