comparison src/dispnew.c @ 83370:5272862a4865

Fix crashes in xdialog_show (and other places) with xterm-mouse-mode. * src/dispextern.h (get_tty_device): Declare. * src/dispnew.c (Fsend_string_to_terminal): Add optional TERMINAL parameter. * src/fns.c (Fy_or_n_p, Fyes_or_no_p): Don't try to open an X dialog on tty terminals. * src/term.c (get_tty_device): Remove static qualifier. * src/xmenu.c (create_and_show_dialog, create_and_show_popup_menu) (free_frame_menubar, mouse_position_for_popup, set_frame_menubar) (update_frame_menubar, x_activate_menubar, xdialog_show, xmenu_show): Abort when given a non-X frame. * src/xmenu.c (Fx_popup_menu, Fx_popup_dialog): Throw an error when run on a non-X frame. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-410
author Karoly Lorentey <lorentey@elte.hu>
date Sun, 11 Sep 2005 03:15:42 +0000
parents c3dd82172ed1
children 08b4dd6a6e87
comparison
equal deleted inserted replaced
83369:d2e0850b17f2 83370:5272862a4865
6283 return Qnil; 6283 return Qnil;
6284 } 6284 }
6285 6285
6286 6286
6287 DEFUN ("send-string-to-terminal", Fsend_string_to_terminal, 6287 DEFUN ("send-string-to-terminal", Fsend_string_to_terminal,
6288 Ssend_string_to_terminal, 1, 1, 0, 6288 Ssend_string_to_terminal, 1, 2, 0,
6289 doc: /* Send STRING to the terminal without alteration. 6289 doc: /* Send STRING to the terminal without alteration.
6290 Control characters in STRING will have terminal-dependent effects. */) 6290 Control characters in STRING will have terminal-dependent effects.
6291 (string) 6291
6292 Optional parameter TERMINAL specifies the tty display device to use.
6293 It may be a terminal id, a frame, or nil for the terminal used by the
6294 currently selected frame. */)
6295 (string, display)
6292 Lisp_Object string; 6296 Lisp_Object string;
6293 { 6297 Lisp_Object display;
6298 {
6299 struct device *d = get_tty_device (display);
6294 struct tty_display_info *tty; 6300 struct tty_display_info *tty;
6295 6301
6296 /* ??? Perhaps we should do something special for multibyte strings here. */ 6302 /* ??? Perhaps we should do something special for multibyte strings here. */
6297 CHECK_STRING (string); 6303 CHECK_STRING (string);
6298 6304
6299 if (! FRAME_TERMCAP_P (SELECTED_FRAME ())) 6305 if (!d)
6300 error ("Current frame is not on a tty device"); 6306 error ("Unknown display device");
6301 6307
6302 tty = CURTTY (); 6308 tty = d->display_info.tty;
6303 6309
6304 if (tty->termscript) 6310 if (tty->termscript)
6305 { 6311 {
6306 fwrite (SDATA (string), 1, SBYTES (string), tty->termscript); 6312 fwrite (SDATA (string), 1, SBYTES (string), tty->termscript);
6307 fflush (tty->termscript); 6313 fflush (tty->termscript);