]> code.delx.au - gnu-emacs/commitdiff
(visible_cursor): New boolean var.
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 30 Dec 2005 21:48:35 +0000 (21:48 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 30 Dec 2005 21:48:35 +0000 (21:48 +0000)
(set_terminal_modes, tty_show_cursor): Use "vs" or "ve" depending on
visible_cursor.
(syms_of_term): Export the new var as "visible-cursor".

src/ChangeLog
src/term.c

index fb9023849696a384873c12b49652595e0a0742d8..b1fc39a4100596e88d772f721e7441629eebb88e 100644 (file)
@@ -1,3 +1,10 @@
+2005-12-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * term.c (visible_cursor): New boolean var.
+       (set_terminal_modes, tty_show_cursor): Use "vs" or "ve" depending on
+       visible_cursor.
+       (syms_of_term): Export the new var as "visible-cursor".
+
 2005-12-30  Eli Zaretskii  <eliz@gnu.org>
 
        * .gdbinit: Tell users not to worry about GDB warnings that some
index e53e5f78306eb33b36d90d16753fdb0bc4b4a4e8..e2c2fc39fc5ec6b0fa11a1fc2ddc13e28a3b8622 100644 (file)
@@ -87,6 +87,10 @@ extern Lisp_Object Qspace, QCalign_to, QCwidth;
 
 Lisp_Object Vring_bell_function;
 
+/* If true, use "vs", otherwise use "ve" to make the cursor visible.  */
+
+static int visible_cursor;
+
 /* Terminal characteristics that higher levels want to look at.
    These are all extern'd in termchar.h */
 
@@ -460,7 +464,7 @@ set_terminal_modes ()
            putchar ('\n');
        }
 
-      OUTPUT_IF (TS_cursor_visible);
+      OUTPUT_IF (visible_cursor ? TS_cursor_visible : TS_cursor_normal);
       OUTPUT_IF (TS_keypad_mode);
       losecursor ();
     }
@@ -615,7 +619,8 @@ tty_show_cursor ()
     {
       tty_cursor_hidden = 0;
       OUTPUT_IF (TS_cursor_normal);
-      OUTPUT_IF (TS_cursor_visible);
+      if (visible_cursor)
+       OUTPUT_IF (TS_cursor_visible);
     }
 }
 
@@ -2726,6 +2731,13 @@ This variable can be used by terminal emulator packages.  */);
 The function should accept no arguments.  */);
   Vring_bell_function = Qnil;
 
+  DEFVAR_BOOL ("visible-cursor", &visible_cursor,
+              doc: /* Non-nil means to make the cursor very visible.
+This only has an effect when running in a text terminal.
+What means \"very visible\" is up to your terminal.  It may make the cursor
+bigger, or it may make it blink, or it may do nothing at all.  */);
+  visible_cursor = 1;
+
   defsubr (&Stty_display_color_p);
   defsubr (&Stty_display_color_cells);
   defsubr (&Stty_no_underline);