From: Eli Zaretskii Date: Sun, 2 Jan 2000 14:07:32 +0000 (+0000) Subject: (tty_defined_color): Pass frame to tty-color-desc. The X-Git-Tag: emacs-pretest-21.0.90~5557 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a61c12d547c5262d9441e664d56108f7d08e41a6;p=emacs.git (tty_defined_color): Pass frame to tty-color-desc. The list of colors renamed to tty-defined-color-alist. (tty_color_name): Pass the frame to tty-color-by-index. (realize_tty_face): tty-color-alist is now a function which accepts the frame as argument. --- diff --git a/src/xfaces.c b/src/xfaces.c index dfe8f2e4293..4960de74ff3 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -1088,8 +1088,11 @@ tty_defined_color (f, color_name, color_def, alloc) if (*color_name && !NILP (Ffboundp (Qtty_color_desc))) { + Lisp_Object frame; + + XSETFRAME (frame, f); status = 0; - color_desc = call1 (Qtty_color_desc, build_string (color_name)); + color_desc = call2 (Qtty_color_desc, build_string (color_name), frame); if (CONSP (color_desc) && CONSP (XCDR (color_desc))) { color_idx = XINT (XCAR (XCDR (color_desc))); @@ -1101,9 +1104,9 @@ tty_defined_color (f, color_name, color_def, alloc) } status = 1; } - else if (NILP (Fsymbol_value (intern ("tty-color-alist")))) + else if (NILP (Fsymbol_value (intern ("tty-defined-color-alist")))) /* We were called early during startup, and the colors are not - yet set up in tty-color-alist. Don't return a failure + yet set up in tty-defined-color-alist. Don't return a failure indication, since this produces the annoying "Unable to load color" messages in the *Messages* buffer. */ status = 1; @@ -1169,7 +1172,11 @@ tty_color_name (f, idx) if (idx >= 0 && !NILP (Ffboundp (Qtty_color_by_index))) { - Lisp_Object coldesc = call1 (Qtty_color_by_index, make_number (idx)); + Lisp_Object frame; + Lisp_Object coldesc; + + XSETFRAME (frame, f); + coldesc = call2 (Qtty_color_by_index, make_number (idx), frame); if (!NILP (coldesc)) return XCAR (coldesc); @@ -6063,7 +6070,10 @@ realize_tty_face (c, attrs, charset) struct face *face; int weight, slant; Lisp_Object color; - Lisp_Object tty_color_alist = Fsymbol_value (intern ("tty-color-alist")); + Lisp_Object tty_defined_color_alist = + Fsymbol_value (intern ("tty-defined-color-alist")); + Lisp_Object tty_color_alist = intern ("tty-color-alist"); + Lisp_Object frame; int face_colors_defaulted = 0; /* Frame must be a termcap frame. */ @@ -6092,13 +6102,14 @@ realize_tty_face (c, attrs, charset) face->foreground = FACE_TTY_DEFAULT_FG_COLOR; face->background = FACE_TTY_DEFAULT_BG_COLOR; + XSETFRAME (frame, c->f); color = attrs[LFACE_FOREGROUND_INDEX]; if (STRINGP (color) && XSTRING (color)->size - && !NILP (tty_color_alist) - && (color = Fassoc (color, tty_color_alist), + && !NILP (tty_defined_color_alist) + && (color = Fassoc (color, call1 (tty_color_alist, frame)), CONSP (color))) - /* Associations in tty-color-alist are of the form + /* Associations in tty-defined-color-alist are of the form (NAME INDEX R G B). We need the INDEX part. */ face->foreground = XINT (XCAR (XCDR (color))); @@ -6135,10 +6146,10 @@ realize_tty_face (c, attrs, charset) color = attrs[LFACE_BACKGROUND_INDEX]; if (STRINGP (color) && XSTRING (color)->size - && !NILP (tty_color_alist) - && (color = Fassoc (color, tty_color_alist), + && !NILP (tty_defined_color_alist) + && (color = Fassoc (color, call1 (tty_color_alist, frame)), CONSP (color))) - /* Associations in tty-color-alist are of the form + /* Associations in tty-defined-color-alist are of the form (NAME INDEX R G B). We need the INDEX part. */ face->background = XINT (XCAR (XCDR (color)));