GNU bug report logs - #72405
29.4; Doc string of `org-indent-mode'

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Wed, 31 Jul 2024 20:25:01 UTC

Severity: minor

Found in version 29.4

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 72405 in the body.
You can then email your comments to 72405 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#72405; Package emacs. (Wed, 31 Jul 2024 20:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 31 Jul 2024 20:25:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 29.4; Doc string of `org-indent-mode'
Date: Wed, 31 Jul 2024 20:23:59 +0000
Likely applies also to other minor-mode doc strings.

emacs -Q
C-h f org-indent-mode
____

That shows you doc that includes this, where `org-indent-mode' is a link
intended to give you information about the _variable_ of that name:

  To check whether the minor mode is enabled in the current buffer,
  evaluate 'org-indent-mode'.

Clicking that link doesn't take you to the _variable_ part of the *Help*
buffer; it just puts you back at the start of the buffer (after
redrawing it uselessly).

It should take you to the description of the variable.  And the sentence
should include the word "variable" before `org-indent-mode'; otherwise,
it makes little sense to speak of evaluating that symbol, and the text
can confuse or mislead users.


In GNU Emacs 29.4 (build 2, x86_64-w64-mingw32) of 2024-07-05 built on
 AVALON
Windowing system distributor 'Microsoft Corp.', version 10.0.19045
System Description: Microsoft Windows 10 Pro (v10.0.2009.19045.4651)

Configured using:
 'configure --with-modules --without-dbus --with-native-compilation=aot
 --without-compress-install --with-sqlite3 --with-tree-sitter
 CFLAGS=-O2'

Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB

(NATIVE_COMP present but libgccjit not available)

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1252





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72405; Package emacs. (Thu, 01 Aug 2024 05:07:01 GMT) Full text and rfc822 format available.

Message #8 received at 72405 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 72405 <at> debbugs.gnu.org
Subject: Re: bug#72405: 29.4; Doc string of `org-indent-mode'
Date: Thu, 01 Aug 2024 08:03:37 +0300
> Date: Wed, 31 Jul 2024 20:23:59 +0000
> From:  Drew Adams via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> Likely applies also to other minor-mode doc strings.
> 
> emacs -Q
> C-h f org-indent-mode
> ____
> 
> That shows you doc that includes this, where `org-indent-mode' is a link
> intended to give you information about the _variable_ of that name:
> 
>   To check whether the minor mode is enabled in the current buffer,
>   evaluate 'org-indent-mode'.
> 
> Clicking that link doesn't take you to the _variable_ part of the *Help*
> buffer; it just puts you back at the start of the buffer (after
> redrawing it uselessly).
> 
> It should take you to the description of the variable.  And the sentence
> should include the word "variable" before `org-indent-mode'; otherwise,
> it makes little sense to speak of evaluating that symbol, and the text
> can confuse or mislead users.

Thanks, but please report Org issues to the Org mailing list first.
If the Org developers determine it's a core Emacs problem (which is
hardly possible in this case, but who knows?), then it should be
reported here.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72405; Package emacs. (Thu, 01 Aug 2024 05:43:02 GMT) Full text and rfc822 format available.

Message #11 received at 72405 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 72405 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#72405: 29.4; Doc string of `org-indent-mode'
Date: Thu, 01 Aug 2024 11:10:43 +0530
[வியாழன் ஆகஸ்ட் 01, 2024] Eli Zaretskii wrote:

>> Date: Wed, 31 Jul 2024 20:23:59 +0000
>> From:  Drew Adams via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>> 
>> Likely applies also to other minor-mode doc strings.
>> 
>> emacs -Q
>> C-h f org-indent-mode
>> ____
>> 
>> That shows you doc that includes this, where `org-indent-mode' is a link
>> intended to give you information about the _variable_ of that name:
>> 
>>   To check whether the minor mode is enabled in the current buffer,
>>   evaluate 'org-indent-mode'.
>> 
>> Clicking that link doesn't take you to the _variable_ part of the *Help*
>> buffer; it just puts you back at the start of the buffer (after
>> redrawing it uselessly).
>> 
>> It should take you to the description of the variable.  And the sentence
>> should include the word "variable" before `org-indent-mode'; otherwise,
>> it makes little sense to speak of evaluating that symbol, and the text
>> can confuse or mislead users.
>
> Thanks, but please report Org issues to the Org mailing list first.
> If the Org developers determine it's a core Emacs problem (which is
> hardly possible in this case, but who knows?), then it should be
> reported here.

