comparison src/keyboard.c @ 30200:ff33a5770282

(show_help_echo): Use eval_form. Add comment.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 13 Jul 2000 23:44:43 +0000
parents 78677e36a8a3
children f45d26144129
comparison
equal deleted inserted replaced
30199:298f10cd4ba5 30200:ff33a5770282
1898 c |= (upper & ~ctrl_modifier); 1898 c |= (upper & ~ctrl_modifier);
1899 1899
1900 return c; 1900 return c;
1901 } 1901 }
1902 1902
1903 /* Display a help message in the echo area. */ 1903 /* Display help echo in the echo area.
1904
1905 MSG a string means display that string, MSG nil means clear the
1906 help echo. If MSG is neither a string nor nil, it is evaluated
1907 to obtain a string.
1908
1909 OK_TO_IVERWRITE_KEYSTROKE_ECHO non-zero means it's okay if the help
1910 echo overwrites a keystroke echo currently displayed in the echo
1911 area.
1912
1913 Note: this function may only be called with MSG being nil or
1914 a string from X code running asynchronously. */
1915
1904 void 1916 void
1905 show_help_echo (msg, ok_to_overwrite_keystroke_echo) 1917 show_help_echo (msg, ok_to_overwrite_keystroke_echo)
1906 Lisp_Object msg; 1918 Lisp_Object msg;
1907 int ok_to_overwrite_keystroke_echo; 1919 int ok_to_overwrite_keystroke_echo;
1908 { 1920 {
1909 int count = specpdl_ptr - specpdl; 1921 if (!NILP (msg) && !STRINGP (msg))
1910 1922 {
1911 specbind (Qmessage_truncate_lines, Qt); 1923 msg = eval_form (msg);
1912 if (CONSP (msg)) 1924 if (!STRINGP (msg))
1913 msg = Feval (msg); 1925 return;
1914 1926 }
1915 if (!NILP (Vshow_help_function)) 1927
1916 call1 (Vshow_help_function, msg); 1928 if (STRINGP (msg) || NILP (msg))
1917 else if (/* Don't overwrite minibuffer contents. */ 1929 {
1918 !MINI_WINDOW_P (XWINDOW (selected_window)) 1930 if (!NILP (Vshow_help_function))
1919 /* Don't overwrite a keystroke echo. */ 1931 call1 (Vshow_help_function, msg);
1920 && (NILP (echo_message_buffer) || ok_to_overwrite_keystroke_echo) 1932 else if (/* Don't overwrite minibuffer contents. */
1921 /* Don't overwrite a prompt. */ 1933 !MINI_WINDOW_P (XWINDOW (selected_window))
1922 && !cursor_in_echo_area) 1934 /* Don't overwrite a keystroke echo. */
1923 { 1935 && (NILP (echo_message_buffer) || ok_to_overwrite_keystroke_echo)
1924 if (STRINGP (msg)) 1936 /* Don't overwrite a prompt. */
1925 message3_nolog (msg, XSTRING (msg)->size, STRING_MULTIBYTE (msg)); 1937 && !cursor_in_echo_area)
1926 else 1938 {
1927 message (0); 1939 if (STRINGP (msg))
1928 } 1940 {
1929 1941 int count = specpdl_ptr - specpdl;
1930 unbind_to (count, Qnil); 1942 specbind (Qmessage_truncate_lines, Qt);
1943 message3_nolog (msg, XSTRING (msg)->size, STRING_MULTIBYTE (msg));
1944 unbind_to (count, Qnil);
1945 }
1946 else
1947 message (0);
1948 }
1949 }
1931 } 1950 }
1932 1951
1933 1952
1934 1953
1935 /* Input of single characters from keyboard */ 1954 /* Input of single characters from keyboard */
9369 waiting_for_input = 0; 9388 waiting_for_input = 0;
9370 input_available_clear_time = 0; 9389 input_available_clear_time = 0;
9371 } 9390 }
9372 9391
9373 /* This routine is called at interrupt level in response to C-G. 9392 /* This routine is called at interrupt level in response to C-G.
9374 If interrupt_input, this is the handler for SIGINT. 9393
9375 Otherwise, it is called from kbd_buffer_store_event, 9394 If interrupt_input, this is the handler for SIGINT. Otherwise, it
9376 in handling SIGIO or SIGTINT. 9395 is called from kbd_buffer_store_event, in handling SIGIO or
9377 9396 SIGTINT.
9378 If `waiting_for_input' is non zero, then unless `echoing' is nonzero, 9397
9379 immediately throw back to read_char. 9398 If `waiting_for_input' is non zero, then unless `echoing' is
9380 9399 nonzero, immediately throw back to read_char.
9381 Otherwise it sets the Lisp variable quit-flag not-nil. 9400
9382 This causes eval to throw, when it gets a chance. 9401 Otherwise it sets the Lisp variable quit-flag not-nil. This causes
9383 If quit-flag is already non-nil, it stops the job right away. */ 9402 eval to throw, when it gets a chance. If quit-flag is already
9403 non-nil, it stops the job right away. */
9384 9404
9385 SIGTYPE 9405 SIGTYPE
9386 interrupt_signal (signalnum) /* If we don't have an argument, */ 9406 interrupt_signal (signalnum) /* If we don't have an argument, */
9387 int signalnum; /* some compilers complain in signal calls. */ 9407 int signalnum; /* some compilers complain in signal calls. */
9388 { 9408 {