Skip to content

Commit 6316cf5

Browse files
authored
Merge pull request #934 from rswgnu/rsw
- hsys-consult.el - Fix to properly extract version - hyrolo-move-to-entry-end - Fix movement over collapsed file hdrs
2 parents 39053a3 + bc7c76c commit 6316cf5

File tree

4 files changed

+54
-23
lines changed

4 files changed

+54
-23
lines changed

ChangeLog

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
1+
2026-04-08 Bob Weiner <rsw@gnu.org>
2+
3+
* test/hyrolo-tests.el (hyrolo-tests--fgrep-move-test): Move tests more
4+
likely to fail to the start and after these ensure full outline is
5+
shown and point goes to 'point-min'.
6+
7+
* hyrolo.el (hyrolo-move-to-entry-end): Fix movement over collapsed file
8+
headers by changing call of 'outline-next-heading' to
9+
'hyrolo-outline-next-visible-heading'.
10+
(hyrolo-hdr-move-after-p): Fix to fully move past hidden file
11+
headers.
12+
113
2026-04-08 Mats Lidell <matsl@gnu.org>
214

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

20+
2026-04-07 Bob Weiner <rsw@gnu.org>
21+
22+
* hsys-consult.el: Rewrite to properly extract version number from the
23+
consult.el file.
24+
825
2026-04-05 Bob Weiner <rsw@gnu.org>
926

1027
* hyrolo.el (hyrolo-hdr-to-first-line-p): Handle black lines and @loc> after

hsys-consult.el

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
;; Author: Bob Weiner
33
;;
44
;; Orig-Date: 4-Jul-24 at 09:57:18
5-
;; Last-Mod: 28-Feb-26 at 10:15:27 by Bob Weiner
5+
;; Last-Mod: 7-Apr-26 at 23:47:23 by Bob Weiner
66
;;
77
;; SPDX-License-Identifier: GPL-3.0-or-later
88
;;
@@ -120,7 +120,7 @@ Install `consult' package if not yet installed."
120120
(let ((consult-version (hsys-consult-get-version)))
121121
;; Multi-file support added after consult version "0.32"
122122
(when (not (and consult-version (string-greaterp consult-version "0.32")))
123-
(error "(hsys-consult-grep): consult package version is %s; update required"
123+
(error "(hsys-consult-grep): consult package version is %s; update required to 0.35 minimum"
124124
consult-version))))
125125

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

hyrolo.el

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Bob Weiner
44
;;
55
;; Orig-Date: 7-Jun-89 at 22:08:29
6-
;; Last-Mod: 5-Apr-26 at 02:34:12 by Bob Weiner
6+
;; Last-Mod: 8-Apr-26 at 23:12:04 by Bob Weiner
77
;;
88
;; SPDX-License-Identifier: GPL-3.0-or-later
99
;;
@@ -2053,10 +2053,16 @@ Return non-nil if point moves, else return nil."
20532053
(forward-line 1)))
20542054

20552055
(if (> (point) opoint)
2056-
(progn (while (looking-at-p "^[ \t]*$")
2056+
(progn (when (outline-invisible-p)
2057+
(setq opoint (point))
2058+
(goto-char (or (next-single-char-property-change (point) 'invisible)
2059+
(point)))
2060+
;; Have to move past end-of-line if have moved
2061+
(when (> (point) opoint)
2062+
(goto-char (1+ (point)))))
2063+
(while (looking-at-p "^[ \t]*$")
20572064
(forward-line 1))
2058-
(unless (outline-invisible-p)
2059-
result))
2065+
result)
20602066
(goto-char opoint)
20612067
nil)))
20622068

@@ -2888,7 +2894,9 @@ With optional INCLUDE-SUB-ENTRIES non-nil, move to the end of the
28882894
entire subtree. Return INCLUDE-SUB-ENTRIES flag value."
28892895
(if (not include-sub-entries)
28902896
;; Move to (point-max) if no next heading found and return nil
2891-
(outline-next-heading)
2897+
(if (derived-mode-p 'hyrolo-mode)
2898+
(hyrolo-outline-next-visible-heading 1)
2899+
(outline-next-heading))
28922900
;; When point is before the first entry in an Org file,
28932901
;; `outline-end-of-subtree' can signal an
28942902
;; `outline-before-first-heading' error within its subcall to

test/hyrolo-tests.el

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Mats Lidell <matsl@gnu.org>
44
;;
55
;; Orig-Date: 19-Jun-21 at 22:42:00
6-
;; Last-Mod: 5-Apr-26 at 02:24:43 by Bob Weiner
6+
;; Last-Mod: 8-Apr-26 at 23:14:30 by Bob Weiner
77
;;
88
;; SPDX-License-Identifier: GPL-3.0-or-later
99
;;
@@ -461,7 +461,6 @@ Match a string in the second cell."
461461

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

474+
(ert-info ("Hide first header and move down using ?n")
475+
(should (looking-at-p "==="))
476+
(execute-kbd-macro (kbd "h"))
477+
(execute-kbd-macro (kbd "n"))
478+
(should (looking-at-p "==="))
479+
(execute-kbd-macro (kbd "n"))
480+
(should (looking-at-p h1_str))
481+
(execute-kbd-macro (kbd "n"))
482+
(should (looking-at-p h1a_str))
483+
(execute-kbd-macro (kbd "n"))
484+
(should (eobp)))
485+
486+
(outline-show-all)
487+
(goto-char (point-min))
475488
(ert-info ("Move down using ?n")
476489
(should (looking-at-p "==="))
477490
(execute-kbd-macro (kbd "n"))
@@ -520,19 +533,7 @@ Match a string in the second cell."
520533
(execute-kbd-macro (kbd "b"))
521534
(should (looking-at-p "==="))
522535
(should-error (execute-kbd-macro (kbd "b")))
523-
(should (bobp)))
524-
525-
(ert-info ("Hide first header and move down using ?n")
526-
(should (looking-at-p "==="))
527-
(execute-kbd-macro (kbd "h"))
528-
(execute-kbd-macro (kbd "n"))
529-
(should (looking-at-p "==="))
530-
(execute-kbd-macro (kbd "n"))
531-
(should (looking-at-p h1_str))
532-
(execute-kbd-macro (kbd "n"))
533-
(should (looking-at-p h1a_str))
534-
(execute-kbd-macro (kbd "n"))
535-
(should (eobp))))
536+
(should (bobp))))
536537
;; Unwind forms
537538
(kill-buffer hyrolo-display-buffer)
538539
(hy-delete-files-and-buffers hyrolo-file-list))))

0 commit comments

Comments
 (0)