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:08:33 +0530 Message-ID: <877ccjzk0m.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> 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="21658"; 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 08:40:40 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 1se7gV-0005Su-JF for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Aug 2024 08:40:39 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1se7gL-00072x-Gq; Wed, 14 Aug 2024 02:40:29 -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 1se7gK-00072Y-0n for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2024 02:40:28 -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 1se7gJ-00046r-LX for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2024 02:40:27 -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:References:Date:In-Reply-To:From:To:Subject; bh=9vAZuRkOMQdy7rufniXucAkkl1dbaIwisfKjnCPT6lw=; b=VtNN/Z9tFgew8LuVEzqTl2dlVBnp2prebfEVVRNf1djPW79CA/UtvgUKbzxI0rQwUGA7ZRTQdepuv09d0mHlP0a8XqIDnRyVmmJDPrqptE8NrurNGARGyeeOv5CMBCy9hL7a2YOAm8KkCLqVNcvilDZDXaRrXUjImNPyf5sPjPk4BwpPC7cvI+m1R6by3+MXUAxmEIScfaGd3RKpCISqIF9j7CjbeFKEIcjy9bA1dEEOD+gul7ES5TtxzkJwQQV3vm+CXIi5WHZGAcOdxPPupxURLbUKAHTEFM+AoKqzTg0hgVDmvnZzvesoF19bEMM79nuje/ZnzIf3u2CxouEXZA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1se7gs-0001lR-0z for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2024 02:41: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 06:41:01 +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.17236176416749 (code B ref 72405); Wed, 14 Aug 2024 06:41:01 +0000 Original-Received: (at 72405) by debbugs.gnu.org; 14 Aug 2024 06:40:41 +0000 Original-Received: from localhost ([127.0.0.1]:45893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1se7gX-0001kn-A9 for submit@debbugs.gnu.org; Wed, 14 Aug 2024 02:40:41 -0400 Original-Received: from mail-pg1-f196.google.com ([209.85.215.196]:50661) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1se7gU-0001kX-So for 72405@debbugs.gnu.org; Wed, 14 Aug 2024 02:40:39 -0400 Original-Received: by mail-pg1-f196.google.com with SMTP id 41be03b00d2f7-6e7b121be30so4060223a12.1 for <72405@debbugs.gnu.org>; Tue, 13 Aug 2024 23:40:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723617538; x=1724222338; darn=debbugs.gnu.org; h=mime-version:user-agent:references:message-id:date:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=9vAZuRkOMQdy7rufniXucAkkl1dbaIwisfKjnCPT6lw=; b=WqfVe6afJLo3Xqm5dLSX3qf34CBOVJZ0m+uwu0CdTF0UchqH8jusOhphMlRFVwI3oK k69peqyP3lNVwbUPiemCM/R6bgwNftOQY41hXYZLaDc8tchuT3L7J30pCmUrkeqdB8it FOACQe3BwNEWqBljwEFXP9ARHdj7eD4b14BRPpFyk8NCAtB38leO83edtttqW+qS1i2U AGK9yjZ8r2OuHyeEvIJ+SBi+nn0phyLlu+iRQuCPekZecFsFMrVcXG5A3E7Yqv4nngsO P9bkuu/qPJbPAF1dxBNUVfDnU+YejFdF5rawAPlx5Atv8JYn332tk5vmif0wk+hFC/tQ SXQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723617538; x=1724222338; h=mime-version:user-agent:references:message-id:date:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=9vAZuRkOMQdy7rufniXucAkkl1dbaIwisfKjnCPT6lw=; b=SAAJx0zGUKtSL4hUdFncXEwN4mLON2XjAQ40nesdBY79CoQybp4q1drfJRPwq/J6kf o/vfwyLEzmkS7jK3u+9QS+OfF6SSRFP6xTSxoJKOjw2ySJ7ifiePnE4Ycd0zzbQfUZSX zEFxq27I8lbS6fIfnkoMuyOxfRjDijXxsmrDzdsquDqPLabjpRAmK6uruYqgvGsqsVNZ G2mKHexjbW1iVv2HJGGvAOCYsAtnLPx0+cWQAQpKXYfAZsA/IpnUudK4xKWLX91tZ2nP qnK4kiwZVmcqEvvefo7ulvpOeKbnswGfAPhp6p+ItPgFqMjYckhPVvrVaTtOSZ7ncNf8 oayw== X-Forwarded-Encrypted: i=1; AJvYcCVfPYZRdjYjH1lQZ1K27LOApp0b6k5PAllU1a4Xs4YzJUDQdCSp2OTZQhm98piJzvxFolE/vl5uEe2YN0zL7tB9v4UfIEg= X-Gm-Message-State: AOJu0Ywb43psrhcI5f+4Zl4DlvlElvW1MFUUsLJawj+bdyb4s5suMhuF zuUAKvQqc5WklRPbZuNHTRubX1fNPuGSXkZ0F9ys5tkp0KwNS1/C X-Google-Smtp-Source: AGHT+IENHoxbLjV16wF69Fd+F6kyl73eS5OHr7fqMRuLgi4c6Jqrz9fK26v3LnS2Hkh6QdeblBKOdw== X-Received: by 2002:a05:6a21:7185:b0:1c8:eb57:9f32 with SMTP id adf61e73a8af0-1c8eb579f4bmr2062454637.0.1723617538221; Tue, 13 Aug 2024 23:38:58 -0700 (PDT) Original-Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201cd1b9f7esm23044965ad.207.2024.08.13.23.38.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 23:38:57 -0700 (PDT) In-Reply-To: <86le0zfx9l.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 14 Aug 2024 09:12:38 +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:290117 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: >> diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.= el >> index 944a74a91ee..5332a3b4fcf 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. >>=20=20 >> To check whether the minor mode is enabled in the current buffer, >> -evaluate `%s'. >> +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. Is the attached patch fine?=20=20 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Disambiguate-minor-mode-variable-in-its-function-doc.patch >From 335e30093d9d5b08f8ef4473b86e89c1a3175e9c 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..96bab8487b4 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 + (when (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 --=-=-=--