;; 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
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 *));
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. */
(terminal)
Lisp_Object terminal;
{
- struct terminal *t = get_tty_terminal (terminal);
+ struct terminal *t = get_tty_terminal (terminal, 0);
if (!t)
return Qnil;
else
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
/* 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;
}
(tty)
Lisp_Object tty;
{
- struct terminal *t = get_tty_terminal (tty);
+ struct terminal *t = get_tty_terminal (tty, 1);
FILE *f;
if (!t)
(tty)
Lisp_Object tty;
{
- struct terminal *t = get_tty_terminal (tty);
+ struct terminal *t = get_tty_terminal (tty, 1);
int fd;
if (!t)