]> git.eshelyaron.com Git - emacs.git/commitdiff
; * test/lisp/electric-tests.el: Reduce python-mode log spam.
authorMattias Engdegård <mattiase@acm.org>
Tue, 28 Sep 2021 15:00:11 +0000 (17:00 +0200)
committerMattias Engdegård <mattiase@acm.org>
Tue, 28 Sep 2021 15:01:09 +0000 (17:01 +0200)
test/lisp/electric-tests.el

index 4e7cbf5419b61939fc7ebb5e2d7ece3f3e3d9b6e..f59f9d9ccac6f93bd0c7122aa7171df7035886ca 100644 (file)
                                        expected-point mode bindings
                                        fixture-fn &optional doc-string)
   (with-temp-buffer
-    (funcall mode)
-    (insert fixture)
-    (save-electric-modes
-      (let ((last-command-event char)
-            (transient-mark-mode 'lambda))
-        (goto-char where)
-        (funcall fixture-fn)
-        (cl-progv
-            (mapcar #'car bindings)
-            (mapcar #'cdr bindings)
-          (call-interactively (key-binding `[,last-command-event])))))
+    (dlet ((python-indent-guess-indent-offset-verbose nil))
+      (funcall mode)
+      (insert fixture)
+      (save-electric-modes
+       (let ((last-command-event char)
+             (transient-mark-mode 'lambda))
+         (goto-char where)
+         (funcall fixture-fn)
+         (cl-progv
+             (mapcar #'car bindings)
+             (mapcar #'cdr bindings)
+           (call-interactively (key-binding `[,last-command-event]))))))
     (when
         (and doc-string
              (not
                       ;; FIXME: avoid `eval'
                       (mapcar #'car (eval bindings))
                       (mapcar #'cdr (eval bindings))
-                    (funcall mode)
-                    (insert fixture)
-                    (goto-char (1+ pos))
-                    (insert char)
-                    (cond ((eq (aref skip-pair-string pos)
-                               ?p)
-                           (insert (cadr (electric-pair-syntax-info char)))
-                           (backward-char 1))
-                          ((eq (aref skip-pair-string pos)
-                               ?s)
-                           (delete-char -1)
-                           (forward-char 1)))
-                    (list
-                     (buffer-substring-no-properties (point-min) (point-max))
-                     (point))))
+                    (dlet ((python-indent-guess-indent-offset-verbose nil))
+                      (funcall mode)
+                      (insert fixture)
+                      (goto-char (1+ pos))
+                      (insert char)
+                      (cond ((eq (aref skip-pair-string pos)
+                                 ?p)
+                             (insert (cadr (electric-pair-syntax-info char)))
+                             (backward-char 1))
+                            ((eq (aref skip-pair-string pos)
+                                 ?s)
+                             (delete-char -1)
+                             (forward-char 1)))
+                      (list
+                       (buffer-substring-no-properties (point-min) (point-max))
+                       (point)))))
               (list expected-string expected-point)))
            (expected-string (car expected-string-and-point))
            (expected-point (cadr expected-string-and-point))
@@ -191,11 +193,13 @@ The buffer's contents should %s:
          for (prefix suffix extra-desc) in
          (append (if test-in-comments
                      `((,(with-temp-buffer
-                           (funcall mode)
-                           (insert "z")
-                           (comment-region (point-min) (point-max))
-                           (buffer-substring-no-properties (point-min)
-                                                           (1- (point-max))))
+                           (dlet ((python-indent-guess-indent-offset-verbose
+                                   nil))
+                             (funcall mode)
+                             (insert "z")
+                             (comment-region (point-min) (point-max))
+                             (buffer-substring-no-properties (point-min)
+                                                             (1- (point-max)))))
                         ""
                         "-in-comments")))
                  (if test-in-strings