aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-07-13 23:44:43 +0000
committerGerd Moellmann2000-07-13 23:44:43 +0000
commitd4e68eea307b1fe750902169ec5034d35e43e629 (patch)
tree5ea17cbba3c373115f087dac9a57358e6e62b1ce /src
parent7e8895100b70c297c0c9d194415bb99aaf0de032 (diff)
downloademacs-d4e68eea307b1fe750902169ec5034d35e43e629.tar.gz
emacs-d4e68eea307b1fe750902169ec5034d35e43e629.zip
(show_help_echo): Use eval_form. Add comment.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c78
1 files changed, 49 insertions, 29 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index b132075cf6b..2442b8823c1 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1900,34 +1900,53 @@ make_ctrl_char (c)
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
1904void 1916void
1905show_help_echo (msg, ok_to_overwrite_keystroke_echo) 1917show_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
1915 if (!NILP (Vshow_help_function))
1916 call1 (Vshow_help_function, msg);
1917 else if (/* Don't overwrite minibuffer contents. */
1918 !MINI_WINDOW_P (XWINDOW (selected_window))
1919 /* Don't overwrite a keystroke echo. */
1920 && (NILP (echo_message_buffer) || ok_to_overwrite_keystroke_echo)
1921 /* Don't overwrite a prompt. */
1922 && !cursor_in_echo_area)
1923 {
1924 if (STRINGP (msg))
1925 message3_nolog (msg, XSTRING (msg)->size, STRING_MULTIBYTE (msg));
1926 else
1927 message (0);
1928 } 1926 }
1929 1927
1930 unbind_to (count, Qnil); 1928 if (STRINGP (msg) || NILP (msg))
1929 {
1930 if (!NILP (Vshow_help_function))
1931 call1 (Vshow_help_function, msg);
1932 else if (/* Don't overwrite minibuffer contents. */
1933 !MINI_WINDOW_P (XWINDOW (selected_window))
1934 /* Don't overwrite a keystroke echo. */
1935 && (NILP (echo_message_buffer) || ok_to_overwrite_keystroke_echo)
1936 /* Don't overwrite a prompt. */
1937 && !cursor_in_echo_area)
1938 {
1939 if (STRINGP (msg))
1940 {
1941 int count = specpdl_ptr - specpdl;
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
@@ -9371,16 +9390,17 @@ clear_waiting_for_input ()
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
9396 SIGTINT.
9377 9397
9378 If `waiting_for_input' is non zero, then unless `echoing' is nonzero, 9398 If `waiting_for_input' is non zero, then unless `echoing' is
9379 immediately throw back to read_char. 9399 nonzero, immediately throw back to read_char.
9380 9400
9381 Otherwise it sets the Lisp variable quit-flag not-nil. 9401 Otherwise it sets the Lisp variable quit-flag not-nil. This causes
9382 This causes eval to throw, when it gets a chance. 9402 eval to throw, when it gets a chance. If quit-flag is already
9383 If quit-flag is already non-nil, it stops the job right away. */ 9403 non-nil, it stops the job right away. */
9384 9404
9385SIGTYPE 9405SIGTYPE
9386interrupt_signal (signalnum) /* If we don't have an argument, */ 9406interrupt_signal (signalnum) /* If we don't have an argument, */