aboutsummaryrefslogtreecommitdiffstats
path: root/src/msdos.c
diff options
context:
space:
mode:
authorEli Zaretskii2000-04-12 15:46:49 +0000
committerEli Zaretskii2000-04-12 15:46:49 +0000
commit0c3cfc5194a6f76bb883866b05e3f3ee8be04bd3 (patch)
tree955a79bc0556f0634dc8431f42c53dcef0f27e83 /src/msdos.c
parent133f8c7149ca2a9203d5f8fda74b159236676a3d (diff)
downloademacs-0c3cfc5194a6f76bb883866b05e3f3ee8be04bd3.tar.gz
emacs-0c3cfc5194a6f76bb883866b05e3f3ee8be04bd3.zip
(NUM_MOUSE_BUTTONS): Define.
(IT_frame_up_to_date): Support the buffer local value of cursor-type, if defined.
Diffstat (limited to 'src/msdos.c')
-rw-r--r--src/msdos.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/msdos.c b/src/msdos.c
index 0351b04c027..d56ee7cf88d 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -124,6 +124,10 @@ event_timestamp ()
124 * Mouse buttons are numbered from left to right and also zero based. 124 * Mouse buttons are numbered from left to right and also zero based.
125 */ 125 */
126 126
127/* This used to be in termhooks.h, but mainstream Emacs code no longer
128 uses it, and it was removed... */
129#define NUM_MOUSE_BUTTONS (5)
130
127int have_mouse; /* 0: no, 1: enabled, -1: disabled */ 131int have_mouse; /* 0: no, 1: enabled, -1: disabled */
128static int mouse_visible; 132static int mouse_visible;
129 133
@@ -1898,6 +1902,8 @@ static void
1898IT_frame_up_to_date (struct frame *f) 1902IT_frame_up_to_date (struct frame *f)
1899{ 1903{
1900 struct display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 1904 struct display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
1905 Lisp_Object new_cursor, frame_desired_cursor;
1906 struct window *sw;
1901 1907
1902 if (dpyinfo->mouse_face_deferred_gc 1908 if (dpyinfo->mouse_face_deferred_gc
1903 || f == dpyinfo->mouse_face_mouse_frame) 1909 || f == dpyinfo->mouse_face_mouse_frame)
@@ -1911,8 +1917,32 @@ IT_frame_up_to_date (struct frame *f)
1911 UNBLOCK_INPUT; 1917 UNBLOCK_INPUT;
1912 } 1918 }
1913 1919
1914 /* Set the cursor type to whatever they wanted. */ 1920 /* Set the cursor type to whatever they wanted. In a minibuffer
1915 IT_set_cursor_type (f, Fcdr (Fassq (Qcursor_type, f->param_alist))); 1921 window, we want the cursor to appear only if we are reading input
1922 from this window, and we want the cursor to be taken from the
1923 frame parameters. For the selected window, we use either its
1924 buffer-local value or the value from the frame parameters if the
1925 buffer doesn't define its local value for the cursor type. */
1926 sw = XWINDOW (f->selected_window);
1927 frame_desired_cursor = Fcdr (Fassq (Qcursor_type, f->param_alist));
1928 if (cursor_in_echo_area
1929 && FRAME_HAS_MINIBUF_P (f)
1930 && EQ (FRAME_MINIBUF_WINDOW (f), echo_area_window)
1931 && sw == XWINDOW (echo_area_window))
1932 new_cursor = frame_desired_cursor;
1933 else
1934 {
1935 struct buffer *b = XBUFFER (sw->buffer);
1936
1937 if (EQ (b->cursor_type, Qt))
1938 new_cursor = frame_desired_cursor;
1939 else if (NILP (b->cursor_type)) /* nil means no cursor */
1940 new_cursor = Fcons (Qbar, make_number (0));
1941 else
1942 new_cursor = b->cursor_type;
1943 }
1944
1945 IT_set_cursor_type (f, new_cursor);
1916 1946
1917 IT_cmgoto (f); /* position cursor when update is done */ 1947 IT_cmgoto (f); /* position cursor when update is done */
1918} 1948}