diff options
| -rw-r--r-- | src/w32fns.c | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 9e1602e8d6c..9901734a4eb 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -202,9 +202,12 @@ Lisp_Object Vw32_charset_info_alist; | |||
| 202 | #define VIETNAMESE_CHARSET 163 | 202 | #define VIETNAMESE_CHARSET 163 |
| 203 | #endif | 203 | #endif |
| 204 | 204 | ||
| 205 | /* How to blink the cursor off. */ | ||
| 206 | Lisp_Object Vblink_cursor_alist; | ||
| 207 | |||
| 205 | Lisp_Object Qauto_raise; | 208 | Lisp_Object Qauto_raise; |
| 206 | Lisp_Object Qauto_lower; | 209 | Lisp_Object Qauto_lower; |
| 207 | Lisp_Object Qbar, Qhbar; | 210 | Lisp_Object Qbar, Qhbar, Qbox, Qhollow; |
| 208 | Lisp_Object Qborder_color; | 211 | Lisp_Object Qborder_color; |
| 209 | Lisp_Object Qborder_width; | 212 | Lisp_Object Qborder_width; |
| 210 | Lisp_Object Qbox; | 213 | Lisp_Object Qbox; |
| @@ -2386,11 +2389,13 @@ x_specified_cursor_type (arg, width) | |||
| 2386 | } | 2389 | } |
| 2387 | else if (NILP (arg)) | 2390 | else if (NILP (arg)) |
| 2388 | type = NO_CURSOR; | 2391 | type = NO_CURSOR; |
| 2392 | else if (EQ (arg, Qbox)) | ||
| 2393 | type = FILLED_BOX_CURSOR; | ||
| 2389 | else | 2394 | else |
| 2390 | /* Treat anything unknown as "box cursor". | 2395 | /* Treat anything unknown as "hollow box cursor". |
| 2391 | It was bad to signal an error; people have trouble fixing | 2396 | It was bad to signal an error; people have trouble fixing |
| 2392 | .Xdefaults with Emacs, when it has something bad in it. */ | 2397 | .Xdefaults with Emacs, when it has something bad in it. */ |
| 2393 | type = FILLED_BOX_CURSOR; | 2398 | type = HOLLOW_BOX_CURSOR; |
| 2394 | 2399 | ||
| 2395 | return type; | 2400 | return type; |
| 2396 | } | 2401 | } |
| @@ -2401,13 +2406,34 @@ x_set_cursor_type (f, arg, oldval) | |||
| 2401 | Lisp_Object arg, oldval; | 2406 | Lisp_Object arg, oldval; |
| 2402 | { | 2407 | { |
| 2403 | int width; | 2408 | int width; |
| 2404 | 2409 | Lisp_Object tem; | |
| 2410 | |||
| 2405 | FRAME_DESIRED_CURSOR (f) = x_specified_cursor_type (arg, &width); | 2411 | FRAME_DESIRED_CURSOR (f) = x_specified_cursor_type (arg, &width); |
| 2406 | f->output_data.w32->cursor_width = width; | 2412 | f->output_data.w32->cursor_width = width; |
| 2407 | 2413 | ||
| 2408 | /* Make sure the cursor gets redrawn. This is overkill, but how | 2414 | /* Make sure the cursor gets redrawn. This is overkill, but how |
| 2409 | often do people change cursor types? */ | 2415 | often do people change cursor types? */ |
| 2410 | update_mode_lines++; | 2416 | update_mode_lines++; |
| 2417 | |||
| 2418 | /* By default, set up the blink-off state depending on the on-state. */ | ||
| 2419 | |||
| 2420 | if (FRAME_DESIRED_CURSOR (f) == FILLED_BOX_CURSOR) | ||
| 2421 | FRAME_BLINK_OFF_CURSOR (f) = HOLLOW_BOX_CURSOR; | ||
| 2422 | else if (FRAME_DESIRED_CURSOR (f) == BAR_CURSOR && FRAME_CURSOR_WIDTH (f) > 1) | ||
| 2423 | { | ||
| 2424 | FRAME_BLINK_OFF_CURSOR (f) = BAR_CURSOR; | ||
| 2425 | FRAME_BLINK_OFF_CURSOR_WIDTH (f) = 1; | ||
| 2426 | } | ||
| 2427 | else | ||
| 2428 | FRAME_BLINK_OFF_CURSOR (f) = NO_CURSOR; | ||
| 2429 | |||
| 2430 | tem = Fassoc (arg, Vblink_cursor_alist); | ||
| 2431 | if (!NILP (tem)) | ||
| 2432 | { | ||
| 2433 | FRAME_BLINK_OFF_CURSOR (f) | ||
| 2434 | = x_specified_cursor_type (XCDR (tem), &width); | ||
| 2435 | f->output_data.w32->blink_off_cursor_width = width; | ||
| 2436 | } | ||
| 2411 | } | 2437 | } |
| 2412 | 2438 | ||
| 2413 | void | 2439 | void |
| @@ -14870,6 +14896,10 @@ syms_of_w32fns () | |||
| 14870 | staticpro (&Qbar); | 14896 | staticpro (&Qbar); |
| 14871 | Qhbar = intern ("hbar"); | 14897 | Qhbar = intern ("hbar"); |
| 14872 | staticpro (&Qhbar); | 14898 | staticpro (&Qhbar); |
| 14899 | Qbox = intern ("box"); | ||
| 14900 | staticpro (&Qbox); | ||
| 14901 | Qhollow = intern ("hollow"); | ||
| 14902 | staticpro (&Qhollow); | ||
| 14873 | Qborder_color = intern ("border-color"); | 14903 | Qborder_color = intern ("border-color"); |
| 14874 | staticpro (&Qborder_color); | 14904 | staticpro (&Qborder_color); |
| 14875 | Qborder_width = intern ("border-width"); | 14905 | Qborder_width = intern ("border-width"); |
| @@ -15110,6 +15140,14 @@ system to handle them. */); | |||
| 15110 | 15140 | ||
| 15111 | init_x_parm_symbols (); | 15141 | init_x_parm_symbols (); |
| 15112 | 15142 | ||
| 15143 | DEFVAR_LISP ("blink-cursor-alist", &Vblink_cursor_alist, | ||
| 15144 | doc: /* Alist specifying how to blink the cursor off. | ||
| 15145 | Each element has the form (ON-STATE . OFF-STATE). Whenever the | ||
| 15146 | `cursor-type' frame-parameter or variable equals ON-STATE, | ||
| 15147 | comparing using `equal', Emacs uses OFF-STATE to specify | ||
| 15148 | how to blink it off. */); | ||
| 15149 | Vblink_cursor_alist = Qnil; | ||
| 15150 | |||
| 15113 | DEFVAR_LISP ("x-bitmap-file-path", &Vx_bitmap_file_path, | 15151 | DEFVAR_LISP ("x-bitmap-file-path", &Vx_bitmap_file_path, |
| 15114 | doc: /* List of directories to search for bitmap files for w32. */); | 15152 | doc: /* List of directories to search for bitmap files for w32. */); |
| 15115 | Vx_bitmap_file_path = decode_env_path ((char *) 0, "PATH"); | 15153 | Vx_bitmap_file_path = decode_env_path ((char *) 0, "PATH"); |