Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
2026-04-08 Bob Weiner <rsw@gnu.org>

* test/hyrolo-tests.el (hyrolo-tests--fgrep-move-test): Move tests more
likely to fail to the start and after these ensure full outline is
shown and point goes to 'point-min'.

* hyrolo.el (hyrolo-move-to-entry-end): Fix movement over collapsed file
headers by changing call of 'outline-next-heading' to
'hyrolo-outline-next-visible-heading'.
(hyrolo-hdr-move-after-p): Fix to fully move past hidden file
headers.

2026-04-08 Mats Lidell <matsl@gnu.org>

* test/hyrolo-tests.el (hyrolo-tests--fgrep-move-test): Add test case
for moving in *HyRolo* buffer after fgrep search. Test is set as
expected failed since there is a problem with moving over hidden
sections.

2026-04-07 Bob Weiner <rsw@gnu.org>

* hsys-consult.el: Rewrite to properly extract version number from the
consult.el file.

2026-04-05 Bob Weiner <rsw@gnu.org>

* hyrolo.el (hyrolo-hdr-to-first-line-p): Handle black lines and @loc> after
Expand Down
11 changes: 8 additions & 3 deletions hsys-consult.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 4-Jul-24 at 09:57:18
;; Last-Mod: 28-Feb-26 at 10:15:27 by Bob Weiner
;; Last-Mod: 7-Apr-26 at 23:47:23 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -120,7 +120,7 @@ Install `consult' package if not yet installed."
(let ((consult-version (hsys-consult-get-version)))
;; Multi-file support added after consult version "0.32"
(when (not (and consult-version (string-greaterp consult-version "0.32")))
(error "(hsys-consult-grep): consult package version is %s; update required"
(error "(hsys-consult-grep): consult package version is %s; update required to 0.35 minimum"
consult-version))))

;;;###autoload
Expand All @@ -131,7 +131,12 @@ Install `consult' package if not yet installed."
(buffer-modified (when buffer-existed (buffer-modified-p buffer-existed)))
(buf (or buffer-existed (find-file-noselect consult-file))))
(with-current-buffer buf
(prog1 (package-get-version)
(prog1 (save-excursion
(widen)
(goto-char (point-min))
(if (re-search-forward "Version:[ \t]+\\([.0-9]+\\)" nil t)
(match-string-no-properties 1)
""))
(unless buffer-modified
(kill-buffer buf))))))

Expand Down
18 changes: 13 additions & 5 deletions hyrolo.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 7-Jun-89 at 22:08:29
;; Last-Mod: 5-Apr-26 at 02:34:12 by Bob Weiner
;; Last-Mod: 8-Apr-26 at 23:12:04 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -2053,10 +2053,16 @@ Return non-nil if point moves, else return nil."
(forward-line 1)))

(if (> (point) opoint)
(progn (while (looking-at-p "^[ \t]*$")
(progn (when (outline-invisible-p)
(setq opoint (point))
(goto-char (or (next-single-char-property-change (point) 'invisible)
(point)))
;; Have to move past end-of-line if have moved
(when (> (point) opoint)
(goto-char (1+ (point)))))
(while (looking-at-p "^[ \t]*$")
(forward-line 1))
(unless (outline-invisible-p)
result))
result)
(goto-char opoint)
nil)))

Expand Down Expand Up @@ -2888,7 +2894,9 @@ With optional INCLUDE-SUB-ENTRIES non-nil, move to the end of the
entire subtree. Return INCLUDE-SUB-ENTRIES flag value."
(if (not include-sub-entries)
;; Move to (point-max) if no next heading found and return nil
(outline-next-heading)
(if (derived-mode-p 'hyrolo-mode)
(hyrolo-outline-next-visible-heading 1)
(outline-next-heading))
;; When point is before the first entry in an Org file,
;; `outline-end-of-subtree' can signal an
;; `outline-before-first-heading' error within its subcall to
Expand Down
31 changes: 16 additions & 15 deletions test/hyrolo-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Mats Lidell <matsl@gnu.org>
;;
;; Orig-Date: 19-Jun-21 at 22:42:00
;; Last-Mod: 5-Apr-26 at 02:24:43 by Bob Weiner
;; Last-Mod: 8-Apr-26 at 23:14:30 by Bob Weiner
;;
;; SPDX-License-Identifier: GPL-3.0-or-later
;;
Expand Down Expand Up @@ -461,7 +461,6 @@ Match a string in the second cell."

(ert-deftest hyrolo-tests--fgrep-move-test ()
"Verify different move commands after `hyrolo-fgrep'."
:expected-result :failed
(let* ((kotl-file1 (hyrolo-tests--gen-kotl-outline "heading" "foo bar" 1))
(kotl-file2 (hyrolo-tests--gen-kotl-outline "heading" "foo bar" 1))
(hyrolo-file-list (list kotl-file1 kotl-file2))
Expand All @@ -472,6 +471,20 @@ Match a string in the second cell."
(hyrolo-fgrep "bar")
(should (string= hyrolo-display-buffer (buffer-name)))

(ert-info ("Hide first header and move down using ?n")
(should (looking-at-p "==="))
(execute-kbd-macro (kbd "h"))
(execute-kbd-macro (kbd "n"))
(should (looking-at-p "==="))
(execute-kbd-macro (kbd "n"))
(should (looking-at-p h1_str))
(execute-kbd-macro (kbd "n"))
(should (looking-at-p h1a_str))
(execute-kbd-macro (kbd "n"))
(should (eobp)))

(outline-show-all)
(goto-char (point-min))
(ert-info ("Move down using ?n")
(should (looking-at-p "==="))
(execute-kbd-macro (kbd "n"))
Expand Down Expand Up @@ -520,19 +533,7 @@ Match a string in the second cell."
(execute-kbd-macro (kbd "b"))
(should (looking-at-p "==="))
(should-error (execute-kbd-macro (kbd "b")))
(should (bobp)))

(ert-info ("Hide first header and move down using ?n")
(should (looking-at-p "==="))
(execute-kbd-macro (kbd "h"))
(execute-kbd-macro (kbd "n"))
(should (looking-at-p "==="))
(execute-kbd-macro (kbd "n"))
(should (looking-at-p h1_str))
(execute-kbd-macro (kbd "n"))
(should (looking-at-p h1a_str))
(execute-kbd-macro (kbd "n"))
(should (eobp))))
(should (bobp))))
;; Unwind forms
(kill-buffer hyrolo-display-buffer)
(hy-delete-files-and-buffers hyrolo-file-list))))
Expand Down