unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Noam Postavsky <npostavs@gmail.com>
Cc: 36565@debbugs.gnu.org
Subject: bug#36565: [PATCH] Suppress interactive-only warnings in undo-tests.el
Date: Sun, 4 Aug 2019 18:46:30 +0200	[thread overview]
Message-ID: <CADwFkmnQxvYE5wz7Yn4iescJSq_gJo3y5c=t62CCaDLZ_LkQdQ@mail.gmail.com> (raw)
In-Reply-To: <857e8gl8zv.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 170 bytes --]

Noam Postavsky <npostavs@gmail.com> writes:

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

Good idea.  How about the attached patch?

Thanks,
Stefan Kangas

[-- Attachment #2: 0001-Suppress-interactive-only-warnings-in-undo-tests.el-.patch --]
[-- Type: text/x-patch, Size: 2670 bytes --]

From cf0acdd73e665228913836a89d61dac854e296ed Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas@gmail.com>
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


  reply	other threads:[~2019-08-04 16:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-10  1:14 bug#36565: [PATCH] Suppress interactive-only warnings in undo-tests.el Stefan Kangas
2019-07-10  1:24 ` Stefan Kangas
2019-07-10  3:40   ` Stefan Kangas
2019-07-10  3:53     ` Stefan Kangas
2019-07-17 20:08       ` Noam Postavsky
2019-08-04 16:46         ` Stefan Kangas [this message]
2019-08-08 12:30           ` Noam Postavsky
2019-07-10 12:09 ` Lars Ingebrigtsen
2019-07-10 22:53   ` Stefan Kangas
2019-07-11 14:11     ` Lars Ingebrigtsen
2019-07-11 17:31       ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkmnQxvYE5wz7Yn4iescJSq_gJo3y5c=t62CCaDLZ_LkQdQ@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=36565@debbugs.gnu.org \
    --cc=npostavs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).