aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Möllmann2024-12-20 07:03:59 +0100
committerGerd Möllmann2024-12-20 07:03:59 +0100
commit82c3fcd17e3eb3756bd3533c39d89c21ec7fdce5 (patch)
tree30b47b72619a8373acf69caa8ecc50e56d139633
parent42ab0f162cb37eeddae53675fba310b8a22ff934 (diff)
downloademacs-82c3fcd17e3eb3756bd3533c39d89c21ec7fdce5.tar.gz
emacs-82c3fcd17e3eb3756bd3533c39d89c21ec7fdce5.zip
Allow xt-mouse-tests to run
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.
-rw-r--r--lisp/xt-mouse.el5
-rw-r--r--src/frame.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index 4f1ac4f2b16..2ba60ded899 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -295,7 +295,10 @@ which is the \"1006\" extension implemented in Xterm >= 277."
295 (progn (setq xt-mouse-epoch (float-time)) 0) 295 (progn (setq xt-mouse-epoch (float-time)) 0)
296 (car (time-convert (time-since xt-mouse-epoch) 296 (car (time-convert (time-since xt-mouse-epoch)
297 1000)))) 297 1000))))
298 (frame (frame-at x y)) 298 ;; FIXME: The test for running in batch mode is here solely
299 ;; for the sake of xt-mouse-tests where the only frame is
300 ;; the initial frame.
301 (frame (unless noninteractive (frame-at x y)))
299 ;;(_ (message (format "*** %S" frame))) 302 ;;(_ (message (format "*** %S" frame)))
300 (frame-pos (frame-position frame)) 303 (frame-pos (frame-position frame))
301 ;;(_ (message (format "*** %S" frame-pos))) 304 ;;(_ (message (format "*** %S" frame-pos)))
diff --git a/src/frame.c b/src/frame.c
index 18e1078efe4..431b04fc34e 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -152,6 +152,13 @@ check_window_system (struct frame *f)
152void 152void
153check_tty (struct frame *f) 153check_tty (struct frame *f)
154{ 154{
155 /* FIXME: the noninteractive case is here because some tests running
156 in batch mode, like xt-mouse-tests, test with the initial frame
157 which is no tty frame. It would be nicer if the test harness
158 would allow testing with real tty frames. */
159 if (f && noninteractive)
160 return;
161
155 if (!f || !FRAME_TERMCAP_P (f)) 162 if (!f || !FRAME_TERMCAP_P (f))
156 error ("tty frame should be used"); 163 error ("tty frame should be used");
157} 164}