Mercurial > emacs
diff src/term.c @ 83298:ed09a89e2b25
Fix UTF-8 tty input when first frame is an X frame. Steps towards multiple tty locale support.
* lisp/international/mule-cmds.el (set-locale-environment): Ignore
window-system; always set the keyboard coding system.
* src/termhooks.h (DISPLAY_TERMINAL_CODING, DISPLAY_KEYBOARD_CODING): New macros.
* src/coding.c (Fset_terminal_coding_system_internal, Fterminal_coding_system)
(Fset_keyboard_coding_system_internal, Fkeyboard_coding_system): Add DISPLAY
parameter.
* src/term.c (get_display): Add THROW parameter.
(get_tty_display, Fdisplay_name, Fdisplay_tty_type, Fdisplay_controlling_tty_p)
(Fdelete_display, Fdisplay_live_p): Update callers.
* src/xfns.c (check_x_display_info): Ditto.
* src/frame.c (Fmake_terminal_frame, Fframe_display): Ditto.
* src/dispextern.h (get_display): Update prototype.
* lisp/international/mule.el (set-terminal-coding-system)
(set-keyboard-coding-system): Add DISPLAY parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-338
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Tue, 03 May 2005 01:49:33 +0000 |
parents | 2c2b97b30980 |
children | 4a6a96fe8480 |
line wrap: on
line diff
--- a/src/term.c Tue May 03 01:38:40 2005 +0000 +++ b/src/term.c Tue May 03 01:49:33 2005 +0000 @@ -2105,17 +2105,17 @@ /* Return the display object specified by DISPLAY. DISPLAY may be a display id, a frame, or nil for the display device of the current - frame. */ + frame. If THROW is zero, return NULL for failure, otherwise throw + an error. */ struct display * -get_display (Lisp_Object display) +get_display (Lisp_Object display, int throw) { + Lisp_Object result = NULL; + if (NILP (display)) display = selected_frame; - if (! INTEGERP (display) && ! FRAMEP (display)) - return NULL; - if (INTEGERP (display)) { struct display *d; @@ -2123,15 +2123,21 @@ for (d = display_list; d; d = d->next_display) { if (d->id == XINT (display)) - return d; + { + result = d; + break; + } } - return NULL; } else if (FRAMEP (display)) { - return FRAME_DISPLAY (XFRAME (display)); + result = FRAME_DISPLAY (XFRAME (display)); } - return NULL; + + if (result == NULL && throw) + wrong_type_argument (Qdisplay_live_p, display); + + return result; } /* Return the tty display object specified by DISPLAY. */ @@ -2139,7 +2145,7 @@ static struct display * get_tty_display (Lisp_Object display) { - struct display *d = get_display (display); + struct display *d = get_display (display, 0); if (d && d->type == output_initial) d = NULL; @@ -2194,10 +2200,7 @@ (display) Lisp_Object display; { - struct display *d = get_display (display); - - if (!d) - wrong_type_argument (Qdisplay_live_p, display); + struct display *d = get_display (display, 1); if (d->name) return build_string (d->name); @@ -2210,10 +2213,8 @@ (display) Lisp_Object display; { - struct display *d = get_display (display); - - if (!d) - wrong_type_argument (Qdisplay_live_p, display); + struct display *d = get_display (display, 1); + if (d->type != output_termcap) error ("Display %d is not a termcap display", d->id); @@ -2228,10 +2229,7 @@ (display) Lisp_Object display; { - struct display *d = get_display (display); - - if (!d) - wrong_type_argument (Qdisplay_live_p, display); + struct display *d = get_display (display, 1); if (d->type != output_termcap || d->display_info.tty->name) return Qnil; @@ -3157,7 +3155,7 @@ { struct display *d, *p; - d = get_display (display); + d = get_display (display, 0); if (!d) return Qnil; @@ -3193,7 +3191,7 @@ if (!INTEGERP (object)) return Qnil; - d = get_display (object); + d = get_display (object, 0); if (!d) return Qnil;