Fix error when trying to recommend setopt

* lisp/help-fns.el (help--recommend-setopt): Don't assume that
variable-documentation stores only strings.  (Bug#76994)
This commit is contained in:
Mauro Aranda 2025-03-13 15:19:05 -03:00
parent f9d805cef3
commit 8298bbada4

View file

@ -875,7 +875,8 @@ the C sources, too."
(when (and (get symbol 'custom-set)
;; Don't override manually written documentation.
(not (string-match (rx word-start "setopt" word-end)
(get symbol 'variable-documentation))))
(documentation-property
symbol 'variable-documentation))))
;; FIXME: `princ` removes text properties added by s-c-k.
(princ (substitute-command-keys "\
Setting this variable with `setq' has no effect; use either `setopt'