aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorDmitry Antipov2014-10-14 16:45:41 +0400
committerDmitry Antipov2014-10-14 16:45:41 +0400
commitbb75cdf9c74ab19b75532da1f953233a47eedab4 (patch)
treeb8b4d07acaf36cdce7485fb459e7376975ebd5f7 /src/keyboard.c
parent5fa75d8eba2d43408fd7831dcfd69c21e31c21f3 (diff)
downloademacs-bb75cdf9c74ab19b75532da1f953233a47eedab4.tar.gz
emacs-bb75cdf9c74ab19b75532da1f953233a47eedab4.zip
Cleanup terminal handling code.
* dispextern.h (get_named_tty): Remove prototype but... * termhooks.h (get_named_terminal): ...resurrect it under more meaningful name. (get_terminal): Likewise, but with... (decode_live_terminal): ...this name. (decode_tty_terminal): Add prototype. * term.c (get_tty_terminal): Remove. (get_named_tty): Remove. (Ftty_display_color_p, Ftty_display_color_cells, Ftty_type) (Fcontrolling_tty_p, Fsuspend_tty, Fresume_tty): Use decode_tty_terminal. (Ftty_no_underline, Ftty_top_frame): Use decode_live_terminal. * terminal.c (get_terminal): Refactor to... (decode_terminal, decode_live_terminal): ...new functions. (decode_tty_terminal): Replacement for get_tty_terminal. (get_named_terminal): Likewise for get_named_tty. * coding.c (Fset_terminal_coding_system_internal) (Fterminal_coding_system, Fset_keyboard_coding_system_internal): (Fkeyboard_coding_system): * composite.c (Fcomposition_get_gstring): * dispnew.c (Fsend_string_to_terminal): * frame.c (Fmake_terminal_frame): * nsfns.m (check_ns_display_info): * w32fns.c, xfns.c (check_x_display_info): * xselect.c (frame_for_x_selection): Use decode_live_terminal. * keyboard.c (handle_interrupt_signal, handle_interrupt) (Fset_quit_char): Use get_named_terminal. (Fset_output_flow_control, Fset_input_meta_mode): Use decode_tty_terminal.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 6730536dc1d..e8143f26681 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -10349,7 +10349,7 @@ static void
10349handle_interrupt_signal (int sig) 10349handle_interrupt_signal (int sig)
10350{ 10350{
10351 /* See if we have an active terminal on our controlling tty. */ 10351 /* See if we have an active terminal on our controlling tty. */
10352 struct terminal *terminal = get_named_tty ("/dev/tty"); 10352 struct terminal *terminal = get_named_terminal ("/dev/tty");
10353 if (!terminal) 10353 if (!terminal)
10354 { 10354 {
10355 /* If there are no frames there, let's pretend that we are a 10355 /* If there are no frames there, let's pretend that we are a
@@ -10403,7 +10403,7 @@ handle_interrupt (bool in_signal_handler)
10403 cancel_echoing (); 10403 cancel_echoing ();
10404 10404
10405 /* XXX This code needs to be revised for multi-tty support. */ 10405 /* XXX This code needs to be revised for multi-tty support. */
10406 if (!NILP (Vquit_flag) && get_named_tty ("/dev/tty")) 10406 if (!NILP (Vquit_flag) && get_named_terminal ("/dev/tty"))
10407 { 10407 {
10408 if (! in_signal_handler) 10408 if (! in_signal_handler)
10409 { 10409 {
@@ -10615,9 +10615,10 @@ Emacs reads input in CBREAK mode; see `set-input-interrupt-mode'.
10615See also `current-input-mode'. */) 10615See also `current-input-mode'. */)
10616 (Lisp_Object flow, Lisp_Object terminal) 10616 (Lisp_Object flow, Lisp_Object terminal)
10617{ 10617{
10618 struct terminal *t = get_terminal (terminal, 1); 10618 struct terminal *t = decode_tty_terminal (terminal);
10619 struct tty_display_info *tty; 10619 struct tty_display_info *tty;
10620 if (t == NULL || (t->type != output_termcap && t->type != output_msdos_raw)) 10620
10621 if (!t)
10621 return Qnil; 10622 return Qnil;
10622 tty = t->display_info.tty; 10623 tty = t->display_info.tty;
10623 10624
@@ -10657,11 +10658,11 @@ the currently selected frame.
10657See also `current-input-mode'. */) 10658See also `current-input-mode'. */)
10658 (Lisp_Object meta, Lisp_Object terminal) 10659 (Lisp_Object meta, Lisp_Object terminal)
10659{ 10660{
10660 struct terminal *t = get_terminal (terminal, 1); 10661 struct terminal *t = decode_tty_terminal (terminal);
10661 struct tty_display_info *tty; 10662 struct tty_display_info *tty;
10662 int new_meta; 10663 int new_meta;
10663 10664
10664 if (t == NULL || (t->type != output_termcap && t->type != output_msdos_raw)) 10665 if (!t)
10665 return Qnil; 10666 return Qnil;
10666 tty = t->display_info.tty; 10667 tty = t->display_info.tty;
10667 10668
@@ -10698,9 +10699,10 @@ process.
10698See also `current-input-mode'. */) 10699See also `current-input-mode'. */)
10699 (Lisp_Object quit) 10700 (Lisp_Object quit)
10700{ 10701{
10701 struct terminal *t = get_named_tty ("/dev/tty"); 10702 struct terminal *t = get_named_terminal ("/dev/tty");
10702 struct tty_display_info *tty; 10703 struct tty_display_info *tty;
10703 if (t == NULL || (t->type != output_termcap && t->type != output_msdos_raw)) 10704
10705 if (!t)
10704 return Qnil; 10706 return Qnil;
10705 tty = t->display_info.tty; 10707 tty = t->display_info.tty;
10706 10708