GNU bug report logs -
#56968
Incorrect definition prefix "my-" assigned to battery.el in ldefs-boot.el
Previous Next
Reported by: Stefan Kangas <stefan <at> marxist.se>
Date: Thu, 4 Aug 2022 08:34:02 UTC
Severity: minor
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.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 56968 in the body.
You can then email your comments to 56968 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56968
; Package
emacs
.
(Thu, 04 Aug 2022 08:34:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Kangas <stefan <at> marxist.se>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 04 Aug 2022 08:34:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Severity: minor
I see in ldefs-boot.el:
(register-definition-prefixes "battery" '("battery-" "my-"))
However, in battery.el, the "my-" prefix only ever shows up inside a
docstring. That seems like a bug.
AFAICT, this doesn't happen in emacs-28, so this might be a regression.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#56968
; Package
emacs
.
(Thu, 04 Aug 2022 09:02:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 56968 <at> debbugs.gnu.org (full text, mbox):
Stefan Kangas <stefan <at> marxist.se> writes:
> Severity: minor
>
> I see in ldefs-boot.el:
>
> (register-definition-prefixes "battery" '("battery-" "my-"))
>
> However, in battery.el, the "my-" prefix only ever shows up inside a
> docstring. That seems like a bug.
>
> AFAICT, this doesn't happen in emacs-28, so this might be a regression.
The (defun my- in battery.el is new in Emacs 29, so it's not a
regression exactly -- it's why we're doing \( in all doc strings that
have lines that start with (def.
I briefly wondered whether we could usefully warn about this with
something like the below, but I don't think so, since by the time we're
called where, we've already read the \( into (, so there's too many
false positives.
So I've just fixed up the existing errors here instead.
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 7d2971502d..d8255b2584 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -294,7 +294,8 @@ byte-compile-warning-types
'(redefine callargs free-vars unresolved
obsolete noruntime interactive-only
make-local mapcar constants suspicious lexical lexical-dynamic
- docstrings docstrings-non-ascii-quotes not-unused)
+ docstrings docstrings-non-ascii-quotes not-unused
+ docstrings-defthings)
"The list of warning types used when `byte-compile-warnings' is t.")
(defcustom byte-compile-warnings t
"List of warnings that the byte-compiler should issue (t for almost all).
@@ -338,7 +339,8 @@ byte-compile-warnings
byte-compile-warning-types))))
(defconst byte-compile--emacs-build-warning-types
- '(docstrings-non-ascii-quotes)
+ '(docstrings-non-ascii-quotes
+ docstrings-defthings)
"List of warning types that are only enabled during Emacs builds.
This is typically either warning types that are being phased in
(but shouldn't be enabled for packages yet), or that are only relevant
@@ -1770,6 +1772,13 @@ byte-compile-docstring-style-warn
(when (string-match-p "\\( \"\\|[ \t]\\|^\\)[‘’]" docs)
(byte-compile-warn-x
name "%s%sdocstring has wrong usage of \"fancy\" single quotation marks"
+ kind name)))
+ ;; There's a "(def" in the first column. This will typically
+ ;; lead to wrong `register-definition-prefixes'.
+ (when (byte-compile-warning-enabled-p 'docstrings-defthings)
+ (when (string-match-p "^(def" docs)
+ (byte-compile-warn-x
+ name "%s%sdocstring has a \"(def\" form in the first column"
kind name))))))
form)
bug marked as fixed in version 29.1, send any further explanations to
56968 <at> debbugs.gnu.org and Stefan Kangas <stefan <at> marxist.se>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Thu, 04 Aug 2022 09:04:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 01 Sep 2022 11:24:12 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 287 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.