That sentence is part of easy-mmode--arg-docstring that gets added to
all the minor-mode docstrings.  So it is not org-mode specific.  For
example, font-lock-mode also has the following text:

    To check whether the minor mode is enabled in the current buffer,
    evaluate ‘font-lock-mode’.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72405; Package emacs. (Thu, 01 Aug 2024 06:01:01 GMT) Full text and rfc822 format available.

Message #14 received at 72405 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 72405 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#72405: 29.4; Doc string of `org-indent-mode'
Date: Thu, 01 Aug 2024 11:29:12 +0530
[வியாழன் ஆகஸ்ட் 01, 2024] Visuwesh wrote:

> [வியாழன் ஆகஸ்ட் 01, 2024] Eli Zaretskii wrote:
>
>>> Date: Wed, 31 Jul 2024 20:23:59 +0000
>>> From:  Drew Adams via "Bug reports for GNU Emacs,
>>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>>> 
>>> Likely applies also to other minor-mode doc strings.
>>> 
>>> emacs -Q
>>> C-h f org-indent-mode
>>> ____
>>> 
>>> That shows you doc that includes this, where `org-indent-mode' is a link
>>> intended to give you information about the _variable_ of that name:
>>> 
>>>   To check whether the minor mode is enabled in the current buffer,
>>>   evaluate 'org-indent-mode'.
>>> 
>>> Clicking that link doesn't take you to the _variable_ part of the *Help*
>>> buffer; it just puts you back at the start of the buffer (after
>>> redrawing it uselessly).
>>> 
>>> It should take you to the description of the variable.  And the sentence
>>> should include the word "variable" before `org-indent-mode'; otherwise,
>>> it makes little sense to speak of evaluating that symbol, and the text
>>> can confuse or mislead users.
>>
>> Thanks, but please report Org issues to the Org mailing list first.
>> If the Org developers determine it's a core Emacs problem (which is
>> hardly possible in this case, but who knows?), then it should be
>> reported here.
>
> That sentence is part of easy-mmode--arg-docstring that gets added to
> all the minor-mode docstrings.  So it is not org-mode specific.  For
> example, font-lock-mode also has the following text:
>
>     To check whether the minor mode is enabled in the current buffer,
>     evaluate ‘font-lock-mode’.

Here's a patch to make it insert "the variable " after evaluate.  But
I'm not sure if (symbolp getter) will catch all non-variable cases.
AFAIU, GETTER can be any generalised variable.

diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index ba0f8bad393..2262fb8ed5b 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`%s'.
 
 The mode's hook is called both when the mode is enabled and when
 it is disabled.")
@@ -128,6 +128,7 @@ easy-mmode--mode-docstring
                         easy-mmode--arg-docstring
                         (if global "global " "")
                         mode-pretty-name
+                        (if (symbolp getter) "the variable " "")
                         ;; Avoid having quotes turn into pretty quotes.
                         (string-replace "'" "\\='" (format "%S" getter)))))
           (let ((start (point)))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72405; Package emacs. (Thu, 01 Aug 2024 06:19:02 GMT) Full text and rfc822 format available.

Message #17 received at 72405 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Visuwesh <visuweshm <at> gmail.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 72405 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#72405: 29.4; Doc string of `org-indent-mode'
Date: Thu, 01 Aug 2024 09:18:11 +0300
> From: Visuwesh <visuweshm <at> gmail.com>
> Cc: 72405 <at> debbugs.gnu.org,  Drew Adams <drew.adams <at> oracle.com>
> Date: Thu, 01 Aug 2024 11:29:12 +0530
> 
> [வியாழன் ஆகஸ்ட் 01, 2024] Visuwesh wrote:
> 
> > [வியாழன் ஆகஸ்ட் 01, 2024] Eli Zaretskii wrote:
> >
> >>> Date: Wed, 31 Jul 2024 20:23:59 +0000
> >>> From:  Drew Adams via "Bug reports for GNU Emacs,
> >>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> >>> 
> >>> Likely applies also to other minor-mode doc strings.
> >>> 
> >>> emacs -Q
> >>> C-h f org-indent-mode
> >>> ____
> >>> 
> >>> That shows you doc that includes this, where `org-indent-mode' is a link
> >>> intended to give you information about the _variable_ of that name:
> >>> 
> >>>   To check whether the minor mode is enabled in the current buffer,
> >>>   evaluate 'org-indent-mode'.
> >>> 
> >>> Clicking that link doesn't take you to the _variable_ part of the *Help*
> >>> buffer; it just puts you back at the start of the buffer (after
> >>> redrawing it uselessly).
> >>> 
> >>> It should take you to the description of the variable.  And the sentence
> >>> should include the word "variable" before `org-indent-mode'; otherwise,
> >>> it makes little sense to speak of evaluating that symbol, and the text
> >>> can confuse or mislead users.
> >>
> >> Thanks, but please report Org issues to the Org mailing list first.
> >> If the Org developers determine it's a core Emacs problem (which is
> >> hardly possible in this case, but who knows?), then it should be
> >> reported here.
> >
> > That sentence is part of easy-mmode--arg-docstring that gets added to
> > all the minor-mode docstrings.  So it is not org-mode specific.  For
> > example, font-lock-mode also has the following text:
> >
> >     To check whether the minor mode is enabled in the current buffer,
> >     evaluate ‘font-lock-mode’.
> 
> Here's a patch to make it insert "the variable " after evaluate.  But
> I'm not sure if (symbolp getter) will catch all non-variable cases.
> AFAIU, GETTER can be any generalised variable.
> 
> diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
> index ba0f8bad393..2262fb8ed5b 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`%s'.
>  
>  The mode's hook is called both when the mode is enabled and when
>  it is disabled.")
> @@ -128,6 +128,7 @@ easy-mmode--mode-docstring
>                          easy-mmode--arg-docstring
>                          (if global "global " "")
>                          mode-pretty-name
> +                        (if (symbolp getter) "the variable " "")
>                          ;; Avoid having quotes turn into pretty quotes.
>                          (string-replace "'" "\\='" (format "%S" getter)))))
>            (let ((start (point)))

Stefan, any comments to this suggestion?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72405; Package emacs. (Wed, 14 Aug 2024 00:41:02 GMT) Full text and rfc822 format available.

Message #20 received at 72405 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 72405 <at> debbugs.gnu.org, drew.adams <at> oracle.com,
 Visuwesh <visuweshm <at> gmail.com>
Subject: Re: bug#72405: 29.4; Doc string of `org-indent-mode'
Date: Tue, 13 Aug 2024 20:40:03 -0400
>> Here's a patch to make it insert "the variable " after evaluate.  But
>> I'm not sure if (symbolp getter) will catch all non-variable cases.
>> AFAIU, GETTER can be any generalised variable.
[...]
> Stefan, any comments to this suggestion?

Looks OK to me.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72405; Package emacs. (Wed, 14 Aug 2024 02:42:01 GMT) Full text and rfc822 format available.

Message #23 received at 72405 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 72405 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#72405: 29.4; Doc string of `org-indent-mode'
Date: Wed, 14 Aug 2024 08:09:20 +0530
[Message part 1 (text/plain, inline)]
[செவ்வாய் ஆகஸ்ட் 13, 2024] Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:

>>> Here's a patch to make it insert "the variable " after evaluate.  But
>>> I'm not sure if (symbolp getter) will catch all non-variable cases.
>>> AFAIU, GETTER can be any generalised variable.
> [...]
>> Stefan, any comments to this suggestion?
>
> Looks OK to me.
>
>
>         Stefan

Thanks, so I've attached a properly formatted patch.

