From d3c39fb522df50e460940bac10ff489564211d0a Mon Sep 17 00:00:00 2001 From: Stephen Berman Date: Sat, 12 Apr 2025 12:01:50 +0200 Subject: [PATCH] Fix display of keys in 'help-form' buffers (bug#77118) * lisp/help.el (help-form-show): Use 'insert' instead of 'princ' so that keys in 'help-form' are displayed with 'help-key-binding' face. --- lisp/help.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lisp/help.el b/lisp/help.el index 1d87c2209c8..a06679b31f5 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -2262,8 +2262,13 @@ The `temp-buffer-window-setup-hook' hook is called." "Display the output of a non-nil `help-form'." (let ((msg (eval help-form t))) (if (stringp msg) - (with-output-to-temp-buffer " *Char Help*" - (princ msg))))) + (let ((bufname " *Char Help*")) + (with-output-to-temp-buffer bufname) + ;; Use `insert' instead of `princ' so that keys in `help-form' + ;; are displayed with `help-key-binding' face (bug#77118). + (with-current-buffer bufname + (let (buffer-read-only) + (insert msg))))))) (defun help--append-keystrokes-help (str) (let* ((keys (this-single-command-keys))