Skip to content

Commit 48f5e51

Browse files
committed
Merge branch 'master' into rsw
2 parents d7671d3 + 88429e3 commit 48f5e51

3 files changed

Lines changed: 49 additions & 6 deletions

File tree

ChangeLog

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535

3636
* hproperty.el (hproperty:length): Add and use in HyRolo.
3737

38+
2026-04-02 Mats Lidell <matsl@gnu.org>
39+
40+
* hsys-org.el (hsys-org-id-find-advice): Fix docstring has wrong usage
41+
of unescaped single quotes and make first line a sentence.
42+
3843
2026-03-31 Bob Weiner <rsw@gnu.org>
3944

4045
* hyrolo.el (hyrolo-outline-next-visible-heading): Optimize performance in
@@ -64,6 +69,14 @@
6469
(hyrolo-next-match): Speed up a bit with local vars and add in-line
6570
comments to explain logic.
6671

72+
2026-03-30 Mats Lidell <matsl@gnu.org>
73+
74+
* test/kotl-mode-tests.el (kotl-mode-split-cell): Use kotl-mode:kill-tree
75+
with new arg 0 for clearer reuse of test buffer.
76+
(kotl-mode--kill-tree-erase-buffer): Add test for arg 0 to erase buffer.
77+
(kotl-mode--kill-tree-first-and-only-tree): Add test for verifying
78+
removing one tree.
79+
6780
2026-03-29 Bob Weiner <rsw@gnu.org>
6881

6982
* man/hyperbole.texi (Testing): Update from 200 to 660 automated test cases.

hsys-org.el

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,11 @@ otherwise, just match to the single tag around point."
217217
(hsys-org-get-agenda-tags #'hywiki-tags-view))
218218

219219
(defun hsys-org-id-find-advice (&rest _)
220-
"If `org-roam' is loaded and has advised `org-id-find' with the function
221-
'org-roam-id-find' but Emacs does not have the `sqlite' module, then any
222-
call to `org-id-find' will fail. This :before advice function fixes this
223-
by removing the `org-roam' advice from `org-id-find'."
220+
"Remove the `org-roam' advice from `org-id-find' if present.
221+
If `org-roam' is loaded and has advised `org-id-find' with the function
222+
`org-roam-id-find' but Emacs does not have the `sqlite' module, then any
223+
call to `org-id-find' will fail. This :before advice function fixes this by
224+
removing the `org-roam' advice from `org-id-find'."
224225
(when (and (fboundp 'org-roam-id-find)
225226
(not (hypb:sqlite-p))
226227
(hypb:advised-p 'org-id-find 'org-roam-id-find))

test/kotl-mode-tests.el

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,35 @@
430430
(should (string= (kcell-view:idstamp) "03")))
431431
(hy-delete-file-and-buffer kotl-file))))
432432

433+
(ert-deftest kotl-mode--kill-tree-first-and-only-tree ()
434+
"Verify removing a one cell tree creates an initial empty first cell."
435+
(let ((kotl-file (make-temp-file "hypb" nil ".kotl")))
436+
(unwind-protect
437+
(with-current-buffer (find-file kotl-file)
438+
(insert "first")
439+
(kotl-mode:add-child 1 "second")
440+
(kotl-mode:beginning-of-buffer)
441+
(kotl-mode:kill-tree)
442+
(should (kotl-mode:first-cell-p))
443+
(should (string-empty-p (kcell-view:contents))))
444+
(hy-delete-file-and-buffer kotl-file))))
445+
446+
(ert-deftest kotl-mode--kill-tree-erase-buffer ()
447+
"Verify buffer is erased leaving just the initial empty first cell."
448+
(with-temp-buffer
449+
(kotl-mode)
450+
(kotl-mode:kill-tree 0)
451+
(kotl-mode:end-of-buffer)
452+
(should (kotl-mode:first-cell-p))
453+
(should (string-empty-p (kcell-view:contents)))
454+
455+
(dotimes (i 20)
456+
(kotl-mode:add-cell 1 "contents"))
457+
(kotl-mode:kill-tree 0)
458+
(kotl-mode:end-of-buffer)
459+
(should (kotl-mode:first-cell-p))
460+
(should (string-empty-p (kcell-view:contents)))))
461+
433462
(ert-deftest kotl-mode-split-cell ()
434463
"Kotl-mode split cell."
435464
:expected-result :failed
@@ -445,7 +474,7 @@
445474
(should (string= (kcell-view:label (point)) "1a"))
446475
(should (string= (kcell-view:idstamp) "02")))
447476
(ert-info ("Split after first line")
448-
(kotl-mode:kill-tree)
477+
(kotl-mode:kill-tree 0)
449478
(insert "first")
450479
(kotl-mode:newline 1)
451480
(insert "second")
@@ -454,7 +483,7 @@
454483
(kotl-mode:split-cell)
455484
(should (= (line-number-at-pos) 3)))
456485
(ert-info ("Split before second line")
457-
(kotl-mode:kill-tree)
486+
(kotl-mode:kill-tree 0)
458487
(insert "first")
459488
(kotl-mode:newline 1)
460489
(insert "second")

0 commit comments

Comments
 (0)