aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2000-07-05 14:01:15 +0000
committerStefan Monnier2000-07-05 14:01:15 +0000
commit31f84d032894a5277d1d0f4a302baa3f6b4b3db4 (patch)
treed6e36bed7c280070ac8b57432b3008c18fea5f3d /src
parentb7e804134a3e947c3decbb0a6b02c092be3427f7 (diff)
downloademacs-31f84d032894a5277d1d0f4a302baa3f6b4b3db4.tar.gz
emacs-31f84d032894a5277d1d0f4a302baa3f6b4b3db4.zip
(show_help_echo): New function, extracted from read_char.
Feval its `msg' argument if it's a cons cell. (read_char): Use it. (follow_key): Pass `autoload' to get_keyelt.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c56
1 files changed, 32 insertions, 24 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index e777bdd770b..2674485f33c 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1895,6 +1895,35 @@ make_ctrl_char (c)
1895 return c; 1895 return c;
1896} 1896}
1897 1897
1898/* Display a help message in the echo area. */
1899void
1900show_help_echo (msg)
1901 Lisp_Object msg;
1902{
1903 int count = specpdl_ptr - specpdl;
1904
1905 specbind (Qmessage_truncate_lines, Qt);
1906 if (CONSP (msg))
1907 msg = Feval (msg);
1908
1909 if (!NILP (Vshow_help_function))
1910 call1 (Vshow_help_function, msg);
1911 else if (/* Don't overwrite minibuffer contents. */
1912 !MINI_WINDOW_P (XWINDOW (selected_window))
1913 /* Don't overwrite a keystroke echo. */
1914 && NILP (echo_message_buffer)
1915 /* Don't overwrite a prompt. */
1916 && !cursor_in_echo_area)
1917 {
1918 if (STRINGP (msg))
1919 message3_nolog (msg, XSTRING (msg)->size, STRING_MULTIBYTE (msg));
1920 else
1921 message (0);
1922 }
1923
1924 unbind_to (count, Qnil);
1925}
1926
1898 1927
1899 1928
1900/* Input of single characters from keyboard */ 1929/* Input of single characters from keyboard */
@@ -2639,28 +2668,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2639 /* Display help if not echoing. */ 2668 /* Display help if not echoing. */
2640 if (CONSP (c) && EQ (XCAR (c), Qhelp_echo)) 2669 if (CONSP (c) && EQ (XCAR (c), Qhelp_echo))
2641 { 2670 {
2642 Lisp_Object msg; 2671 show_help_echo (XCDR (XCDR (c)));
2643 int count = specpdl_ptr - specpdl;
2644
2645 specbind (Qmessage_truncate_lines, Qt);
2646 msg = XCDR (XCDR (c));
2647
2648 if (!NILP (Vshow_help_function))
2649 call1 (Vshow_help_function, msg);
2650 else if (/* Don't overwrite minibuffer contents. */
2651 !MINI_WINDOW_P (XWINDOW (selected_window))
2652 /* Don't overwrite a keystroke echo. */
2653 && NILP (echo_message_buffer)
2654 /* Don't overwrite a prompt. */
2655 && !cursor_in_echo_area)
2656 {
2657 if (STRINGP (msg))
2658 message3_nolog (msg, XSTRING (msg)->size, STRING_MULTIBYTE (msg));
2659 else
2660 message (0);
2661 }
2662
2663 unbind_to (count, Qnil);
2664 goto retry; 2672 goto retry;
2665 } 2673 }
2666 2674
@@ -6266,7 +6274,7 @@ parse_menu_item (item, notreal, inmenubar)
6266 item = XCDR (item); 6274 item = XCDR (item);
6267 } 6275 }
6268 6276
6269 /* Maybee key binding cache. */ 6277 /* Maybe key binding cache. */
6270 if (CONSP (item) && CONSP (XCAR (item)) 6278 if (CONSP (item) && CONSP (XCAR (item))
6271 && (NILP (XCAR (XCAR (item))) 6279 && (NILP (XCAR (XCAR (item)))
6272 || VECTORP (XCAR (XCAR (item))))) 6280 || VECTORP (XCAR (XCAR (item)))))
@@ -7370,7 +7378,7 @@ follow_key (key, nmaps, current, defs, next)
7370 else 7378 else
7371 map = current[i]; 7379 map = current[i];
7372 7380
7373 defs[i] = get_keyelt (access_keymap (map, key, 1, 0), 0); 7381 defs[i] = get_keyelt (access_keymap (map, key, 1, 0), 1);
7374 if (! NILP (defs[i])) 7382 if (! NILP (defs[i]))
7375 first_binding = i; 7383 first_binding = i;
7376 } 7384 }