diff options
| author | Gerd Moellmann | 2001-08-09 13:01:38 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-08-09 13:01:38 +0000 |
| commit | f0c1cc56a032bf5a6bbaa4850bc68608521b375f (patch) | |
| tree | 463c1a03705d7b28b6178314988fa1909da8ee12 /src | |
| parent | eaa2319f354bcab70e7cb543b769b78c17816265 (diff) | |
| download | emacs-f0c1cc56a032bf5a6bbaa4850bc68608521b375f.tar.gz emacs-f0c1cc56a032bf5a6bbaa4850bc68608521b375f.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 754df8bbda1..8043d71c168 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -190,13 +190,21 @@ extern struct backtrace *backtrace_list; | |||
| 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. */ |
| @@ -2030,14 +2038,25 @@ show_help_echo (help, window, object, pos, ok_to_overwrite_keystroke_echo) | |||
| 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); |
| @@ -10165,9 +10184,12 @@ struct event_head head_table[] = { | |||
| 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); |