diff options
author | Eli Zaretskii <eliz@gnu.org> | 2011-05-07 18:44:19 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2011-05-07 18:44:19 +0300 |
commit | b0512a1d7926fc8d5a1d9deb06050e354268989c (patch) | |
tree | 613a12317bace9f3003d9cbf49ad79f98b6ad0ba /src/w32console.c | |
parent | 0966ef96e7b63f3f85244f28b8c36c846c420e3b (diff) |
Fix bug #8597 with setting frame background mode on w32 console.
src/w32console.c (Fset_screen_color): Doc fix.
(Fget_screen_color): New function.
(syms_of_ntterm): Defsubr it.
lisp/term/w32console.el (terminal-init-w32console): Call
get-screen-color and use its output to set the frame
background-mode.
Diffstat (limited to 'src/w32console.c')
-rw-r--r-- | src/w32console.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/w32console.c b/src/w32console.c index 3c200405cb5..49bf56ddee9 100644 --- a/src/w32console.c +++ b/src/w32console.c @@ -705,7 +705,9 @@ initialize_w32_display (struct terminal *term) DEFUN ("set-screen-color", Fset_screen_color, Sset_screen_color, 2, 2, 0, - doc: /* Set screen colors. */) + doc: /* Set screen foreground and background colors. + +Arguments should be indices between 0 and 15, see w32console.el. */) (Lisp_Object foreground, Lisp_Object background) { char_attr_normal = XFASTINT (foreground) + (XFASTINT (background) << 4); @@ -714,6 +716,18 @@ DEFUN ("set-screen-color", Fset_screen_color, Sset_screen_color, 2, 2, 0, return Qt; } +DEFUN ("get-screen-color", Fget_screen_color, Sget_screen_color, 0, 0, 0, + doc: /* Get color indices of the current screen foreground and background. + +The colors are returned as a list of 2 indices (FOREGROUND BACKGROUND). +See w32console.el and `tty-defined-color-alist' for mapping of indices +to colors. */) + (void) +{ + return Fcons (make_number (char_attr_normal & 0x000f), + Fcons (make_number ((char_attr_normal >> 4) & 0x000f), Qnil)); +} + DEFUN ("set-cursor-size", Fset_cursor_size, Sset_cursor_size, 1, 1, 0, doc: /* Set cursor size. */) (Lisp_Object size) @@ -739,6 +753,7 @@ scroll-back buffer. */); w32_use_full_screen_buffer = 0; defsubr (&Sset_screen_color); + defsubr (&Sget_screen_color); defsubr (&Sset_cursor_size); defsubr (&Sset_message_beep); } |