From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.bugs Subject: bug#72405: 29.4; Doc string of `org-indent-mode' Date: Wed, 14 Aug 2024 12:57:17 +0530 Message-ID: <87y14zy36y.fsf@gmail.com> References: <86cymsyguu.fsf@gnu.org> <877cd0iyw4.fsf@gmail.com> <8734noiy1b.fsf@gmail.com> <86zfpwwyu4.fsf@gnu.org> <87frr7zv3b.fsf@gmail.com> <86le0zfx9l.fsf@gnu.org> <877ccjzk0m.fsf@gmail.com> <86ed6rfvm0.fsf@gnu.org> 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="7431"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 72405@debbugs.gnu.org, monnier@iro.umontreal.ca, drew.adams@oracle.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 14 09:29:44 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1se8Rz-0001jc-HG for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Aug 2024 09:29:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1se8Rn-0002lN-Tj; Wed, 14 Aug 2024 03:29:32 -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 1se8Rl-0002lB-Oi for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2024 03:29:29 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1se8Rl-0002zx-G0 for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2024 03:29:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=ztKuEWiLZCtIRtKYCGgACsJaw24bcSPWFTdD5sbFeSs=; b=rXnMFjAxb45umfbdNCuisij/u0YnjotpuArL4w9R3rvEQN4b+vGrKdkOIrmTMLsmNqWIdUiZcnzmYp28b8brrWN3yUuKsdXgbciViaatNQBankUMqW1igp/FjuxML+l1Eup9zi9WDZMXZ6ie/qyXPax+06HGnCsOI2xq0SnQT60wKuD8nCa26xFA+NNS6edIhkUFC6NxhjaGMX3sD43eKvwl+/FDQZ1fx+9xB5md587wjR0pXswXTo/uD5SCD6qn6z+VMRBGNhbrQoD60KgFolU7bDduyxvBKEc6K0hJGbN43XFJode41bHA1l4yhvkwL7tCJyjnhNP12al6vGb7NA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1se8SI-0002xk-Kn for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2024 03:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Aug 2024 07:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72405 X-GNU-PR-Package: emacs Original-Received: via spool by 72405-submit@debbugs.gnu.org id=B72405.172362054611299 (code B ref 72405); Wed, 14 Aug 2024 07:30:02 +0000 Original-Received: (at 72405) by debbugs.gnu.org; 14 Aug 2024 07:29:06 +0000 Original-Received: from localhost ([127.0.0.1]:45923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1se8RO-0002wA-3e for submit@debbugs.gnu.org; Wed, 14 Aug 2024 03:29:06 -0400 Original-Received: from mail-ot1-f65.google.com ([209.85.210.65]:47130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1se8RL-0002vg-9X for 72405@debbugs.gnu.org; Wed, 14 Aug 2024 03:29:04 -0400 Original-Received: by mail-ot1-f65.google.com with SMTP id 46e09a7af769-7093997dffdso2473104a34.2 for <72405@debbugs.gnu.org>; Wed, 14 Aug 2024 00:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723620443; x=1724225243; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=ztKuEWiLZCtIRtKYCGgACsJaw24bcSPWFTdD5sbFeSs=; b=EPbIiFY86iIZ66RESBD3M/KhSgycAR+Qg1Xjq2xvOU4rwzwKyxWpIhYmUkEqfTr7gP amR/CRroUKnNHfSG2jKugmpLpANglM9uIdCoBfWFqYU+RUjtWIqJ2AgAPCOPOMSltqDU TFZt47qejXtiDv+MbSUT4TB30x7o+gqCExiagXI41vtRn6RyV6OUntC0zKEtLyvBJUeI 89+53UfuUBHEupkWEgAws66NPrQhFazgMwvgwtRqRyQKXlKmOUORryi/xQf08SC/KHak 7kwv6VzMRq1oKaJr9wVE3UD7shWZjPKFAqNVmoPk6D2UnkncevDvXtECq9/7UQpx9j6o ncnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723620443; x=1724225243; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ztKuEWiLZCtIRtKYCGgACsJaw24bcSPWFTdD5sbFeSs=; b=pq5nCzy7dJZYIXxNiWakThjBVjNGAzf0XDn8N+Lm+TmLL470DmHiBiAQk2iZDUbeFy bupRVqwXRvvhJx9P66H5mfqpIlzs6cjfCaQLbnI7KWTmKUBM4CZYkz7jlnQ3iIYQnJj+ tskYZCfFzzzI8O2JzgLcOZ/ZYQs8t3aXH3NSpu7Qy4uzSEXZM/SP8yyZEjiG+P6orseb dMXcTzO78sLzhMiZAnicMA/okdfDr3emL17dHp0fIqhy/qCKn5RLMKgPk0k121hfqUfZ 3x/2l1EZHk+Jek89GiGMVbAxxVVtdUuRT8FF3rEy2XNn4P0bWWyG+Eln27zubLChNpI+ 79mQ== X-Forwarded-Encrypted: i=1; AJvYcCV2BjSa44VMgL3Qs1VbLnFfOgR60jXQCJlT5rVik6eOJZ21yGsHOOFuOuhW1a+Sd3YW4avMvrONuXzQzcebNh/Fp2/J2Ak= X-Gm-Message-State: AOJu0YxKp4L0y2QtdfZcvdbKHwlB01Pwyi8RLzZGFa6WOTdWOYSZOxTU AxloZMjy8adS7AMCOln0KD67m+Nlyf7XqHr2xLjRvt5QKIlDkw7A X-Google-Smtp-Source: AGHT+IGp0bLGQi9UU1St752ZGapEiE1Z+Yh+VfQFNsaJQKFWBQTOQ2ud/5onEq3ZuhsEi6xp2Z5T5w== X-Received: by 2002:a05:6358:70c5:b0:1ad:424:ae4 with SMTP id e5c5f4694b2df-1b1aab17edemr226276355d.2.1723620442747; Wed, 14 Aug 2024 00:27:22 -0700 (PDT) Original-Received: from localhost ([1.7.159.70]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710e5a43a68sm6771279b3a.126.2024.08.14.00.27.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 00:27:22 -0700 (PDT) In-Reply-To: <86ed6rfvm0.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 14 Aug 2024 09:48:23 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290119 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable [=E0=AE=AA=E0=AF=81=E0=AE=A4=E0=AE=A9=E0=AF=8D =E0=AE=86=E0=AE=95=E0=AE=B8= =E0=AF=8D=E0=AE=9F=E0=AF=8D 14, 2024] Eli Zaretskii wrote: >> From: Visuwesh >> Cc: monnier@iro.umontreal.ca, 72405@debbugs.gnu.org, drew.adams@oracle= .com >> Date: Wed, 14 Aug 2024 12:08:33 +0530 >>=20 >> >> +evaluate %s`%s'. >> > ^^^^^ >> > This looks like a bug (I know it isn't, but it looks like one). Can >> > we instead use just %s here, and generate the full string, including >> > the "the variable" part, in the code that uses the format? >> > >> > Thanks. >>=20 >> Is the attached patch fine?=20=20 > > Yes, but please use 'if' rather than 'when'. Sorry, but I'm confused. I used 'when' because=20 (concat nil "xxx") ;; =3D> "xxx" But if you don't want to rely on this implicit behaviour, I turned the 'when' to 'if' in the attached patch. I hope this is what you meant. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Disambiguate-minor-mode-variable-in-its-function-doc.patch >From b390ad167f82c7e0d449437f9e464dde9ef799a4 Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Wed, 14 Aug 2024 08:07:15 +0530 Subject: [PATCH] Disambiguate minor-mode variable in its function docstring * 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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 944a74a91ee..7a014e164bd 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 `%s'. +evaluate %s. The mode's hook is called both when the mode is enabled and when it is disabled.") @@ -128,8 +128,11 @@ 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))))) + (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! -- 2.45.2 --=-=-=--