diff options
-rw-r--r-- | lisp/vc.el | 4 | ||||
-rw-r--r-- | src/dispextern.h | 2 | ||||
-rw-r--r-- | src/dispnew.c | 2 | ||||
-rw-r--r-- | src/term.c | 23 |
4 files changed, 17 insertions, 14 deletions
diff --git a/lisp/vc.el b/lisp/vc.el index 348903fc031..61b8aa05a4b 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -617,9 +617,7 @@ version control backend imposes itself." ;; Annotate customization (defcustom vc-annotate-color-map - (if (and (not window-system) - (tty-display-color-p) - (<= (display-color-cells) 8)) + (if (and (tty-display-color-p) (<= (display-color-cells) 8)) ;; A custom sorted TTY colormap (let* ((colors (sort diff --git a/src/dispextern.h b/src/dispextern.h index 157f49dea6d..137b1d4dee2 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -2957,7 +2957,7 @@ extern void produce_glyphs P_ ((struct it *)); extern void produce_special_glyphs P_ ((struct it *, enum display_element_type)); extern int tty_capable_p P_ ((struct tty_display_info *, unsigned, unsigned long, unsigned long)); extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object)); -extern struct terminal *get_tty_terminal P_ ((Lisp_Object terminal)); +extern struct terminal *get_tty_terminal P_ ((Lisp_Object, int)); extern struct terminal *get_named_tty P_ ((char *)); EXFUN (Ftty_type, 1); extern void create_tty_output P_ ((struct frame *)); diff --git a/src/dispnew.c b/src/dispnew.c index 9b4dbf1d992..8298ee694d6 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -6318,7 +6318,7 @@ currently selected frame. */) Lisp_Object string; Lisp_Object terminal; { - struct terminal *t = get_tty_terminal (terminal); + struct terminal *t = get_tty_terminal (terminal, 1); struct tty_display_info *tty; /* ??? Perhaps we should do something special for multibyte strings here. */ diff --git a/src/term.c b/src/term.c index efa6bc2bcd2..6934159c016 100644 --- a/src/term.c +++ b/src/term.c @@ -1842,7 +1842,7 @@ is not on a tty device. */) (terminal) Lisp_Object terminal; { - struct terminal *t = get_tty_terminal (terminal); + struct terminal *t = get_tty_terminal (terminal, 0); if (!t) return Qnil; else @@ -1855,12 +1855,12 @@ DEFUN ("tty-display-color-cells", Ftty_display_color_cells, doc: /* Return the number of colors supported by the tty device TERMINAL. TERMINAL can be a terminal id, a frame or nil (meaning the selected -frame's terminal). This function always returns nil if TERMINAL +frame's terminal). This function always returns 0 if TERMINAL is not on a tty device. */) (terminal) Lisp_Object terminal; { - struct terminal *t = get_tty_terminal (terminal); + struct terminal *t = get_tty_terminal (terminal, 0); if (!t) return make_number (0); else @@ -2009,15 +2009,20 @@ set_tty_color_mode (f, val) /* Return the tty display object specified by TERMINAL. */ struct terminal * -get_tty_terminal (Lisp_Object terminal) +get_tty_terminal (Lisp_Object terminal, int throw) { - struct terminal *t = get_terminal (terminal, 0); + struct terminal *t = get_terminal (terminal, throw); if (t && t->type == output_initial) - t = NULL; + return NULL; if (t && t->type != output_termcap) - error ("Device %d is not a termcap terminal device", t->id); + { + if (throw) + error ("Device %d is not a termcap terminal device", t->id); + else + return NULL; + } return t; } @@ -2128,7 +2133,7 @@ A suspended tty may be resumed by calling `resume-tty' on it. */) (tty) Lisp_Object tty; { - struct terminal *t = get_tty_terminal (tty); + struct terminal *t = get_tty_terminal (tty, 1); FILE *f; if (!t) @@ -2185,7 +2190,7 @@ the currently selected frame. */) (tty) Lisp_Object tty; { - struct terminal *t = get_tty_terminal (tty); + struct terminal *t = get_tty_terminal (tty, 1); int fd; if (!t) |