aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-13 11:06:49 -0500
committerCraig Jennings <c@cjennings.net>2026-06-13 11:06:49 -0500
commitb62af09673bf3c4190305b745992e25145afafa8 (patch)
treedbd331010b6150aad8187e6bfb319ca0f8701a70
parent23b8166c230f366bf780c1aad76e5896b525fa69 (diff)
downloaddotemacs-b62af09673bf3c4190305b745992e25145afafa8.tar.gz
dotemacs-b62af09673bf3c4190305b745992e25145afafa8.zip
fix: vertico-repeat C-s and dotted-repo discovery (audit bugs)
Two bugs from the 2026-06 config audit. - C-s C-s never repeated a search. cj/consult-line-or-repeat calls vertico-repeat on the second press, but vertico-repeat-save was never on minibuffer-setup-hook, so it always signalled "No Vertico session". I hooked vertico-repeat-save next to the vertico block. It's autoloaded, so the load defers to the first minibuffer. - reconcile-open-repos skipped any repo with a dot in its name. cj/find-git-repos filtered children through "^[^.]+$", which matches only dot-free names, so mcp.el, capture.el, and google-contacts.el were never reconciled while M-P still reported "Complete". It now filters through directory-files-no-dot-files-regexp plus a hidden-dir guard, so dotted repos pass and .git stays out. Each fix is test-first: a failing assertion (hook membership, three dotted repos found) precedes the change.
-rw-r--r--modules/reconcile-open-repos.el5
-rw-r--r--modules/selection-framework.el5
-rw-r--r--tests/test-reconcile--find-git-repos.el9
-rw-r--r--tests/test-selection-framework--consult-line-or-repeat.el6
4 files changed, 24 insertions, 1 deletions
diff --git a/modules/reconcile-open-repos.el b/modules/reconcile-open-repos.el
index dd82ef0f3..79a895bf9 100644
--- a/modules/reconcile-open-repos.el
+++ b/modules/reconcile-open-repos.el
@@ -171,8 +171,11 @@ Prunes generated/heavy directories. Once a repository root is found, do not
descend into it unless INCLUDE-NESTED is non-nil."
(let (repos)
(when (file-directory-p directory)
- (dolist (child (directory-files directory t "^[^.]+$" 'nosort))
+ (dolist (child (directory-files directory t directory-files-no-dot-files-regexp 'nosort))
(when (and (file-directory-p child)
+ ;; Skip hidden dirs (.git, .config) but keep dotted repo
+ ;; names like mcp.el; the old "^[^.]+$" filter dropped both.
+ (not (string-prefix-p "." (file-name-nondirectory child)))
(not (cj/reconcile--pruned-directory-p child)))
(if (file-directory-p (expand-file-name ".git" child))
(progn
diff --git a/modules/selection-framework.el b/modules/selection-framework.el
index 116873374..1f5d6dfc5 100644
--- a/modules/selection-framework.el
+++ b/modules/selection-framework.el
@@ -47,6 +47,11 @@
:init
(vertico-mode))
+;; Save each completion session so `vertico-repeat' (the second C-s in
+;; `cj/consult-line-or-repeat') has a session to resume. `vertico-repeat-save'
+;; is autoloaded, so this defers loading vertico-repeat until the first minibuffer.
+(add-hook 'minibuffer-setup-hook #'vertico-repeat-save)
+
(use-package marginalia
:demand t
:custom
diff --git a/tests/test-reconcile--find-git-repos.el b/tests/test-reconcile--find-git-repos.el
index e065fca90..c6a190a17 100644
--- a/tests/test-reconcile--find-git-repos.el
+++ b/tests/test-reconcile--find-git-repos.el
@@ -81,6 +81,15 @@
(should (= (length repos) 1))
(should (string-suffix-p "visible-repo" (car repos))))))
+(ert-deftest test-find-git-repos-boundary-dotted-repo-name-found ()
+ "Boundary: a repo whose directory name contains a dot (e.g. mcp.el) is
+discovered. Regression for the `^[^.]+$' filter that matched only dot-free
+names and silently skipped dotted repos like mcp.el / capture.el."
+ (reconcile-test-with-temp-dirs
+ ("mcp.el/.git/" "capture.el/.git/" "plain-repo/.git/")
+ (let ((repos (cj/find-git-repos test-root)))
+ (should (= (length repos) 3)))))
+
(ert-deftest test-find-git-repos-boundary-prunes-heavy-directories ()
"Skips generated/heavy directories while discovering repos."
(reconcile-test-with-temp-dirs
diff --git a/tests/test-selection-framework--consult-line-or-repeat.el b/tests/test-selection-framework--consult-line-or-repeat.el
index fcaddcfd0..66f5b1724 100644
--- a/tests/test-selection-framework--consult-line-or-repeat.el
+++ b/tests/test-selection-framework--consult-line-or-repeat.el
@@ -64,5 +64,11 @@
"Normal: `cj/consult-line-or-repeat' is an interactive command."
(should (commandp #'cj/consult-line-or-repeat)))
+(ert-deftest test-selection-framework-vertico-repeat-save-on-minibuffer-setup ()
+ "Normal: loading the module registers `vertico-repeat-save' on
+`minibuffer-setup-hook'. Without it `vertico-repeat' has no saved session
+and the second C-s signals \"No Vertico session\"."
+ (should (memq 'vertico-repeat-save minibuffer-setup-hook)))
+
(provide 'test-selection-framework--consult-line-or-repeat)
;;; test-selection-framework--consult-line-or-repeat.el ends here