From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: emacs-30 73c1252bb6b: Fix link to major mode variable in docstring Date: Tue, 09 Jul 2024 02:37:47 +0200 Message-ID: <87ikxfv1r8.fsf@web.de> References: <171956993509.30805.5525504753117432129@vcs2.savannah.gnu.org> <20240628101855.7E69DC2BC60@vcs2.savannah.gnu.org> <87bk37x4dg.fsf@posteo.net> <87cynnihys.fsf@web.de> Reply-To: Michael Heerdegen Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12502"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Cancel-Lock: sha1:Vkis6/4mpqTwlaUsspFKvBFs658= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 09 02:38:15 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 1sQys0-0002wM-Le for ged-emacs-devel@m.gmane-mx.org; Tue, 09 Jul 2024 02:38:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQyr4-0004l6-1e; Mon, 08 Jul 2024 20:37:14 -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 1sQyqx-0004kd-8V for emacs-devel@gnu.org; Mon, 08 Jul 2024 20:37:07 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sQyqv-0006PP-JJ for emacs-devel@gnu.org; Mon, 08 Jul 2024 20:37:07 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1sQyqs-0001PU-V3 for emacs-devel@gnu.org; Tue, 09 Jul 2024 02:37:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=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:321551 Archived-At: --=-=-= Content-Type: text/plain Michael Heerdegen via "Emacs development discussions." writes: > What we could do is maybe: generate different text in the two cases > (expression is the mode variable vs. it is different), or even better, > add the text only in the "special" case where the mode variable is not > the thing to eval. How 'bout this? (based on master where the last fix had not yet been reverted) --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-WIP-Minor-improvement-in-easy-mmode-mode-docstring.patch >From 701068acd90e5d5cd9b12cb7541a9020568a9893 Mon Sep 17 00:00:00 2001 From: Michael Heerdegen Date: Tue, 9 Jul 2024 02:32:54 +0200 Subject: [PATCH] WIP: Minor improvement in easy-mmode--mode-docstring --- lisp/emacs-lisp/easy-mmode.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 2c12454af5c..2d6333f146f 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -91,7 +91,7 @@ easy-mmode--arg-docstring Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, -evaluate the variable `%s'. +evaluate %s. The mode's hook is called both when the mode is enabled and when it is disabled.") @@ -128,8 +128,9 @@ easy-mmode--mode-docstring easy-mmode--arg-docstring (if global "global " "") mode-pretty-name - ;; Avoid having quotes turn into pretty quotes. - (string-replace "'" "\\='" (format "%S" getter))))) + (format (if (symbolp getter) "the variable `%s'" "%s") + ;; Avoid having quotes turn into pretty quotes. + (help--docstring-quote (format "%S" getter)))))) (let ((start (point))) (insert argdoc) (when (fboundp 'fill-region) ;Don't break bootstrap! -- 2.39.2 --=-=-= Content-Type: text/plain I took the chance and replaced the manual quoting treatment with a call to `help--docstring-quote'. Michael. --=-=-=--