aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2006-04-20 16:09:11 +0000
committerKaroly Lorentey2006-04-20 16:09:11 +0000
commit717a00ef34c0f55bfbad80584f00d86c090d547f (patch)
tree5184f683248fabb23a1ce92d93da528065686326 /src
parent3fde2acf6a4b228b3493666ab17f43eeac5a738f (diff)
downloademacs-717a00ef34c0f55bfbad80584f00d86c090d547f.tar.gz
emacs-717a00ef34c0f55bfbad80584f00d86c090d547f.zip
Make `tty-display-color-p' follow its doc string. (Reported by Dan Nicolaescu.)
* 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
Diffstat (limited to 'src')
-rw-r--r--src/dispextern.h2
-rw-r--r--src/dispnew.c2
-rw-r--r--src/term.c23
3 files changed, 16 insertions, 11 deletions
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 *));
2957extern void produce_special_glyphs P_ ((struct it *, enum display_element_type)); 2957extern void produce_special_glyphs P_ ((struct it *, enum display_element_type));
2958extern int tty_capable_p P_ ((struct tty_display_info *, unsigned, unsigned long, unsigned long)); 2958extern int tty_capable_p P_ ((struct tty_display_info *, unsigned, unsigned long, unsigned long));
2959extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object)); 2959extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object));
2960extern struct terminal *get_tty_terminal P_ ((Lisp_Object terminal)); 2960extern struct terminal *get_tty_terminal P_ ((Lisp_Object, int));
2961extern struct terminal *get_named_tty P_ ((char *)); 2961extern struct terminal *get_named_tty P_ ((char *));
2962EXFUN (Ftty_type, 1); 2962EXFUN (Ftty_type, 1);
2963extern void create_tty_output P_ ((struct frame *)); 2963extern 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. */)
6318 Lisp_Object string; 6318 Lisp_Object string;
6319 Lisp_Object terminal; 6319 Lisp_Object terminal;
6320{ 6320{
6321 struct terminal *t = get_tty_terminal (terminal); 6321 struct terminal *t = get_tty_terminal (terminal, 1);
6322 struct tty_display_info *tty; 6322 struct tty_display_info *tty;
6323 6323
6324 /* ??? Perhaps we should do something special for multibyte strings here. */ 6324 /* ??? 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. */)
1842 (terminal) 1842 (terminal)
1843 Lisp_Object terminal; 1843 Lisp_Object terminal;
1844{ 1844{
1845 struct terminal *t = get_tty_terminal (terminal); 1845 struct terminal *t = get_tty_terminal (terminal, 0);
1846 if (!t) 1846 if (!t)
1847 return Qnil; 1847 return Qnil;
1848 else 1848 else
@@ -1855,12 +1855,12 @@ DEFUN ("tty-display-color-cells", Ftty_display_color_cells,
1855 doc: /* Return the number of colors supported by the tty device TERMINAL. 1855 doc: /* Return the number of colors supported by the tty device TERMINAL.
1856 1856
1857TERMINAL can be a terminal id, a frame or nil (meaning the selected 1857TERMINAL can be a terminal id, a frame or nil (meaning the selected
1858frame's terminal). This function always returns nil if TERMINAL 1858frame's terminal). This function always returns 0 if TERMINAL
1859is not on a tty device. */) 1859is not on a tty device. */)
1860 (terminal) 1860 (terminal)
1861 Lisp_Object terminal; 1861 Lisp_Object terminal;
1862{ 1862{
1863 struct terminal *t = get_tty_terminal (terminal); 1863 struct terminal *t = get_tty_terminal (terminal, 0);
1864 if (!t) 1864 if (!t)
1865 return make_number (0); 1865 return make_number (0);
1866 else 1866 else
@@ -2009,15 +2009,20 @@ set_tty_color_mode (f, val)
2009/* Return the tty display object specified by TERMINAL. */ 2009/* Return the tty display object specified by TERMINAL. */
2010 2010
2011struct terminal * 2011struct terminal *
2012get_tty_terminal (Lisp_Object terminal) 2012get_tty_terminal (Lisp_Object terminal, int throw)
2013{ 2013{
2014 struct terminal *t = get_terminal (terminal, 0); 2014 struct terminal *t = get_terminal (terminal, throw);
2015 2015
2016 if (t && t->type == output_initial) 2016 if (t && t->type == output_initial)
2017 t = NULL; 2017 return NULL;
2018 2018
2019 if (t && t->type != output_termcap) 2019 if (t && t->type != output_termcap)
2020 error ("Device %d is not a termcap terminal device", t->id); 2020 {
2021 if (throw)
2022 error ("Device %d is not a termcap terminal device", t->id);
2023 else
2024 return NULL;
2025 }
2021 2026
2022 return t; 2027 return t;
2023} 2028}
@@ -2128,7 +2133,7 @@ A suspended tty may be resumed by calling `resume-tty' on it. */)
2128 (tty) 2133 (tty)
2129 Lisp_Object tty; 2134 Lisp_Object tty;
2130{ 2135{
2131 struct terminal *t = get_tty_terminal (tty); 2136 struct terminal *t = get_tty_terminal (tty, 1);
2132 FILE *f; 2137 FILE *f;
2133 2138
2134 if (!t) 2139 if (!t)
@@ -2185,7 +2190,7 @@ the currently selected frame. */)
2185 (tty) 2190 (tty)
2186 Lisp_Object tty; 2191 Lisp_Object tty;
2187{ 2192{
2188 struct terminal *t = get_tty_terminal (tty); 2193 struct terminal *t = get_tty_terminal (tty, 1);
2189 int fd; 2194 int fd;
2190 2195
2191 if (!t) 2196 if (!t)