GNU bug report logs - #75876
29.2; warning "docstring has wrong usage of unescaped single quotes" in easy-mmode.el

Previous Next

Package: emacs;

Reported by: "R. Diez" <rdiezmail-emacs <at> yahoo.de>

Date: Sun, 26 Jan 2025 17:59:02 UTC

Severity: normal

Tags: notabug

Found in version 29.2

Done: Stefan Kangas <stefankangas <at> gmail.com>

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 75876 in the body.
You can then email your comments to 75876 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#75876; Package emacs. (Sun, 26 Jan 2025 17:59:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "R. Diez" <rdiezmail-emacs <at> yahoo.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 26 Jan 2025 17:59:03 GMT) Full text and rfc822 format available.

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

From: "R. Diez" <rdiezmail-emacs <at> yahoo.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.2; warning "docstring has wrong usage of unescaped single quotes"
 in easy-mmode.el
Date: Sun, 26 Jan 2025 18:58:12 +0100
I am getting the following warning in 'dtrt-indent-global-mode':

dtrt-indent.el:208:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)

The author of package dtrt-indent.el says the warning is incorrect:

https://github.com/jscheid/dtrt-indent/issues/79#issuecomment-2614031451

I do now know much Lisp myself, but I suspect the warning probably actually comes from macro 'define-globalized-minor-mode' in easy-mmode.el, because that macro apparently does have a docstring without proper quoting.

I am reporting this bug here because easy-mmode.el says it is part of Emacs.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75876; Package emacs. (Sun, 26 Jan 2025 19:33:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: "R. Diez" <rdiezmail-emacs <at> yahoo.de>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 75876 <at> debbugs.gnu.org
Subject: Re: bug#75876: 29.2;
 warning "docstring has wrong usage of unescaped single quotes" in
 easy-mmode.el
Date: Sun, 26 Jan 2025 21:32:12 +0200
> Date: Sun, 26 Jan 2025 18:58:12 +0100
> From:  "R. Diez" via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> 
> I am getting the following warning in 'dtrt-indent-global-mode':
> 
> dtrt-indent.el:208:2: Warning: docstring has wrong usage of unescaped single quotes (use \= or different quoting)
> 
> The author of package dtrt-indent.el says the warning is incorrect:
> 
> https://github.com/jscheid/dtrt-indent/issues/79#issuecomment-2614031451
> 
> I do now know much Lisp myself, but I suspect the warning probably actually comes from macro 'define-globalized-minor-mode' in easy-mmode.el, because that macro apparently does have a docstring without proper quoting.
> 
> I am reporting this bug here because easy-mmode.el says it is part of Emacs.

This is because the mode function is defined as lambda:

  (define-globalized-minor-mode dtrt-indent-global-mode dtrt-indent-mode
    (lambda ()
      ;; javascript-mode is an alias for js-mode, so derived-mode-p does not
      ;; detect it is derived from 'prog-mode (Emacs bug #46331: remove once
      ;; Emacs >= 28.1 can be assumed)
      (when (derived-mode-p 'prog-mode 'text-mode 'javascript-mode)
	(dtrt-indent-mode)))

If you load the file and invoke describe-function, it says:

  (dtrt-indent-global-mode &optional ARG)

  Toggle Dtrt-Indent mode in all buffers.
  With prefix ARG, enable Dtrt-Indent-Global mode if ARG is positive;
  otherwise, disable it.

  If called from Lisp, toggle the mode if ARG is ‘toggle’.
  Enable the mode if ARG is nil, omitted, or is a positive number.
  Disable the mode if ARG is a negative number.

  Dtrt-Indent mode is enabled in all buffers where ‘(lambda nil (when
  (derived-mode-p ’prog-mode ’text-mode ’javascript-mode)
  (dtrt-indent-mode)))’ would do it.

And there you see that nonsense with the lambda and the unescaped
quotes.

Stefan, any comments?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75876; Package emacs. (Sun, 26 Jan 2025 22:00:03 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "R. Diez" <rdiezmail-emacs <at> yahoo.de>, 75876 <at> debbugs.gnu.org
Subject: Re: bug#75876: 29.2; warning "docstring has wrong usage of
 unescaped single quotes" in easy-mmode.el
Date: Sun, 26 Jan 2025 16:59:33 -0500
> And there you see that nonsense with the lambda and the unescaped
> quotes.
>
> Stefan, any comments?

Hmm... don't do it?
IOW, give a name to your function.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75876; Package emacs. (Sun, 26 Jan 2025 22:45:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>, Eli Zaretskii <eliz <at> gnu.org>
Cc: "R. Diez" <rdiezmail-emacs <at> yahoo.de>, 75876 <at> debbugs.gnu.org
Subject: Re: bug#75876: 29.2; warning "docstring has wrong usage of unescaped
 single quotes" in easy-mmode.el
Date: Sun, 26 Jan 2025 16:44:45 -0600
tags 75876 + notabug
thanks

Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

>> And there you see that nonsense with the lambda and the unescaped
>> quotes.
>>
>> Stefan, any comments?
>
> Hmm... don't do it?
> IOW, give a name to your function.

I agree, so I'm tagging this as notabug.

We could perhaps add a byte-compiler warning for this situation.




Added tag(s) notabug. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 26 Jan 2025 22:45:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#75876; Package emacs. (Mon, 27 Jan 2025 07:24:01 GMT) Full text and rfc822 format available.

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

From: "R. Diez" <rdiezmail-emacs <at> yahoo.de>
To: Stefan Kangas <stefankangas <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 75876 <at> debbugs.gnu.org
Subject: Re: bug#75876: 29.2; warning "docstring has wrong usage of unescaped
 single quotes" in easy-mmode.el
Date: Mon, 27 Jan 2025 08:23:19 +0100
> Hmm... don't do it?
> IOW, give a name to your function.

OK guys, thanks for your quick help with this matter.





Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Tue, 11 Feb 2025 07:17:02 GMT) Full text and rfc822 format available.

Notification sent to "R. Diez" <rdiezmail-emacs <at> yahoo.de>:
bug acknowledged by developer. (Tue, 11 Feb 2025 07:17:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: "R. Diez" <rdiezmail-emacs <at> yahoo.de>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 75876-done <at> debbugs.gnu.org,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#75876: 29.2; warning "docstring has wrong usage of unescaped
 single quotes" in easy-mmode.el
Date: Mon, 10 Feb 2025 23:16:01 -0800
"R. Diez" <rdiezmail-emacs <at> yahoo.de> writes:

>> Hmm... don't do it?
>> IOW, give a name to your function.
>
> OK guys, thanks for your quick help with this matter.

Thanks, I'm therefore closing this bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 11 Mar 2025 11:24:17 GMT) Full text and rfc822 format available.

This bug report was last modified 105 days ago.

Previous Next


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