]> git.eshelyaron.com Git - emacs.git/commitdiff
Make `tty-display-color-p' follow its doc string. (Reported by Dan Nicolaescu.)
authorKaroly Lorentey <lorentey@elte.hu>
Thu, 20 Apr 2006 16:09:11 +0000 (16:09 +0000)
committerKaroly Lorentey <lorentey@elte.hu>
Thu, 20 Apr 2006 16:09:11 +0000 (16:09 +0000)
* lisp/vc.el (vc-annotate-color-map): Undo previous change.

* src/dispnew.c (Fsend_string_to_terminal): Update call to `get_tty_terminal'.

* src/term.c (Fsuspend_tty, Fresume_tty): Update call to `get_tty_terminal'.
  (get_tty_terminal): Add throw parameter.
  (Ftty_display_color_p, Ftty_display_color_cells): Don't throw errors on
  X frames.

* src/dispextern.h (get_tty_terminal): Update prototype.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-552

lisp/vc.el
src/dispextern.h
src/dispnew.c
src/term.c

index 348903fc031b8352cb76207c87420b05920baab1..61b8aa05a4ba16e759010bc6c7b51b9486f9bb0d 100644 (file)
@@ -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
index 157f49dea6d41ba91fe285efce1c9b99819df26f..137b1d4dee2b488b86a4b824914bad722bf8dc0f 100644 (file)
@@ -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 *));
index 9b4dbf1d9924fc7ccca0df9acada39854df06aa6..8298ee694d62b18bf045a2179016e2b0586d1abf 100644 (file)
@@ -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.  */
index efa6bc2bcd27b04a40d09d84ba2c6fafbe5f191d..6934159c0164f6d18594109737a55fc64af2d451 100644 (file)
@@ -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)