diff options
author | Spencer Williams <spnw@plexwave.org> | 2025-03-26 17:39:06 -0400 |
---|---|---|
committer | Spencer Williams <spnw@plexwave.org> | 2025-03-26 17:39:06 -0400 |
commit | 65364b65f2172bd2189b34d741a56a7bdc28d17b (patch) | |
tree | 129e65ecb8631dd4443362e5a89efb63cf14afe7 | |
parent | c775b16b846af22caba7bcc29f19afe3e0a1a15c (diff) |
Fix incorrect titles due to buffer narrowing
-rw-r--r-- | seam-test.el | 12 | ||||
-rw-r--r-- | seam.el | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/seam-test.el b/seam-test.el index b192045..0b7df1c 100644 --- a/seam-test.el +++ b/seam-test.el @@ -131,6 +131,18 @@ (buffer-name note) (seam-get-title-from-buffer note))))) +(ert-deftest seam-test-get-title-from-buffer-narrowed () + (should + (equal + "foo" + (seam-test-with-notes () + ((foo "foo")) + (with-current-buffer foo + (seam-test-add-contents foo "* My headline") + (forward-line) + (org-narrow-to-subtree) + (seam-get-title-from-buffer)))))) + (ert-deftest seam-test-get-title-from-file () (seam-test-with-notes () ((note "Note")) (should @@ -151,6 +151,7 @@ naming. Must be a function taking two arguments: TITLE and TYPE." (with-current-buffer buffer (save-mark-and-excursion (save-restriction + (widen) (goto-char 1) (ignore-errors (re-search-forward (org-headline-re 1)) |