unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thievol@posteo.net>
To: Thierry Volpiatto <thievol@posteo.net>
Cc: Stefan Kangas <stefankangas@gmail.com>,
	 Eshel Yaron <me@eshelyaron.com>,
	 emacs-devel@gnu.org
Subject: Re: emacs-30 73c1252bb6b: Fix link to major mode variable in docstring
Date: Tue, 09 Jul 2024 04:22:35 +0000	[thread overview]
Message-ID: <877cdv5h4k.fsf@posteo.net> (raw)
In-Reply-To: <87bk37x4dg.fsf@posteo.net> (Thierry Volpiatto's message of "Mon,  08 Jul 2024 15:58:19 +0000")

[-- Attachment #1: Type: text/plain, Size: 3052 bytes --]

Thierry Volpiatto <thievol@posteo.net> writes:

> Stefan Kangas <stefankangas@gmail.com> writes:
>
>> Eshel Yaron <me@eshelyaron.com> writes:
>>
>>> I think it's not always correct to say "the variable" here, because that
>>> "%s" may be replaced with a form that's not just a variable.  E.g. now
>>> C-h f global-auto-revert-mode RET says:
>>>
>>>   To check whether the minor mode is enabled in the current buffer,
>>>   evaluate the variable ‘(default-value 'global-auto-revert-mode)’.
>>
>> Thanks, you're right.  Now reverted.
>
> No, this is not right, reverting fix nothing, we are just back to previous
> bug, this is unrelated, the bug is in `easy-mmode--mode-docstring` which
> have a misleading arg called 'getter' and naturally `define-minor-mode`
> pass 'getter' to it instead of passing 'mode'.
>
> PS: Please CC me as I am not suscribed to this list, thanks.

So to resume, the change done in bug#71815 i.e. adding "the variable"
before the button in `easy-mmode--arg-docstring` have nothing to do with
what described above (about global-auto-revert-mode), this bug was here
before the change introduced by bug#71815, so please reenable "the
variable" change in `easy-mmode--arg-docstring` . The following patch
should fixes the bug described above about global minor-mode showing the
exp (default-value 'global-xxx-mode), this happens in all global minor-modes.

diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index 7006ae6c785..445cf822045 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -97,7 +97,7 @@ 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
-                                       getter global)
+                                       variable global)
   ;; If we have a doc string, and it's already complete (which we
   ;; guess at with the simple heuristic below), then just return that
   ;; as is.
@@ -129,7 +129,7 @@ it is disabled.")
                         (if global "global " "")
                         mode-pretty-name
                         ;; Avoid having quotes turn into pretty quotes.
-                        (string-replace "'" "\\='" (format "%S" getter)))))
+                        (string-replace "'" "\\='" (format "%S" variable)))))
           (let ((start (point)))
             (insert argdoc)
             (when (fboundp 'fill-region) ;Don't break bootstrap!
@@ -336,7 +336,7 @@ or call the function `%s'."))))
          warnwrap
          `(defun ,modefun (&optional arg ,@extra-args)
             ,(easy-mmode--mode-docstring doc pretty-name keymap-sym
-                                         getter globalp)
+                                         (or variable mode) globalp)
             ,(when interactive
 	       ;; Use `toggle' rather than (if ,mode 0 1) so that using
 	       ;; repeat-command still does the toggling correctly.

-- 
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]

  parent reply	other threads:[~2024-07-09  4:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <171956993509.30805.5525504753117432129@vcs2.savannah.gnu.org>
     [not found] ` <20240628101855.7E69DC2BC60@vcs2.savannah.gnu.org>
2024-07-08  9:34   ` emacs-30 73c1252bb6b: Fix link to major mode variable in docstring Eshel Yaron
2024-07-08 11:48     ` Stefan Kangas
2024-07-08 15:58       ` Thierry Volpiatto
2024-07-08 23:26         ` Michael Heerdegen via Emacs development discussions.
2024-07-09  0:37           ` Michael Heerdegen via Emacs development discussions.
2024-07-09  4:22         ` Thierry Volpiatto [this message]
2024-07-09  5:01           ` Michael Heerdegen via Emacs development discussions.
     [not found]             ` <87y16b3zhk.fsf@posteo.net>
     [not found]               ` <87r0c3f1a4.fsf@web.de>
2024-07-09 10:06                 ` Thierry Volpiatto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877cdv5h4k.fsf@posteo.net \
    --to=thievol@posteo.net \
    --cc=emacs-devel@gnu.org \
    --cc=me@eshelyaron.com \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).