Mercurial > emacs
changeset 12144:12720a817d83
(Vhelp_event_list): New var.
(syms_of_keyboard): Set up Lisp var.
(help_char_p): New function.
(read_char, echo_char, read_key_sequence): Use help_char_p.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Fri, 09 Jun 1995 00:55:30 +0000 |
parents | 4aa248ba0abb |
children | bd3e59a5c0b3 |
files | src/keyboard.c |
diffstat | 1 files changed, 27 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/keyboard.c Fri Jun 09 00:53:44 1995 +0000 +++ b/src/keyboard.c Fri Jun 09 00:55:30 1995 +0000 @@ -148,6 +148,9 @@ /* Character to recognize as the help char. */ Lisp_Object Vhelp_char; +/* List of other event types to recognize as meaning "help". */ +Lisp_Object Vhelp_event_list; + /* Form to execute when help char is typed. */ Lisp_Object Vhelp_form; @@ -563,7 +566,7 @@ } if (current_kboard->echoptr == current_kboard->echobuf - && EQ (c, Vhelp_char)) + && help_char_p (c)) { strcpy (ptr, " (Type ? for further options)"); ptr += strlen (ptr); @@ -2050,7 +2053,7 @@ num_input_chars++; /* Process the help character specially if enabled */ - if (EQ (c, Vhelp_char) && !NILP (Vhelp_form)) + if (!NILP (Vhelp_form) && help_char_p (c)) { Lisp_Object tem0; count = specpdl_ptr - specpdl; @@ -2082,6 +2085,22 @@ return c; } +/* Return 1 if should recognize C as "the help character". */ + +int +help_char_p (c) + Lisp_Object c; +{ + Lisp_Object tail; + + if (EQ (c, Vhelp_char)) + return 1; + for (tail = Vhelp_event_list; CONSP (tail); tail = XCONS (tail)->cdr) + if (EQ (c, XCONS (tail)->car)) + return 1; + return 0; +} + /* Record the input event C in various ways. */ static void @@ -5444,7 +5463,7 @@ Lisp_Object head; head = EVENT_HEAD (key); - if (EQ (head, Vhelp_char)) + if (help_char_p (head)) { read_key_sequence_cmd = Vprefix_help_command; keybuf[t++] = key; @@ -6965,6 +6984,11 @@ If the value of `help-form' is nil, this char can be read normally."); XSETINT (Vhelp_char, Ctl ('H')); + DEFVAR_LISP ("help-event-list", &Vhelp_event_list, + "List of input events to recognize as meaning Help.\n\ +These work just like the value of `help-char' (see that)."); + Vhelp_event_list = Qnil; + DEFVAR_LISP ("help-form", &Vhelp_form, "Form to execute when character `help-char' is read.\n\ If the form returns a string, that string is displayed.\n\