aboutsummaryrefslogtreecommitdiff
path: root/tests/test-prog-go-commands.el
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
commite2faf12aa20540587f28bc0db7b42c3540ad3bbe (patch)
treea23a8a9187481ab71d72d376dbeeedf78ef46149 /tests/test-prog-go-commands.el
parentac0bcf13189a49e0a2460c4e17b91504e9464adf (diff)
downloaddotemacs-e2faf12aa20540587f28bc0db7b42c3540ad3bbe.tar.gz
dotemacs-e2faf12aa20540587f28bc0db7b42c3540ad3bbe.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/test-prog-go-commands.el')
-rw-r--r--tests/test-prog-go-commands.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test-prog-go-commands.el b/tests/test-prog-go-commands.el
index 6947f358..a2fc0625 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)))