diff options
| author | Stefan Kangas | 2022-10-05 15:23:39 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2022-10-05 15:23:39 +0200 |
| commit | 9449e0740cd97bbcdbaeb4713dc2dd51e65994fd (patch) | |
| tree | 13dd19a4aa8e40b228421f2d80a03e7e928bce9d /src | |
| parent | 1720ebecc7670903129de70fee1a72c875c42d95 (diff) | |
| download | emacs-9449e0740cd97bbcdbaeb4713dc2dd51e65994fd.tar.gz emacs-9449e0740cd97bbcdbaeb4713dc2dd51e65994fd.zip | |
Add face help-key-binding in help-char echo
* src/keyboard.c (echo_add_key): Add help-key-binding face to the
"?" key in 'help-char' echo. (Bug#57906)
(syms_of_keyboard) <Qhelp_key_binding>: New DEFSYM.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index da244904a4a..8ab4a451b45 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -499,27 +499,18 @@ echo_add_key (Lisp_Object c) | |||
| 499 | STRING_MULTIBYTE (name), 1); | 499 | STRING_MULTIBYTE (name), 1); |
| 500 | } | 500 | } |
| 501 | 501 | ||
| 502 | Lisp_Object new_string = make_string (buffer, ptr - buffer); | ||
| 502 | if ((NILP (echo_string) || SCHARS (echo_string) == 0) | 503 | if ((NILP (echo_string) || SCHARS (echo_string) == 0) |
| 503 | && help_char_p (c)) | 504 | && help_char_p (c)) |
| 504 | { | 505 | { |
| 505 | static const char text[] = " (Type ? for further options)"; | 506 | AUTO_STRING (str, " (Type ? for further options)"); |
| 506 | int len = sizeof text - 1; | 507 | AUTO_LIST2 (props, Qface, Qhelp_key_binding); |
| 507 | 508 | Fadd_text_properties (make_fixnum (7), make_fixnum (8), props, str); | |
| 508 | if (size - (ptr - buffer) < len) | 509 | new_string = concat2 (new_string, str); |
| 509 | { | ||
| 510 | ptrdiff_t offset = ptr - buffer; | ||
| 511 | size += len; | ||
| 512 | buffer = SAFE_ALLOCA (size); | ||
| 513 | ptr = buffer + offset; | ||
| 514 | } | ||
| 515 | |||
| 516 | memcpy (ptr, text, len); | ||
| 517 | ptr += len; | ||
| 518 | } | 510 | } |
| 519 | 511 | ||
| 520 | kset_echo_string | 512 | kset_echo_string (current_kboard, |
| 521 | (current_kboard, | 513 | concat2 (echo_string, new_string)); |
| 522 | concat2 (echo_string, make_string (buffer, ptr - buffer))); | ||
| 523 | SAFE_FREE (); | 514 | SAFE_FREE (); |
| 524 | } | 515 | } |
| 525 | 516 | ||
| @@ -12252,6 +12243,8 @@ syms_of_keyboard (void) | |||
| 12252 | 12243 | ||
| 12253 | DEFSYM (Qhelp_form_show, "help-form-show"); | 12244 | DEFSYM (Qhelp_form_show, "help-form-show"); |
| 12254 | 12245 | ||
| 12246 | DEFSYM (Qhelp_key_binding, "help-key-binding"); | ||
| 12247 | |||
| 12255 | DEFSYM (Qecho_keystrokes, "echo-keystrokes"); | 12248 | DEFSYM (Qecho_keystrokes, "echo-keystrokes"); |
| 12256 | 12249 | ||
| 12257 | Fset (Qinput_method_exit_on_first_char, Qnil); | 12250 | Fset (Qinput_method_exit_on_first_char, Qnil); |