Mercurial > emacs
comparison src/keyboard.c @ 38751:ea3e88f0c205
(Vpre_help_message): New variable.
(syms_of_keyboard): Initialize and staticpro it.
(show_help_echo): Record current message before displaying a
help-echo, and restore that message when clearing the help.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Thu, 09 Aug 2001 13:01:38 +0000 |
parents | 8e0b0d76380a |
children | 005ef8b3f8a7 |
comparison
equal
deleted
inserted
replaced
38750:b9f580ca37a0 | 38751:ea3e88f0c205 |
---|---|
188 /* If non-nil, the function that implements the display of help. | 188 /* If non-nil, the function that implements the display of help. |
189 It's called with one argument, the help string to display. */ | 189 It's called with one argument, the help string to display. */ |
190 | 190 |
191 Lisp_Object Vshow_help_function; | 191 Lisp_Object Vshow_help_function; |
192 | 192 |
193 /* If a string, the message displayed before displaying a help-echo | |
194 in the echo area. */ | |
195 | |
196 Lisp_Object Vpre_help_message; | |
197 | |
193 /* Nonzero means do menu prompting. */ | 198 /* Nonzero means do menu prompting. */ |
199 | |
194 static int menu_prompting; | 200 static int menu_prompting; |
195 | 201 |
196 /* Character to see next line of menu prompt. */ | 202 /* Character to see next line of menu prompt. */ |
203 | |
197 static Lisp_Object menu_prompt_more_char; | 204 static Lisp_Object menu_prompt_more_char; |
198 | 205 |
199 /* For longjmp to where kbd input is being done. */ | 206 /* For longjmp to where kbd input is being done. */ |
207 | |
200 static jmp_buf getcjmp; | 208 static jmp_buf getcjmp; |
201 | 209 |
202 /* True while doing kbd input. */ | 210 /* True while doing kbd input. */ |
203 int waiting_for_input; | 211 int waiting_for_input; |
204 | 212 |
2028 /* Don't overwrite a prompt. */ | 2036 /* Don't overwrite a prompt. */ |
2029 && !cursor_in_echo_area) | 2037 && !cursor_in_echo_area) |
2030 { | 2038 { |
2031 if (STRINGP (help)) | 2039 if (STRINGP (help)) |
2032 { | 2040 { |
2033 int count = specpdl_ptr - specpdl; | 2041 int count = BINDING_STACK_SIZE (); |
2042 | |
2043 if (!help_echo_showing_p) | |
2044 Vpre_help_message = current_message (); | |
2045 | |
2034 specbind (Qmessage_truncate_lines, Qt); | 2046 specbind (Qmessage_truncate_lines, Qt); |
2035 message3_nolog (help, STRING_BYTES (XSTRING (help)), | 2047 message3_nolog (help, STRING_BYTES (XSTRING (help)), |
2036 STRING_MULTIBYTE (help)); | 2048 STRING_MULTIBYTE (help)); |
2037 unbind_to (count, Qnil); | 2049 unbind_to (count, Qnil); |
2038 } | 2050 } |
2051 else if (STRINGP (Vpre_help_message)) | |
2052 { | |
2053 message3_nolog (Vpre_help_message, | |
2054 STRING_BYTES (XSTRING (Vpre_help_message)), | |
2055 STRING_MULTIBYTE (Vpre_help_message)); | |
2056 Vpre_help_message = Qnil; | |
2057 } | |
2039 else | 2058 else |
2040 message (0); | 2059 message (0); |
2041 } | 2060 } |
2042 | 2061 |
2043 help_echo_showing_p = STRINGP (help); | 2062 help_echo_showing_p = STRINGP (help); |
2044 } | 2063 } |
2045 } | 2064 } |
10163 }; | 10182 }; |
10164 | 10183 |
10165 void | 10184 void |
10166 syms_of_keyboard () | 10185 syms_of_keyboard () |
10167 { | 10186 { |
10187 Vpre_help_message = Qnil; | |
10188 staticpro (&Vpre_help_message); | |
10189 | |
10168 Vlispy_mouse_stem = build_string ("mouse"); | 10190 Vlispy_mouse_stem = build_string ("mouse"); |
10169 staticpro (&Vlispy_mouse_stem); | 10191 staticpro (&Vlispy_mouse_stem); |
10170 | 10192 |
10171 /* Tool-bars. */ | 10193 /* Tool-bars. */ |
10172 QCimage = intern (":image"); | 10194 QCimage = intern (":image"); |
10173 staticpro (&QCimage); | 10195 staticpro (&QCimage); |
10174 | 10196 |
10175 staticpro (&Qhelp_echo); | 10197 staticpro (&Qhelp_echo); |