From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: emacs-30 73c1252bb6b: Fix link to major mode variable in docstring Date: Tue, 09 Jul 2024 04:22:35 +0000 Message-ID: <877cdv5h4k.fsf@posteo.net> References: <171956993509.30805.5525504753117432129@vcs2.savannah.gnu.org> <20240628101855.7E69DC2BC60@vcs2.savannah.gnu.org> <87bk37x4dg.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4274"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Kangas , Eshel Yaron , emacs-devel@gnu.org To: Thierry Volpiatto Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 09 06:20:40 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sR2LI-0000up-Fu for ged-emacs-devel@m.gmane-mx.org; Tue, 09 Jul 2024 06:20:40 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sR2KL-0006B6-SZ; Tue, 09 Jul 2024 00:19:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sR2KJ-0006Aq-SZ for emacs-devel@gnu.org; Tue, 09 Jul 2024 00:19:39 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sR2KE-0002oB-Ri for emacs-devel@gnu.org; Tue, 09 Jul 2024 00:19:39 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 4C596240028 for ; Tue, 9 Jul 2024 06:19:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1720498772; bh=r+DiG0MRLdOZBeyiEr3U1o04lmlLJRsVoDh/qZL7jYk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Autocrypt:OpenPGP:From; b=LoE5LhW4qIT1FvUJjlH0SqZC0tdz/h67XtNvThH6nx07kbYGgbAtwacdvOEMZvpjg on82d7VZ2jNkzIiSUuIXAA2fI0HiDMBq3+8X1livAb1nwj10D6d0s91sS/v5SeK0J4 jSgl9HlUxdm7jTDYkdXBPNbO7fU2wNRJRMbw0aWdbtgrBhelKIGF9oUUO6HmfzBkWL gWa/ci4HXwGr9eG7eLp+rQvYPQHrMxLi5gB2KQbJ/5ixYRbHny9n/ndzqmOg1d2TiO fNdty4bFD/ObLDbNdzFICAHIVS/Jp15bYKZBsYEpu6RkEIopG0cgJrGZJvG/jXm3Qh hTPZY2yLglK4w== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WJ76q2M60z6tlh; Tue, 9 Jul 2024 06:19:31 +0200 (CEST) In-Reply-To: <87bk37x4dg.fsf@posteo.net> (Thierry Volpiatto's message of "Mon, 08 Jul 2024 15:58:19 +0000") Autocrypt: addr=thievol@posteo.net; prefer-encrypt=mutual; keydata=xsDNBF8ylcIBDADG+hy+zR6L4/vbdDDZuSaMmSrU3A5QZJpeBCvxTr7MpzzruZbhLPW1K3R6N2MA edi8Y+C8o27FVRIjpdbaKMGu9je7JV/TbUQYo3SOwCK1vM4LUn4V6ZLzSYkuiEt4eyMoiDdyvN0p kcK6P9x9DCetcEVszXzQg+yzCVrQ2hXWDXWT4M18EC3wtO7RHPouMqGiwBFhBAYErCqFWFxQHkfb tG/4yGyJ58rglb65O3qijjMWvYwcWZun9/7qm8Z4/4mHopmo2zgU+OrptnLSZfkZGz3Y7Uf452xQ GVq0Fv75NPvQru7y+DYVhuVXXyAmGxt+vf4rIiixMBbhKEPjcxEPAa2LTzex2IsTZR+QVG9uDnqC WcgaOEQ58fzXNvNhtwwF/Rgio2XWAJVdmFWS59/k9W58CIUSNKBMZh2XeGdEmtHvDtCxW3z6FJha 36RzOM3fMNNiAGdFZJA84gcdloJR+sHCDTTPT3784fjr+V8An7sI581NGFzkRQqPvEQCZbUAEQEA Ac0SdGhpZXZvbEBwb3N0ZW8ubmV0wsEOBBMBCgA4AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheA FiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmL3HCoACgkQDsVtFB0W75OVEAv/f6XxmtIFz08fUb8h Bp/zJP6IC4/rhhh+0GMRIRzLN8DK0jV8JCzYdFHiRJOy2lNIOpmrrCmjRRxferc2G42+ePFIsslx hU46VSz1Z83NwIG3mpdYNV5WUTUdgzxExHTNTFCd7NKv0nlHKQaA OpenPGP: url=https://posteo.de/keys/thievol@posteo.net.asc; preference=encrypt Received-SPF: pass client-ip=185.67.36.65; envelope-from=thievol@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:321555 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thierry Volpiatto writes: > Stefan Kangas writes: > >> Eshel Yaron 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 =E2=80=98(default-value 'global-auto-revert-mod= e)=E2=80=99. >> >> 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-mode= s. diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 7006ae6c785..445cf822045 100644 =2D-- 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 a= nd when it is disabled.") =20 (defun easy-mmode--mode-docstring (doc mode-pretty-name keymap-sym =2D 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. =2D (string-replace "'" "\\=3D'" (format "%S" getter= ))))) + (string-replace "'" "\\=3D'" (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 =2D 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. =2D-=20 Thierry --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQHHBAEBCgAxFiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmaMuwwTHHRoaWV2b2xA cG9zdGVvLm5ldAAKCRAOxW0UHRbvky87DACJfeWcs8TIlbQKTkzPsveo4DeilfLZ hwQWQHCWsMAnD+3cnKnGPua9dIYi4KexJ2974jpNeiaO7brNVcMNL8a3jfM+PWDy 0jW7achxtvRrROxX0+oGKouaWdmwArxVQ3dQUHjWMOj6quuG1fj/CjPbk2n7EpM2 C7JE3NPSnXXYew5tuVWGhKmE2GXBBT9jzIRhXblQvxA9lMQMSuOomCUGfeCSEZ3V WehQDaubZqwb9KWDG8XwwC/pP7P+gKqf6tQ2R9CcykJhx5SJuC0aDNO4u9jvWgL9 z7j9bAybTpjh5XDhc19+PKEkr4+J4+Wi0Bmk8YfiFMW638CAsLgb6ntbPPphbxvm 3G4tug5Lf1lFEBthJLuOrEIWtP6l/X3jE5qqNAQgBBs/Wg6EiayKer75i3h7Zqr9 2tWPYfj8FVJXoxO91VZUru5ZoXkcCmcq6XrCLGavxYjK4K8MarNK8ZW//10FbtRl by5Q6Ve4RQs8p3HM+qBvdgj8eQTeCW6sOo0= =wYRF -----END PGP SIGNATURE----- --=-=-=--