[0001-Disambiguate-minor-mode-variable-in-its-function-doc.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72405; Package emacs. (Wed, 14 Aug 2024 06:14:02 GMT) Full text and rfc822 format available.

Message #26 received at 72405 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: 72405 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, drew.adams <at> oracle.com
Subject: Re: bug#72405: 29.4; Doc string of `org-indent-mode'
Date: Wed, 14 Aug 2024 09:12:38 +0300
> From: Visuwesh <visuweshm <at> gmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  72405 <at> debbugs.gnu.org,
>   drew.adams <at> oracle.com
> Date: Wed, 14 Aug 2024 08:09:20 +0530
> 
> Thanks, so I've attached a properly formatted patch.
> 
> 
> >From 535ae70653745f529742993f7fc26daf00666713 Mon Sep 17 00:00:00 2001
> From: Visuwesh <visuweshm <at> 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 | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> 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.
>  
>  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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72405; Package emacs. (Wed, 14 Aug 2024 06:41:02 GMT) Full text and rfc822 format available.

Message #29 received at 72405 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 72405 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, drew.adams <at> oracle.com
Subject: Re: bug#72405: 29.4; Doc string of `org-indent-mode'
Date: Wed, 14 Aug 2024 12:08:33 +0530
[Message part 1 (text/plain, inline)]
[புதன் ஆகஸ்ட் 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.
>>  
>>  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?  

[0001-Disambiguate-minor-mode-variable-in-its-function-doc.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72405; Package emacs. (Wed, 14 Aug 2024 06:50:01 GMT) Full text and rfc822 format available.

Message #32 received at 72405 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: 72405 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, drew.adams <at> oracle.com
Subject: Re: bug#72405: 29.4; Doc string of `org-indent-mode'
Date: Wed, 14 Aug 2024 09:48:23 +0300
> From: Visuwesh <visuweshm <at> gmail.com>
> Cc: monnier <at> iro.umontreal.ca,  72405 <at> debbugs.gnu.org,  drew.adams <at> 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'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72405; Package emacs. (Wed, 14 Aug 2024 07:30:02 GMT) Full text and rfc822 format available.

Message #35 received at 72405 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 72405 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, drew.adams <at> oracle.com
Subject: Re: bug#72405: 29.4; Doc string of `org-indent-mode'
Date: Wed, 14 Aug 2024 12:57:17 +0530
[Message part 1 (text/plain, inline)]
[புதன் ஆகஸ்ட் 14, 2024] Eli Zaretskii wrote:

>> From: Visuwesh <visuweshm <at> gmail.com>
>> Cc: monnier <at> iro.umontreal.ca,  72405 <at> debbugs.gnu.org,  drew.adams <at> 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.

[0001-Disambiguate-minor-mode-variable-in-its-function-doc.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72405; Package emacs. (Wed, 14 Aug 2024 07:57:01 GMT) Full text and rfc822 format available.

Message #38 received at 72405 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: 72405 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, drew.adams <at> oracle.com
Subject: Re: bug#72405: 29.4; Doc string of `org-indent-mode'
Date: Wed, 14 Aug 2024 10:55:20 +0300
> From: Visuwesh <visuweshm <at> gmail.com>
> Cc: monnier <at> iro.umontreal.ca,  72405 <at> debbugs.gnu.org,  drew.adams <at> oracle.com
> Date: Wed, 14 Aug 2024 12:57:17 +0530
> 
> >> 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"

Yes, of course.  But 'if' also returns nil if its condition is false:

  (if (symbolp 1) "symbol")
   => 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72405; Package emacs. (Wed, 14 Aug 2024 08:07:02 GMT) Full text and rfc822 format available.

Message #41 received at 72405 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 72405 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca, drew.adams <at> oracle.com
Subject: Re: bug#72405: 29.4; Doc string of `org-indent-mode'
Date: Wed, 14 Aug 2024 13:34:18 +0530
[Message part 1 (text/plain, inline)]
[புதன் ஆகஸ்ட் 14, 2024] Eli Zaretskii wrote:

>> From: Visuwesh <visuweshm <at> gmail.com>
>> Cc: monnier <at> iro.umontreal.ca,  72405 <at> debbugs.gnu.org,  drew.adams <at> oracle.com
>> Date: Wed, 14 Aug 2024 12:57:17 +0530
>> 
>> >> 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"
>
> Yes, of course.  But 'if' also returns nil if its condition is false:
>
>   (if (symbolp 1) "symbol")
>    => 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'.

[0001-Disambiguate-minor-mode-variable-in-its-function-doc.patch (text/x-diff, attachment)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 15 Aug 2024 07:41:02 GMT) Full text and rfc822 format available.

Notification sent to Drew Adams <drew.adams <at> oracle.com>:
bug acknowledged by developer. (Thu, 15 Aug 2024 07:41:02 GMT) Full text and rfc822 format available.

Message #46 received at 72405-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: monnier <at> iro.umontreal.ca, drew.adams <at> oracle.com, 72405-done <at> debbugs.gnu.org
Subject: Re: bug#72405: 29.4; Doc string of `org-indent-mode'
Date: Thu, 15 Aug 2024 10:39:17 +0300
> From: Visuwesh <visuweshm <at> gmail.com>
> Cc: monnier <at> iro.umontreal.ca,  72405 <at> debbugs.gnu.org,  drew.adams <at> oracle.com
> Date: Wed, 14 Aug 2024 13:34:18 +0530
> 
> > 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'.

Thanks, installed on the emacs-30 branch, and closing the bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 12 Sep 2024 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 275 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.