From: Visuwesh <visuweshm@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 72405@debbugs.gnu.org, monnier@iro.umontreal.ca, drew.adams@oracle.com
Subject: bug#72405: 29.4; Doc string of `org-indent-mode'
Date: Wed, 14 Aug 2024 12:57:17 +0530 [thread overview]
Message-ID: <87y14zy36y.fsf@gmail.com> (raw)
In-Reply-To: <86ed6rfvm0.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 14 Aug 2024 09:48:23 +0300")
[-- Attachment #1: Type: text/plain, Size: 850 bytes --]
[புதன் ஆகஸ்ட் 14, 2024] Eli Zaretskii wrote:
>> From: Visuwesh <visuweshm@gmail.com>
>> Cc: monnier@iro.umontreal.ca, 72405@debbugs.gnu.org, drew.adams@oracle.com
>> Date: Wed, 14 Aug 2024 12:08:33 +0530
>>
>> >> +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?
>
> Yes, but please use 'if' rather than 'when'.
Sorry, but I'm confused. I used 'when' because
(concat nil "xxx") ;; => "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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Disambiguate-minor-mode-variable-in-its-function-doc.patch --]
[-- Type: text/x-diff, Size: 1816 bytes --]
From b390ad167f82c7e0d449437f9e464dde9ef799a4 Mon Sep 17 00:00:00 2001
From: Visuwesh <visuweshm@gmail.com>
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
next prev parent reply other threads:[~2024-08-14 7:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-31 20:23 bug#72405: 29.4; Doc string of `org-indent-mode' Drew Adams via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-01 5:03 ` Eli Zaretskii
2024-08-01 5:40 ` Visuwesh
2024-08-01 5:59 ` Visuwesh
2024-08-01 6:18 ` Eli Zaretskii
2024-08-14 0:40 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-14 2:39 ` Visuwesh
2024-08-14 6:12 ` Eli Zaretskii
2024-08-14 6:38 ` Visuwesh
2024-08-14 6:48 ` Eli Zaretskii
2024-08-14 7:27 ` Visuwesh [this message]
2024-08-14 7:55 ` Eli Zaretskii
2024-08-14 8:04 ` Visuwesh
2024-08-15 7:39 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y14zy36y.fsf@gmail.com \
--to=visuweshm@gmail.com \
--cc=72405@debbugs.gnu.org \
--cc=drew.adams@oracle.com \
--cc=eliz@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.