* src/font.c (font_find_for_lface) [HAVE_NS]: Ignore case.
[bpt/emacs.git] / src / w32console.c
index 31c4a7c..30c71f1 100644 (file)
@@ -41,12 +41,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 /* from window.c */
 extern Lisp_Object Frecenter (Lisp_Object);
 
-/* from keyboard.c */
-extern int detect_input_pending (void);
-
-/* from sysdep.c */
-extern int read_input_pending (void);
-
 static void w32con_move_cursor (struct frame *f, int row, int col);
 static void w32con_clear_to_end (struct frame *f);
 static void w32con_clear_frame (struct frame *f);
@@ -277,9 +271,6 @@ w32con_insert_glyphs (struct frame *f, register struct glyph *start,
     }
 }
 
-extern unsigned char *encode_terminal_code (struct glyph *, int,
-                                            struct coding_system *);
-
 static void
 w32con_write_glyphs (struct frame *f, register struct glyph *string,
                      register int len)
@@ -714,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);
@@ -723,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)
@@ -743,12 +748,12 @@ syms_of_ntterm (void)
               doc: /* Non-nil means make terminal frames use the full screen buffer dimensions.
 This is desirable when running Emacs over telnet.
 A value of nil means use the current console window dimensions; this
-may be preferrable when working directly at the console with a large
+may be preferable when working directly at the console with a large
 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);
 }
-