Subject: Re: bug#76994: 31.0.50; Error with describe-variable for options defined in C sources

From: Mauro Aranda <[email-masked]>
Date: Thu, 13 Mar 2025 06:46:08 -0300

tags 76994 patch
quit

Mauro Aranda <[email-masked]> writes:

 > After emacs -Q:
 > C-h v cursor-in-non-selected-windows
 > help--recommend-setopt: Wrong type argument: stringp, 535053
 >

Patch attached.
From 9221caa146436cb68e6c9ec16358e29e771133e6 Mon Sep 17 00:00:00 2001
From: Mauro Aranda <[email-masked]>
Date: Thu, 13 Mar 2025 06:41:18 -0300
Subject: [PATCH] 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)
---
 lisp/help-fns.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 2d0da178a4c..1af37df3792 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -875,7 +875,8 @@ help--recommend-setopt
   (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'
-- 
2.34.1