From: Karoly Lorentey Date: Tue, 21 Jun 2005 15:42:45 +0000 (+0000) Subject: Merged from miles@gnu.org--gnu-2005 (patch 423-434) X-Git-Tag: emacs-pretest-23.0.90~11236^2~141^2~249 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a3fbb8977ddcc3f913058d323af6034cb70561a9;p=emacs.git Merged from miles@gnu.org--gnu-2005 (patch 423-434) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-423 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-424 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425 Remove "-face" suffix from gnus faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-426 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-427 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-428 Remove "-face" suffix from MH-E faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-429 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-430 Remove "-face" suffix from cc-mode faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-431 Remove "-face" suffix from eshell faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-432 Remove "-face" suffix from ediff faces * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-433 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-434 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-351 --- a3fbb8977ddcc3f913058d323af6034cb70561a9 diff --cc src/term.c index 8aa3b3969ee,c0eb7be8d56..774373e82f9 --- a/src/term.c +++ b/src/term.c @@@ -1752,12 -1915,13 +1753,13 @@@ produce_special_glyphs (it, what from them. Some display attributes may not be used together with color; the termcap capability `NC' specifies which ones. */ -#define MAY_USE_WITH_COLORS_P(ATTR) \ - (TN_max_colors > 0 \ - ? (TN_no_color_video & (ATTR)) == 0 \ - : 1) +#define MAY_USE_WITH_COLORS_P(tty, ATTR) \ + (tty->TN_max_colors > 0 \ + ? (tty->TN_no_color_video & (ATTR)) == 0 \ + : 1) - /* Turn appearances of face FACE_ID on tty frame F on. */ + /* Turn appearances of face FACE_ID on tty frame F on. + FACE_ID is a realized face ID number, in the face cache. */ static void turn_on_face (f, face_id) @@@ -2101,142 -2258,6 +2103,167 @@@ set_tty_color_mode (f, val #endif /* !WINDOWSNT */ + + +/* 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. If THROW is zero, return NULL for failure, otherwise throw + an error. */ + +struct display * +get_display (Lisp_Object display, int throw) +{ + struct display *result = NULL; + + if (NILP (display)) + display = selected_frame; + + if (INTEGERP (display)) + { + struct display *d; + + for (d = display_list; d; d = d->next_display) + { + if (d->id == XINT (display)) + { + result = d; + break; + } + } + } + else if (FRAMEP (display)) + { + result = FRAME_DISPLAY (XFRAME (display)); + } + + if (result == NULL && throw) + wrong_type_argument (Qdisplay_live_p, display); + + return result; +} + +/* Return the tty display object specified by DISPLAY. */ + +static struct display * +get_tty_display (Lisp_Object display) +{ + struct display *d = get_display (display, 0); + + if (d && d->type == output_initial) + d = NULL; + + if (d && d->type != output_termcap) + { +#if 0 /* XXX We need a predicate as the first argument; find one. */ + wrong_type_argument ("Not a termcap display", display); +#else /* Until we fix the wrong_type_argument call above, simply throw + a dumb error. */ + error ("DISPLAY is not a termcap display"); +#endif + } + + return d; +} + +/* Return the active termcap display that uses the tty device with the + given name. If NAME is NULL, return the display corresponding to + our controlling terminal. + + This function ignores suspended displays. + + Returns NULL if the named terminal device is not opened. */ + +struct display * +get_named_tty_display (name) + char *name; +{ + struct display *d; + + for (d = display_list; d; d = d->next_display) { + if (d->type == output_termcap + && ((d->display_info.tty->name == 0 && name == 0) + || (name && d->display_info.tty->name + && !strcmp (d->display_info.tty->name, name))) + && DISPLAY_ACTIVE_P (d)) + return d; + }; + + return 0; +} + + + +DEFUN ("display-name", Fdisplay_name, Sdisplay_name, 0, 1, 0, + doc: /* Return the name of the device that DISPLAY uses. +It is not guaranteed that the returned value is unique among opened displays. + - DISPLAY can be a display, a frame, or nil (meaning the selected ++DISPLAY may be a display, a frame, or nil (meaning the selected +frame's display). */) + (display) + Lisp_Object display; +{ + struct display *d = get_display (display, 1); + + if (d->name) + return build_string (d->name); + else + return Qnil; +} + +DEFUN ("display-tty-type", Fdisplay_tty_type, Sdisplay_tty_type, 0, 1, 0, - doc: /* Return the type of the TTY device that DISPLAY uses. */) ++ doc: /* Return the type of the TTY device that DISPLAY uses. ++ ++DISPLAY may be a display, a frame, or nil (meaning the selected ++frame's display). */) + (display) + Lisp_Object display; +{ + struct display *d = get_display (display, 1); + + if (d->type != output_termcap) + error ("Display %d is not a termcap display", d->id); + + if (d->display_info.tty->type) + return build_string (d->display_info.tty->type); + else + return Qnil; +} + +DEFUN ("display-controlling-tty-p", Fdisplay_controlling_tty_p, Sdisplay_controlling_tty_p, 0, 1, 0, - doc: /* Return non-nil if DISPLAY is on the controlling tty of the Emacs process. */) ++ doc: /* Return non-nil if DISPLAY is on the controlling tty of the Emacs process. ++ ++DISPLAY may be a display, a frame, or nil (meaning the selected ++frame's display). */) + (display) + Lisp_Object display; +{ + struct display *d = get_display (display, 1); + + if (d->type != output_termcap || d->display_info.tty->name) + return Qnil; + else + return Qt; +} + ++DEFUN ("tty-no-underline", Ftty_no_underline, Stty_no_underline, 0, 1, 0, ++ doc: /* Declare that the tty used by DISPLAY does not handle underlining. ++This is used to override the terminfo data, for certain terminals that ++do not really do underlining, but say that they do. This function has ++no effect if used on a non-tty display. ++ ++DISPLAY may be a display, a frame, or nil (meaning the selected ++frame's display). */) ++ (display) ++ Lisp_Object display; ++{ ++ struct display *d = get_display (display, 1); ++ ++ if (d->type == output_termcap) ++ d->display_info.tty->TS_enter_underline_mode = 0; ++ return Qnil; ++} ++ ++ /*********************************************************************** Initialization @@@ -3369,35 -2714,10 +3396,36 @@@ This variable can be used by terminal e The function should accept no arguments. */); Vring_bell_function = Qnil; + DEFVAR_LISP ("suspend-tty-functions", &Vsuspend_tty_functions, + doc: /* Functions to be run after suspending a tty. +The functions are run with one argument, the name of the tty to be suspended. +See `suspend-tty'. */); + Vsuspend_tty_functions = Qnil; + + + DEFVAR_LISP ("resume-tty-functions", &Vresume_tty_functions, + doc: /* Functions to be run after resuming a tty. +The functions are run with one argument, the name of the tty that was revived. +See `resume-tty'. */); + Vresume_tty_functions = Qnil; + defsubr (&Stty_display_color_p); defsubr (&Stty_display_color_cells); + defsubr (&Stty_no_underline); + defsubr (&Sdisplay_name); + defsubr (&Sdisplay_tty_type); + defsubr (&Sdisplay_controlling_tty_p); + defsubr (&Sdelete_display); + defsubr (&Sdisplay_live_p); + defsubr (&Sdisplay_list); + defsubr (&Ssuspend_tty); + defsubr (&Sresume_tty); + + Fprovide (intern ("multi-tty"), Qnil); + } + + /* arch-tag: 498e7449-6f2e-45e2-91dd-b7d4ca488193 (do not change this comment) */