Disambiguate minor-mode variable in its function docstring
authorVisuwesh <visuweshm@gmail.com>
Wed, 14 Aug 2024 02:37:15 +0000 (08:07 +0530)
committerEli Zaretskii <eliz@gnu.org>
Thu, 15 Aug 2024 07:37:36 +0000 (10:37 +0300)
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring)
(easy-mmode--mode-docstring): Add "the variable" before the
GETTER if it is a symbol to properly link to minor-mode variable
in the *Help* buffer in the common case.  (bug#72405)

lisp/emacs-lisp/easy-mmode.el

index 944a74a91ee1d9e80654b57fcdf5568155af35d3..a140027839ec0e16bbb80985d942411aaa0b99bc 100644 (file)
@@ -91,7 +91,7 @@ Enable the mode if ARG is nil, omitted, or is a positive number.
 Disable the mode if ARG is a negative number.
 
 To check whether the minor mode is enabled in the current buffer,
-evaluate `%s'.
+evaluate %s.
 
 The mode's hook is called both when the mode is enabled and when
 it is disabled.")
@@ -128,8 +128,11 @@ it is disabled.")
                         easy-mmode--arg-docstring
                         (if global "global " "")
                         mode-pretty-name
-                        ;; Avoid having quotes turn into pretty quotes.
-                        (string-replace "'" "\\='" (format "%S" getter)))))
+                        (concat
+                         (if (symbolp getter) "the variable ")
+                         (format "`%s'"
+                                 ;; Avoid having quotes turn into pretty quotes.
+                                 (string-replace "'" "\\='" (format "%S" getter)))))))
           (let ((start (point)))
             (insert argdoc)
             (when (fboundp 'fill-region) ;Don't break bootstrap!