]> git.eshelyaron.com Git - emacs.git/commitdiff
Disable delay and ding in replace-tests
authorMattias Engdegård <mattiase@acm.org>
Sat, 24 Jul 2021 15:11:21 +0000 (17:11 +0200)
committerMattias Engdegård <mattiase@acm.org>
Sat, 24 Jul 2021 17:30:39 +0000 (19:30 +0200)
* test/lisp/replace-tests.el (replace-tests-with-undo):
When testing the "U" (undo all changes) option, the code will delay
and ding which is obnoxious in an automated test.
Disabling that makes the test quiet and about 150 times faster.

test/lisp/replace-tests.el

index 6d004e657d0476001628569f54a022391b6c35c3..417946c35fea39a1202b03080018ab37f67b58db 100644 (file)
@@ -465,7 +465,12 @@ Return the last evalled form in BODY."
                    ;; isearch-lazy-highlight-new-loop and sit-for (bug#36328)
                    ((symbol-function 'replace-highlight)
                     (lambda (&rest _args)
-                      (string-match "[A-Z ]" "ForestGreen"))))
+                      (string-match "[A-Z ]" "ForestGreen")))
+                   ;; Override `sit-for' and `ding' so that we don't have
+                   ;; to wait and listen to bells when running the test.
+                   ((symbol-function 'sit-for)
+                    (lambda (&rest _args) (redisplay)))
+                   ((symbol-function 'ding) 'ignore))
            (perform-replace ,from ,to t replace-tests-perform-replace-regexp-flag nil))
          ,@body))))