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.
This commit is contained in:
Stephen Berman 2025-04-12 12:01:50 +02:00
parent 6509cc20a9
commit d3c39fb522

View file

@ -2262,8 +2262,13 @@ The `temp-buffer-window-setup-hook' hook is called."
"Display the output of a non-nil `help-form'." "Display the output of a non-nil `help-form'."
(let ((msg (eval help-form t))) (let ((msg (eval help-form t)))
(if (stringp msg) (if (stringp msg)
(with-output-to-temp-buffer " *Char Help*" (let ((bufname " *Char Help*"))
(princ msg))))) (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) (defun help--append-keystrokes-help (str)
(let* ((keys (this-single-command-keys)) (let* ((keys (this-single-command-keys))