aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-15 21:34:09 -0500
committerCraig Jennings <c@cjennings.net>2026-06-15 21:34:09 -0500
commit902290a4c15d905418e1ad354e7ee06cfa35b3f1 (patch)
tree0747e21e2a8307709ea26b44cee1623b03cd35bd /tests
parent7d58ccfb5baad7ab6e3069f9cb4e181482438357 (diff)
downloaddotemacs-902290a4c15d905418e1ad354e7ee06cfa35b3f1.tar.gz
dotemacs-902290a4c15d905418e1ad354e7ee06cfa35b3f1.zip
fix(prog): keep electric-pair and line-number setup buffer-local
- Go/C/shell setup hooks called the global electric-pair-mode, so one prog buffer turned pairing on in org and text everywhere. Use electric-pair-local-mode. - prog-general set display-line-numbers-type inside the hook, after the mode turned on, so the first prog buffer of a session got absolute numbers. Set the type and width at top level instead. - Updated the go/c tests to stub the local mode.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-prog-c-mode-settings.el6
-rw-r--r--tests/test-prog-go-commands.el10
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/test-prog-c-mode-settings.el b/tests/test-prog-c-mode-settings.el
index eef2d9102..37a77a213 100644
--- a/tests/test-prog-c-mode-settings.el
+++ b/tests/test-prog-c-mode-settings.el
@@ -16,7 +16,7 @@
"Normal: cj/c-mode-settings applies the documented buffer-local values."
(with-temp-buffer
(cl-letf (((symbol-function 'auto-fill-mode) (lambda (&rest _) nil))
- ((symbol-function 'electric-pair-mode) (lambda (&rest _) nil))
+ ((symbol-function 'electric-pair-local-mode) (lambda (&rest _) nil))
((symbol-function 'lsp-deferred) (lambda (&rest _) nil))
((symbol-function 'executable-find) (lambda (_) nil)))
(cj/c-mode-settings))
@@ -31,7 +31,7 @@
(let ((lsp-calls 0))
(with-temp-buffer
(cl-letf (((symbol-function 'auto-fill-mode) (lambda (&rest _) nil))
- ((symbol-function 'electric-pair-mode) (lambda (&rest _) nil))
+ ((symbol-function 'electric-pair-local-mode) (lambda (&rest _) nil))
((symbol-function 'lsp-deferred) (lambda () (cl-incf lsp-calls)))
((symbol-function 'executable-find) (lambda (_) "/usr/bin/clangd")))
(cj/c-mode-settings)))
@@ -42,7 +42,7 @@
(let ((lsp-calls 0))
(with-temp-buffer
(cl-letf (((symbol-function 'auto-fill-mode) (lambda (&rest _) nil))
- ((symbol-function 'electric-pair-mode) (lambda (&rest _) nil))
+ ((symbol-function 'electric-pair-local-mode) (lambda (&rest _) nil))
((symbol-function 'lsp-deferred) (lambda () (cl-incf lsp-calls)))
((symbol-function 'executable-find) (lambda (_) nil)))
(cj/c-mode-settings)))
diff --git a/tests/test-prog-go-commands.el b/tests/test-prog-go-commands.el
index 6947f358b..a2fc0625f 100644
--- a/tests/test-prog-go-commands.el
+++ b/tests/test-prog-go-commands.el
@@ -27,19 +27,19 @@
"Normal: tab-width 4, standard-indent 4, indent-tabs-mode t (Go convention)."
(with-temp-buffer
(cl-letf (((symbol-function 'company-mode) #'ignore)
- ((symbol-function 'electric-pair-mode) #'ignore))
+ ((symbol-function 'electric-pair-local-mode) #'ignore))
(cj/go-setup)
(should (= tab-width 4))
(should (= standard-indent 4))
(should indent-tabs-mode))))
(ert-deftest test-prog-go-setup-enables-mode-helpers ()
- "Normal: company-mode and electric-pair-mode are both called."
+ "Normal: company-mode and electric-pair-local-mode are both called."
(with-temp-buffer
(let ((called nil))
(cl-letf (((symbol-function 'company-mode)
(lambda (&rest _) (push 'company called)))
- ((symbol-function 'electric-pair-mode)
+ ((symbol-function 'electric-pair-local-mode)
(lambda (arg) (push (cons 'pair arg) called))))
(cj/go-setup))
(should (memq 'company called))
@@ -50,7 +50,7 @@
(with-temp-buffer
(let ((started nil))
(cl-letf (((symbol-function 'company-mode) #'ignore)
- ((symbol-function 'electric-pair-mode) #'ignore)
+ ((symbol-function 'electric-pair-local-mode) #'ignore)
((symbol-function 'lsp-deferred)
(lambda (&rest _) (setq started t)))
((symbol-function 'executable-find)
@@ -63,7 +63,7 @@
(with-temp-buffer
(let ((started nil))
(cl-letf (((symbol-function 'company-mode) #'ignore)
- ((symbol-function 'electric-pair-mode) #'ignore)
+ ((symbol-function 'electric-pair-local-mode) #'ignore)
((symbol-function 'lsp-deferred)
(lambda (&rest _) (setq started t)))
((symbol-function 'executable-find) (lambda (_) nil)))