]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow xt-mouse-tests to run
authorGerd Möllmann <gerd@gnu.org>
Fri, 20 Dec 2024 06:03:59 +0000 (07:03 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 23 Dec 2024 15:17:36 +0000 (16:17 +0100)
This is basically a workaround for running a test in batch mode
which should have a tty frame available but doesn't.

* src/frame.c (check_tty): Relax check if noninteractive.
* lisp/xt-mouse.el (xterm-mouse-event): Don't use frame-at if
noninteractive.

(cherry picked from commit 82c3fcd17e3eb3756bd3533c39d89c21ec7fdce5)

lisp/xt-mouse.el
src/frame.c

index 4f1ac4f2b163fa2a4c73ee62091997f30d380ffb..2ba60ded8995237e731ebf4c927721acb084ccdb 100644 (file)
@@ -295,7 +295,10 @@ which is the \"1006\" extension implemented in Xterm >= 277."
                            (progn (setq xt-mouse-epoch (float-time)) 0)
                          (car (time-convert (time-since xt-mouse-epoch)
                                             1000))))
-             (frame (frame-at x y))
+             ;; FIXME: The test for running in batch mode is here solely
+             ;; for the sake of xt-mouse-tests where the only frame is
+             ;; the initial frame.
+             (frame (unless noninteractive (frame-at x y)))
              ;;(_ (message (format "*** %S" frame)))
              (frame-pos (frame-position frame))
              ;;(_ (message (format "*** %S" frame-pos)))
index 8c41f0fa7c76ca15689421962ba57750a5298f2f..5d9551c0c938d33e92776944fba101b303ba9df7 100644 (file)
@@ -152,6 +152,13 @@ check_window_system (struct frame *f)
 void
 check_tty (struct frame *f)
 {
+  /* FIXME: the noninteractive case is here because some tests running
+     in batch mode, like xt-mouse-tests, test with the initial frame
+     which is no tty frame.  It would be nicer if the test harness
+     would allow testing with real tty frames.  */
+  if (f && noninteractive)
+    return;
+
   if (!f || !FRAME_TERMCAP_P (f))
     error ("tty frame should be used");
 }