From 96a1bf2bef100e85e5c654f1e3c4fe57b636475e Mon Sep 17 00:00:00 2001 From: bw Date: Wed, 8 Apr 2026 22:19:56 -0400 Subject: [PATCH 1/3] hsys-consult.el - Fix to properly extract version number --- ChangeLog | 5 +++++ hsys-consult.el | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 33efc53c..0ec08dc6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ expected failed since there is a problem with moving over hidden sections. +2026-04-07 Bob Weiner + +* hsys-consult.el: Rewrite to properly extract version number from the + consult.el file. + 2026-04-05 Bob Weiner * hyrolo.el (hyrolo-hdr-to-first-line-p): Handle black lines and @loc> after diff --git a/hsys-consult.el b/hsys-consult.el index a94145fe..8b3a8c2c 100644 --- a/hsys-consult.el +++ b/hsys-consult.el @@ -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 ;; @@ -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 @@ -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)))))) From 14e69b30b3dd8f8affd15f1cea3876556a62b6bd Mon Sep 17 00:00:00 2001 From: bw Date: Wed, 8 Apr 2026 22:20:36 -0400 Subject: [PATCH 2/3] hyrolo-move-to-entry-end - Fix movement over collapsed file hdrs --- ChangeLog | 6 ++++++ hyrolo.el | 6 ++++-- test/hyrolo-tests.el | 3 +-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ec08dc6..8ea1953e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2026-04-08 Bob Weiner + +* 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'. + 2026-04-08 Mats Lidell * test/hyrolo-tests.el (hyrolo-tests--fgrep-move-test): Add test case diff --git a/hyrolo.el b/hyrolo.el index b7c8a96b..ef4942ab 100644 --- a/hyrolo.el +++ b/hyrolo.el @@ -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 22:42:40 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -2888,7 +2888,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 diff --git a/test/hyrolo-tests.el b/test/hyrolo-tests.el index 46ec8761..fe155e1a 100644 --- a/test/hyrolo-tests.el +++ b/test/hyrolo-tests.el @@ -3,7 +3,7 @@ ;; Author: Mats Lidell ;; ;; 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 22:42:43 by Bob Weiner ;; ;; SPDX-License-Identifier: GPL-3.0-or-later ;; @@ -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)) From 34117a9b6466b029e03d70ae57089bac0d7244d2 Mon Sep 17 00:00:00 2001 From: bw Date: Wed, 8 Apr 2026 22:20:36 -0400 Subject: [PATCH 3/3] hyrolo-move-to-entry-end - Fix movement over collapsed file hdrs --- ChangeLog | 12 ++++++++++++ hyrolo.el | 18 +++++++++++++----- test/hyrolo-tests.el | 31 ++++++++++++++++--------------- 3 files changed, 41 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ec08dc6..7a27cf08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2026-04-08 Bob Weiner + +* 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 * test/hyrolo-tests.el (hyrolo-tests--fgrep-move-test): Add test case diff --git a/hyrolo.el b/hyrolo.el index b7c8a96b..6dacdde1 100644 --- a/hyrolo.el +++ b/hyrolo.el @@ -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 ;; @@ -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))) @@ -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 diff --git a/test/hyrolo-tests.el b/test/hyrolo-tests.el index 46ec8761..8a684f2c 100644 --- a/test/hyrolo-tests.el +++ b/test/hyrolo-tests.el @@ -3,7 +3,7 @@ ;; Author: Mats Lidell ;; ;; 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 ;; @@ -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)) @@ -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")) @@ -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))))