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 13:34:18 +0530 Message-ID: <87ttfny1h9.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> <87y14zy36y.fsf@gmail.com> <861q2ra68n.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="30931"; 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 10:06:43 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 1se91m-0007qk-3K for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Aug 2024 10:06:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1se91c-0002b6-DR; Wed, 14 Aug 2024 04:06: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 1se91Z-0002TG-4O for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2024 04:06: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 1se91Y-0000el-0S for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2024 04:06:28 -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=hA7nG0FALDDZW3+UO6cWGg+jEQ6We4UzfVzLXeHvsoA=; b=mAleiI4Omi19ymDrPNnZouiUO9i9oxHyt0UnwIZZuoHsifdmGR5jATNHzye7xtaTu+yNf6Mk1rc8yHOI1hs+zxzy7U+giWmIgbgRgRQa6IkV4EH0SsuH95pOASm7C3uSkgAv1pTyhXcN4mASmlBJdVytmmku+UfCUDenLFEC93Lo39w5/Kz+mHOfjoQNyyliLsUMDC4gzHw860CwJ36q4a+5H2HzP8fyKxcIYwQx6WfM/8uaBGy/oOrttNiad91D555kQedZOc3xY5PTm7gF+OPqBvUT0hionCBwf3ht///FzFvuEHGZEvFPuwOarh0yKU0AgrTI+R+++5kRoc46Cg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1se926-0003zK-FL for bug-gnu-emacs@gnu.org; Wed, 14 Aug 2024 04:07: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 08:07: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.172362276715234 (code B ref 72405); Wed, 14 Aug 2024 08:07:02 +0000 Original-Received: (at 72405) by debbugs.gnu.org; 14 Aug 2024 08:06:07 +0000 Original-Received: from localhost ([127.0.0.1]:46010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1se91D-0003xe-5z for submit@debbugs.gnu.org; Wed, 14 Aug 2024 04:06:07 -0400 Original-Received: from mail-pf1-f196.google.com ([209.85.210.196]:44322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1se91B-0003we-6s for 72405@debbugs.gnu.org; Wed, 14 Aug 2024 04:06:06 -0400 Original-Received: by mail-pf1-f196.google.com with SMTP id d2e1a72fcca58-7104f93a20eso5309278b3a.1 for <72405@debbugs.gnu.org>; Wed, 14 Aug 2024 01:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723622664; x=1724227464; 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=hA7nG0FALDDZW3+UO6cWGg+jEQ6We4UzfVzLXeHvsoA=; b=Lq7FiPi0cz4BXoBXP9se5H4sdrbtzaQKCBL2scoNshgw7N/xNfaEb9DkjcSzmC0WTv lHCZ28qObOvq/FbGrk9kQXMBpK7fQuov6B5CMpApchsPCrK41nsyyHQbcV6Biey/crL9 HGppe4DjfCpdU0OlU7SXLtXMbcNITfmBZzW4B+DS5OncKLOpvjGWRnY7Spe1rUKpX1kj DI01aCBYPyfYdJ2I19UzPjFaMrhTX5qrIJCf0QaPkewBWPLl+A79jLmZMvawN5neCmYu BTtwzALvnOy5rsHqLusbGvvp6Se+gTjsLkJ6p59t9zuMghaRc6OHheBEvhJBjhXM27PP 1UDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723622664; x=1724227464; 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=hA7nG0FALDDZW3+UO6cWGg+jEQ6We4UzfVzLXeHvsoA=; b=o4r/IDvHUnRaqNbQY6YqjiQWdtQHbTzYwx+8eur90ed7El/Kf0uYH6Md8tJGXNvqp0 f1znnmqefkiPT+TKnwAyv4oENORziBnJZJKXdJuKYPVxph/ewZIIdrNbs1DrBNsqkGqP nwAkLcC3UKjuRSzJK/Dryc0h4+ZBXLdfKUR2k6erPRwY3vSL0YYMagCEnkwjPjsGthIA WqsQaZzXwCA3l3nJKU/U1cSFCVEf0FbMbBact4UdYKFJWkRJCZG6fAE1YAMbFI4zKiI4 bqccP6EWjRQ+iTwvbZJbh7FtzoIjZ2V7XfvcK57nkSbcOoeUNEmWFV7j2FSZG9udP7hd 86KA== X-Forwarded-Encrypted: i=1; AJvYcCUUjxyTyBVGL7IQ23Y+Yl19GwEILG56SHTaihvCUZBXBl+ggmFjUmRzR3UsfznnaDZru7qd1g==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yydu/XhukM6mQR4ZoJtz+7R5RZoCYvP0mxvsFgQi7cBulzA9Ukk /Jf0Ve4hHqdqiMmqfPDa+N+2wh1W3TUqtTe9BYsEBKUU+I+ZeEKL X-Google-Smtp-Source: AGHT+IEhyCu7qnpHdWnPxEH+SNO94daX0w4TBsIvCHuOOw8HXCJXXDfEl/YQGCh3pqsz5dzwFPP4vQ== X-Received: by 2002:a05:6a00:1785:b0:705:a450:a993 with SMTP id d2e1a72fcca58-71267119956mr2561404b3a.17.1723622664322; Wed, 14 Aug 2024 01:04:24 -0700 (PDT) Original-Received: from localhost ([1.7.159.70]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710e5a43593sm6804405b3a.116.2024.08.14.01.04.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Aug 2024 01:04:23 -0700 (PDT) In-Reply-To: <861q2ra68n.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 14 Aug 2024 10:55:20 +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:290122 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:57:17 +0530 >>=20 >> >> Is the attached patch fine?=20=20 >> > >> > Yes, but please use 'if' rather than 'when'. >>=20 >> Sorry, but I'm confused. I used 'when' because=20 >>=20 >> (concat nil "xxx") ;; =3D> "xxx" > > Yes, of course. But 'if' also returns nil if its condition is false: > > (if (symbolp 1) "symbol") > =3D> nil > > So you can still use the original code, which uses the above behavior > of 'concat', after replacing 'when' with 'if' in your original code. > > The reason I asked to use 'if' is that there's no reason to use 'when' > here, as the BODY of 'when' will only ever be a single string. Ah, I understand now. I find using 'if' without the else-clause confusing when glancing at the code so I opted to use 'when'. Thanks for taking your time to explain what you meant. Attached patch replaces 'when' with 'if'. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Disambiguate-minor-mode-variable-in-its-function-doc.patch >From b9e134f25f7767223fe8d482a9a3b27281180b1b 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..a140027839e 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 --=-=-=--