aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann1999-11-03 15:57:55 +0000
committerGerd Moellmann1999-11-03 15:57:55 +0000
commit5d7791b36af115b25025ffa7cda363474a193f61 (patch)
tree6e3a8fad7495fcd636988c02e4c1c070e002ed4a /src
parent0a5ebe4b761c443b9e165e75fe4f49eca1f107cc (diff)
downloademacs-5d7791b36af115b25025ffa7cda363474a193f61.tar.gz
emacs-5d7791b36af115b25025ffa7cda363474a193f61.zip
(Finternal_show_cursor): Change it to set the
cursor on/off, not toggle its state. (Finternal_show_cursor_p): New. (syms_of_display): Defsubr Sinternal_show_cursor_p.
Diffstat (limited to 'src')
-rw-r--r--src/dispnew.c45
1 files changed, 27 insertions, 18 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index 8b705698be5..e7e0d046b32 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5921,17 +5921,14 @@ For types not defined in VMS, use define emacs_term \"TYPE\".\n\
5921 ***********************************************************************/ 5921 ***********************************************************************/
5922 5922
5923DEFUN ("internal-show-cursor", Finternal_show_cursor, 5923DEFUN ("internal-show-cursor", Finternal_show_cursor,
5924 Sinternal_show_cursor, 0, 2, 0, 5924 Sinternal_show_cursor, 2, 2, 0,
5925 "Change visibility flag of the text cursor of WINDOW.\n\ 5925 "Set the cursor-visibility flag of WINDOW to SHOW.\n\
5926ON_P nil means toggle the flag. Otherwise, ON_P must be an integer,\n\ 5926WINDOW nil means use the selected window. SHOW non-nil means\n\
5927and the flag is set according to the value of ON_P. WINDOW nil or\n\ 5927show a cursor in WINDOW in the next redisplay. SHOW nil means\n\
5928omitted means use the selected window. The new cursor state takes effect\n\ 5928don't show a cursor.")
5929with the next redisplay.") 5929 (window, show)
5930 (on_p, window) 5930 Lisp_Object window, show;
5931 Lisp_Object on_p, window;
5932{ 5931{
5933 struct window *w;
5934
5935 /* Don't change cursor state while redisplaying. This could confuse 5932 /* Don't change cursor state while redisplaying. This could confuse
5936 output routines. */ 5933 output routines. */
5937 if (!redisplaying_p) 5934 if (!redisplaying_p)
@@ -5940,21 +5937,32 @@ with the next redisplay.")
5940 window = selected_window; 5937 window = selected_window;
5941 else 5938 else
5942 CHECK_WINDOW (window, 2); 5939 CHECK_WINDOW (window, 2);
5943 w = XWINDOW (window);
5944 5940
5945 if (NILP (on_p)) 5941 XWINDOW (window)->cursor_off_p = NILP (show);
5946 w->cursor_off_p = !w->cursor_off_p;
5947 else
5948 {
5949 CHECK_NUMBER (on_p, 1);
5950 w->cursor_off_p = XINT (on_p) != 0;
5951 }
5952 } 5942 }
5953 5943
5954 return Qnil; 5944 return Qnil;
5955} 5945}
5956 5946
5957 5947
5948DEFUN ("internal-show-cursor-p", Finternal_show_cursor_p,
5949 Sinternal_show_cursor_p, 0, 1, 0,
5950 "Value is non-nil if next redisplay will display a cursor in WINDOW.
5951WINDOW nil or omitted means report on the selected window.")
5952 (window)
5953 Lisp_Object window;
5954{
5955 struct window *w;
5956
5957 if (NILP (window))
5958 window = selected_window;
5959 else
5960 CHECK_WINDOW (window, 2);
5961
5962 w = XWINDOW (window);
5963 return w->cursor_off_p ? Qnil : Qt;
5964}
5965
5958 5966
5959/*********************************************************************** 5967/***********************************************************************
5960 Initialization 5968 Initialization
@@ -5972,6 +5980,7 @@ syms_of_display ()
5972 defsubr (&Ssleep_for); 5980 defsubr (&Ssleep_for);
5973 defsubr (&Ssend_string_to_terminal); 5981 defsubr (&Ssend_string_to_terminal);
5974 defsubr (&Sinternal_show_cursor); 5982 defsubr (&Sinternal_show_cursor);
5983 defsubr (&Sinternal_show_cursor_p);
5975 5984
5976 frame_and_buffer_state = Fmake_vector (make_number (20), Qlambda); 5985 frame_and_buffer_state = Fmake_vector (make_number (20), Qlambda);
5977 staticpro (&frame_and_buffer_state); 5986 staticpro (&frame_and_buffer_state);