From 6df04751816f268124b3fab19ef5c9d2cd983002 Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Sun, 7 Nov 2021 10:22:54 -0800 Subject: [PATCH] ; Fix electric-tests * test/lisp/electric-tests.el (whitespace-chomping-dont-cross-comments): Move 'c-toggle-comment-style' to here. --- test/lisp/electric-tests.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el index 686641c1b3..1e32dbfb60 100644 --- a/test/lisp/electric-tests.el +++ b/test/lisp/electric-tests.el @@ -32,9 +32,6 @@ (require 'elec-pair) (require 'cl-lib) -;; When running tests in c-mode, use single-line comments (//). -(add-hook 'c-mode-hook (lambda () (c-toggle-comment-style -1))) - (defun call-with-saved-electric-modes (fn) (let ((saved-electric (if electric-pair-mode 1 -1)) (saved-layout (if electric-layout-mode 1 -1)) @@ -431,7 +428,9 @@ whitespace-chomping-dont-cross-comments :bindings '((electric-pair-skip-whitespace . chomp)) :test-in-strings nil :test-in-code nil - :test-in-comments t) + :test-in-comments t + :fixture-fn (lambda () (when (eq major-mode 'c-mode) + (c-toggle-comment-style -1)))) (define-electric-pair-test whitespace-skipping-for-quotes-not-outside " \" \"" "\"-----" :expected-string "\"\" \" \"" -- 2.25.1