diff options
| author | Eli Zaretskii | 2000-10-07 18:57:36 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2000-10-07 18:57:36 +0000 |
| commit | 5f65b39d991b3aa8f3075640e28bf97ec5cf592f (patch) | |
| tree | 264f52c81117bb3b22b2c19de6e59c3a8c14f2e7 /src | |
| parent | f26d858e50bb795ef9274e9d97089bbf92fce691 (diff) | |
| download | emacs-5f65b39d991b3aa8f3075640e28bf97ec5cf592f.tar.gz emacs-5f65b39d991b3aa8f3075640e28bf97ec5cf592f.zip | |
(Fframe_parameter): For non-windowed frames, if
f->param_alist says foreground or background color is unspecified,
call tty_color_name to return the color name computed from the
frame's current colors.
Diffstat (limited to 'src')
| -rw-r--r-- | src/frame.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/frame.c b/src/frame.c index 6c737eeaefb..fee69fd5a21 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -2133,7 +2133,29 @@ If FRAME is nil, describe the currently selected frame.") | |||
| 2133 | { | 2133 | { |
| 2134 | value = Fassq (parameter, f->param_alist); | 2134 | value = Fassq (parameter, f->param_alist); |
| 2135 | if (CONSP (value)) | 2135 | if (CONSP (value)) |
| 2136 | value = XCDR (value); | 2136 | { |
| 2137 | extern char unspecified_fg[], unspecified_bg[]; | ||
| 2138 | extern Lisp_Object Qbackground_color, Qforeground_color; | ||
| 2139 | |||
| 2140 | value = XCDR (value); | ||
| 2141 | /* Fframe_parameters puts the actual fg/bg color names, | ||
| 2142 | even if f->param_alist says otherwise. This is | ||
| 2143 | important when param_alist's notion of colors is | ||
| 2144 | "unspecified". We need to do the same here. */ | ||
| 2145 | if (STRINGP (value) && !FRAME_WINDOW_P (f)) | ||
| 2146 | { | ||
| 2147 | if (EQ (parameter, Qbackground_color) | ||
| 2148 | && strncmp (XSTRING (value)->data, | ||
| 2149 | unspecified_bg, | ||
| 2150 | XSTRING (value)->size) == 0) | ||
| 2151 | value = tty_color_name (f, FRAME_BACKGROUND_PIXEL (f)); | ||
| 2152 | else if (EQ (parameter, Qforeground_color) | ||
| 2153 | && strncmp (XSTRING (value)->data, | ||
| 2154 | unspecified_fg, | ||
| 2155 | XSTRING (value)->size) == 0) | ||
| 2156 | value = tty_color_name (f, FRAME_FOREGROUND_PIXEL (f)); | ||
| 2157 | } | ||
| 2158 | } | ||
| 2137 | else if (EQ (parameter, Qdisplay_type) | 2159 | else if (EQ (parameter, Qdisplay_type) |
| 2138 | || EQ (parameter, Qbackground_mode)) | 2160 | || EQ (parameter, Qbackground_mode)) |
| 2139 | /* Avoid consing in frequent cases. */ | 2161 | /* Avoid consing in frequent cases. */ |