aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2002-08-27 18:45:01 +0000
committerRichard M. Stallman2002-08-27 18:45:01 +0000
commit0a1c83e745cfaca794d9a0dd4a3b63eeda8b3e21 (patch)
treeb1c307a0f2f1ccd9d429754420a27099b545cc4d /src
parentcc9caa329f8e22a03f5a8fcdd3595641e7df8052 (diff)
downloademacs-0a1c83e745cfaca794d9a0dd4a3b63eeda8b3e21.tar.gz
emacs-0a1c83e745cfaca794d9a0dd4a3b63eeda8b3e21.zip
(x_set_cursor_type): Set FRAME_BLINK_OFF_CURSOR and
FRAME_BLINK_OFF_CURSOR_WIDTH using defaults and Vblink_cursor_alist. (Vblink_cursor_alist): New variable. (syms_of_xfns): Initialize and defvar it. (x_specified_cursor_type): Recognize Qbox for filled box. Exceptions are hollow boxes. (Qbox, Qhollow): New variables. (syms_of_xfns): Initialize and staticpro them.
Diffstat (limited to 'src')
-rw-r--r--src/xfns.c44
1 files changed, 41 insertions, 3 deletions
diff --git a/src/xfns.c b/src/xfns.c
index 4f23af432c8..caa54d97e2c 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -183,9 +183,12 @@ Lisp_Object Vx_bitmap_file_path;
183 183
184Lisp_Object Vx_pixel_size_width_font_regexp; 184Lisp_Object Vx_pixel_size_width_font_regexp;
185 185
186/* How to blink the cursor off. */
187Lisp_Object Vblink_cursor_alist;
188
186Lisp_Object Qauto_raise; 189Lisp_Object Qauto_raise;
187Lisp_Object Qauto_lower; 190Lisp_Object Qauto_lower;
188Lisp_Object Qbar, Qhbar; 191Lisp_Object Qbar, Qhbar, Qbox, Qhollow;
189Lisp_Object Qborder_color; 192Lisp_Object Qborder_color;
190Lisp_Object Qborder_width; 193Lisp_Object Qborder_width;
191Lisp_Object Qbox; 194Lisp_Object Qbox;
@@ -1873,11 +1876,13 @@ x_specified_cursor_type (arg, width)
1873 } 1876 }
1874 else if (NILP (arg)) 1877 else if (NILP (arg))
1875 type = NO_CURSOR; 1878 type = NO_CURSOR;
1879 else if (EQ (arg, Qbox))
1880 type = FILLED_BOX_CURSOR;
1876 else 1881 else
1877 /* Treat anything unknown as "box cursor". 1882 /* Treat anything unknown as "hollow box cursor".
1878 It was bad to signal an error; people have trouble fixing 1883 It was bad to signal an error; people have trouble fixing
1879 .Xdefaults with Emacs, when it has something bad in it. */ 1884 .Xdefaults with Emacs, when it has something bad in it. */
1880 type = FILLED_BOX_CURSOR; 1885 type = HOLLOW_BOX_CURSOR;
1881 1886
1882 return type; 1887 return type;
1883} 1888}
@@ -1888,12 +1893,33 @@ x_set_cursor_type (f, arg, oldval)
1888 Lisp_Object arg, oldval; 1893 Lisp_Object arg, oldval;
1889{ 1894{
1890 int width; 1895 int width;
1896 Lisp_Object tem;
1891 1897
1892 FRAME_DESIRED_CURSOR (f) = x_specified_cursor_type (arg, &width); 1898 FRAME_DESIRED_CURSOR (f) = x_specified_cursor_type (arg, &width);
1893 f->output_data.x->cursor_width = width; 1899 f->output_data.x->cursor_width = width;
1894 1900
1895 /* Make sure the cursor gets redrawn. */ 1901 /* Make sure the cursor gets redrawn. */
1896 cursor_type_changed = 1; 1902 cursor_type_changed = 1;
1903
1904 /* By default, set up the blink-off state depending on the on-state. */
1905
1906 if (FRAME_DESIRED_CURSOR (f) == FILLED_BOX_CURSOR)
1907 FRAME_BLINK_OFF_CURSOR (f) = HOLLOW_BOX_CURSOR;
1908 else if (FRAME_DESIRED_CURSOR (f) == BAR_CURSOR && FRAME_CURSOR_WIDTH (f) > 1)
1909 {
1910 FRAME_BLINK_OFF_CURSOR (f) = BAR_CURSOR;
1911 FRAME_BLINK_OFF_CURSOR_WIDTH (f) = 1;
1912 }
1913 else
1914 FRAME_BLINK_OFF_CURSOR (f) = NO_CURSOR;
1915
1916 tem = Fassoc (arg, Vblink_cursor_alist);
1917 if (!NILP (tem))
1918 {
1919 FRAME_BLINK_OFF_CURSOR (f)
1920 = x_specified_cursor_type (XCDR (tem), &width);
1921 f->output_data.x->blink_off_cursor_width = width;
1922 }
1897} 1923}
1898 1924
1899void 1925void
@@ -11844,6 +11870,10 @@ syms_of_xfns ()
11844 staticpro (&Qbar); 11870 staticpro (&Qbar);
11845 Qhbar = intern ("hbar"); 11871 Qhbar = intern ("hbar");
11846 staticpro (&Qhbar); 11872 staticpro (&Qhbar);
11873 Qbox = intern ("box");
11874 staticpro (&Qbox);
11875 Qhollow = intern ("hollow");
11876 staticpro (&Qhollow);
11847 Qborder_color = intern ("border-color"); 11877 Qborder_color = intern ("border-color");
11848 staticpro (&Qborder_color); 11878 staticpro (&Qborder_color);
11849 Qborder_width = intern ("border-width"); 11879 Qborder_width = intern ("border-width");
@@ -11954,6 +11984,14 @@ syms_of_xfns ()
11954 11984
11955 init_x_parm_symbols (); 11985 init_x_parm_symbols ();
11956 11986
11987 DEFVAR_LISP ("blink-cursor-alist", &Vblink_cursor_alist,
11988 doc: /* Alist specifying how to blink the cursor off.
11989Each element has the form (ON-STATE . OFF-STATE). Whenever the
11990`cursor-type' frame-parameter or variable equals ON-STATE,
11991comparing using `equal', Emacs uses OFF-STATE to specify
11992how to blink it off. */);
11993 Vblink_cursor_alist = Qnil;
11994
11957 DEFVAR_BOOL ("cross-disabled-images", &cross_disabled_images, 11995 DEFVAR_BOOL ("cross-disabled-images", &cross_disabled_images,
11958 doc: /* Non-nil means always draw a cross over disabled images. 11996 doc: /* Non-nil means always draw a cross over disabled images.
11959Disabled images are those having an `:conversion disabled' property. 11997Disabled images are those having an `:conversion disabled' property.