commit 037a20d6a621fc24576dbb4fb460b4b6cbcbc846 parent b28940a44e41923836fe771ba9845a3e4cdf97e7 Author: Spencer Williams <spnw@plexwave.org> Date: Fri, 11 Jul 2025 16:45:34 -0400 Fix creating note via link open never makes draft Diffstat:
| M | lisp/seam-test.el | | | 19 | +++++++++++++++++++ |
| M | lisp/seam.el | | | 2 | +- |
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/lisp/seam-test.el b/lisp/seam-test.el @@ -506,6 +506,25 @@ it." (seam-test-list-files)) (kill-buffer))))))) +(ert-deftest seam-test-follow-link-new-draft () + "Test that following a link to an nonexistent draft note creates +and opens that note." + (should + (equal + '("-bar" ("private/-bar.org" "private/foo.org")) + (seam-test-with-notes () + ((foo "foo")) + (with-current-buffer foo + (seam-test-add-contents foo "[[seam:-bar]]") + (goto-char 1) + (org-next-link) + (org-open-at-point) + (unwind-protect + (list + (buffer-name) + (seam-test-list-files)) + (kill-buffer))))))) + (ert-deftest seam-test-escape-title () (should (equal diff --git a/lisp/seam.el b/lisp/seam.el @@ -115,7 +115,7 @@ naming. Must be a function taking two arguments: TITLE and TYPE." (org-mark-ring-push) (if-let ((file (seam-lookup-slug path))) (find-file file) - (seam-create-note path nil t)) + (seam-create-note path nil t (seam-draft-p path))) (seam-set-buffer-name)) (defvar seam-note-file-regexp "\\`[^.].+\\.org\\'")