diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2021-06-22 16:03:37 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-06-22 16:03:37 +0200 |
commit | 3c0b50d1fc4ecbbaf782d92a5b145f7e1991fbc1 (patch) | |
tree | 60a34167884262ac8a90e81a66edaa63f160a2b8 /lisp/emacs-lisp | |
parent | e4b9e1c66cf582f9bf3c149839252fb5aab0497e (diff) | |
download | emacs-3c0b50d1fc4ecbbaf782d92a5b145f7e1991fbc1.tar.gz emacs-3c0b50d1fc4ecbbaf782d92a5b145f7e1991fbc1.tar.bz2 emacs-3c0b50d1fc4ecbbaf782d92a5b145f7e1991fbc1.zip |
Make minor mode docstrings say what the mode "variable" is
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring): Add
the mode variable (bug#36500).
(easy-mmode--mode-docstring):
(define-minor-mode): Pass in the getter.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 0a6d4ec504e..cc150117120 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -92,10 +92,14 @@ If called from Lisp, toggle the mode if ARG is `toggle'. 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'. + The mode's hook is called both when the mode is enabled and when it is disabled.") -(defun easy-mmode--mode-docstring (doc mode-pretty-name keymap-sym) +(defun easy-mmode--mode-docstring (doc mode-pretty-name keymap-sym + getter) (let ((doc (or doc (format "Toggle %s on or off. \\{%s}" mode-pretty-name keymap-sym)))) @@ -104,7 +108,8 @@ it is disabled.") (let* ((fill-prefix nil) (docs-fc (bound-and-true-p emacs-lisp-docstring-fill-column)) (fill-column (if (integerp docs-fc) docs-fc 65)) - (argdoc (format easy-mmode--arg-docstring mode-pretty-name)) + (argdoc (format easy-mmode--arg-docstring mode-pretty-name + getter)) (filled (if (fboundp 'fill-region) (with-temp-buffer (insert argdoc) @@ -308,7 +313,8 @@ or call the function `%s'.")))) ,(funcall warnwrap `(defun ,modefun (&optional arg ,@extra-args) - ,(easy-mmode--mode-docstring doc pretty-name keymap-sym) + ,(easy-mmode--mode-docstring doc pretty-name keymap-sym + getter) ,(when interactive ;; Use `toggle' rather than (if ,mode 0 1) so that using ;; repeat-command still does the toggling correctly. |