Subject: bug#36565: [PATCH] Suppress interactive-only warnings in undo-tests.el

From: Stefan Kangas <[email-masked]>
Date: Sun, 4 Aug 2019 18:46:30 +0200

Noam Postavsky <[email-masked]> writes:

> Perhaps it would be better to use funcall-interactively?

Good idea.  How about the attached patch?

Thanks,
Stefan Kangas
From cf0acdd73e665228913836a89d61dac854e296ed Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
Date: Fri, 2 Aug 2019 16:46:08 +0200
Subject: [PATCH] Suppress interactive-only warnings in undo-tests.el
 (Bug#36565)

* test/src/undo-tests.el (undo-test-region-deletion)
(undo-test-region-example, undo-test-marker-adjustment-nominal)
(undo-test-region-t-marker, undo-test-marker-adjustment-moved)
(undo-test-region-mark-adjustment): Suppress interactive-only warnings
by using funcall-interactively.
---
 test/src/undo-tests.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/src/undo-tests.el b/test/src/undo-tests.el
index 8395ba9909..fc2dfe027e 100644
--- a/test/src/undo-tests.el
+++ b/test/src/undo-tests.el
@@ -255,7 +255,7 @@ undo-test-region-deletion
     (insert "12345")
     (search-backward "4")
     (undo-boundary)
-    (delete-forward-char 1)
+    (funcall-interactively 'delete-forward-char 1)
     (search-backward "1")
     (undo-boundary)
     (insert "xxxx")
@@ -299,7 +299,7 @@ undo-test-region-example
     (insert "ddd")
     (search-backward "ad")
     (undo-boundary)
-    (delete-forward-char 2)
+    (funcall-interactively 'delete-forward-char 2)
     (undo-boundary)
     ;; Select "dd"
     (push-mark (point) t t)
@@ -348,7 +348,7 @@ undo-test-marker-adjustment-nominal
     (let ((m (make-marker)))
       (set-marker m 2 (current-buffer))
       (goto-char (point-min))
-      (delete-forward-char 3)
+      (funcall-interactively 'delete-forward-char 3)
       (undo-boundary)
       (should (= (point-min) (marker-position m)))
       (undo)
@@ -369,7 +369,7 @@ undo-test-region-t-marker
       (push-mark (point) t t)
       (setq mark-active t)
       (goto-char (point-min))
-      (delete-forward-char 1) ;; delete region covering "ab"
+      (funcall-interactively 'delete-forward-char 1) ; delete region covering "ab"
       (undo-boundary)
       (should (= (point-min) (marker-position m)))
       ;; Resurrect "ab". m's insertion type means the reinsertion
@@ -389,7 +389,7 @@ undo-test-marker-adjustment-moved
     (let ((m (make-marker)))
       (set-marker m 2 (current-buffer)) ; m at b
       (goto-char (point-min))
-      (delete-forward-char 3) ; m at d
+      (funcall-interactively 'delete-forward-char 3) ; m at d
       (undo-boundary)
       (set-marker m 4) ; m at g
       (undo)
@@ -422,7 +422,7 @@ undo-test-region-mark-adjustment
     (push-mark (point) t t)
     (setq mark-active t)
     (goto-char (- (point) 3))
-    (delete-forward-char 1)
+    (funcall-interactively 'delete-forward-char 1)
     (undo-boundary)
 
     (insert "bbb")
-- 
2.20.1