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)
(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)))
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");
}