GNU bug report logs -
#50898
28.0.50; with-suppressed-warnings doesn't always work
Previous Next
Reported by: Lars Ingebrigtsen <larsi <at> gnus.org>
Date: Wed, 29 Sep 2021 18:54:01 UTC
Severity: normal
Merged with 50984
Found in versions 28.0.50, 28.0.60
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 50898 in the body.
You can then email your comments to 50898 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#50898
; Package
emacs
.
(Wed, 29 Sep 2021 18:54:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Lars Ingebrigtsen <larsi <at> gnus.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 29 Sep 2021 18:54:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
For some time now, the only compilation warning in Emacs has been:
In toplevel form:
cedet/semantic/bovine/el.el:931:1: Warning: ‘define-child-mode’ is an obsolete
macro (as of 27.1); use ‘define-derived-mode’ instead.
(It appears in two places.) But I've forgotten to look into it.
This warning is supposed to be suppressed:
(with-suppressed-warnings ((obsolete define-child-mode))
;; FIXME: We should handle this some other way!
(define-child-mode lisp-mode emacs-lisp-mode
"Make `lisp-mode' inherit mode local behavior from `emacs-lisp-mode'."))
And this suppression did work at some point, I think? But it's not
working any more.
I haven't tried to debug it (or bisect it) yet, but perhaps it's obvious
to somebody what change may have triggered this? My uninformed guess
might be something to do with... macros and when they are expanded?
I've added Stefan M to the CCs.
In GNU Emacs 28.0.50 (build 23, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
of 2021-09-26 built on elva
Repository revision: 43ae8c828d853382bbc2a27b9e14b9fff6ba18b6
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Debian GNU/Linux 11 (bullseye)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#50898
; Package
emacs
.
(Thu, 30 Sep 2021 00:52:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 50898 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> (with-suppressed-warnings ((obsolete define-child-mode))
> ;; FIXME: We should handle this some other way!
> (define-child-mode lisp-mode emacs-lisp-mode
> "Make `lisp-mode' inherit mode local behavior from `emacs-lisp-mode'."))
>
> And this suppression did work at some point, I think? But it's not
> working any more.
Indeed, i experienced the same thing in another case in my own code.
And I am sure that it worked as expected in the past.
Michael.
Forcibly Merged 50898 50984.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sun, 03 Oct 2021 09:14:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#50898
; Package
emacs
.
(Tue, 30 Nov 2021 13:39:02 GMT)
Full text and
rfc822 format available.
Message #13 received at 50898 <at> debbugs.gnu.org (full text, mbox):
Michael Heerdegen <michael_heerdegen <at> web.de> writes:
> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> (with-suppressed-warnings ((obsolete define-child-mode))
>> ;; FIXME: We should handle this some other way!
>> (define-child-mode lisp-mode emacs-lisp-mode
>> "Make `lisp-mode' inherit mode local behavior from `emacs-lisp-mode'."))
>>
>> And this suppression did work at some point, I think? But it's not
>> working any more.
>
> Indeed, i experienced the same thing in another case in my own code.
> And I am sure that it worked as expected in the past.
This should now work again on the trunk.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
bug marked as fixed in version 29.1, send any further explanations to
50898 <at> debbugs.gnu.org and Lars Ingebrigtsen <larsi <at> gnus.org>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Tue, 30 Nov 2021 13:39:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#50898
; Package
emacs
.
(Tue, 30 Nov 2021 13:51:01 GMT)
Full text and
rfc822 format available.
Message #18 received at 50898 <at> debbugs.gnu.org (full text, mbox):
> This should now work again on the trunk.
Hmm...
@@ -216,10 +216,11 @@ macroexp-macroexpand
(let* ((fun (car form))
(obsolete (get fun 'byte-obsolete-info)))
(macroexp-warn-and-return
- (macroexp--obsolete-warning
- fun obsolete
- (if (symbolp (symbol-function fun))
- "alias" "macro"))
+ (and (byte-compile-warning-enabled-p 'obsolete fun)
+ (macroexp--obsolete-warning
+ fun obsolete
+ (if (symbolp (symbol-function fun))
+ "alias" "macro")))
new-form 'obsolete))
new-form)))
I suspect this can fail if `bytecomp.el` is not yet loaded.
I think "the right way" to do that is to improve
`macroexp-warn-and-return` so that instead of only receiving `obsolete`
as `category` to decide if the warning is enabled or not, it should
additionally also receive `fun`.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#50898
; Package
emacs
.
(Tue, 30 Nov 2021 14:21:02 GMT)
Full text and
rfc822 format available.
Message #21 received at 50898 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> I suspect this can fail if `bytecomp.el` is not yet loaded.
In what cases does that happen? I tried both an incremental and
a bootstrap build.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#50898
; Package
emacs
.
(Tue, 30 Nov 2021 17:32:02 GMT)
Full text and
rfc822 format available.
Message #24 received at 50898 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen [2021-11-30 15:19:55] wrote:
> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>
>> I suspect this can fail if `bytecomp.el` is not yet loaded.
>
> In what cases does that happen? I tried both an incremental and
> a bootstrap build.
emacs -Q
(with-suppressed-warnings ((obsolete foo)) (define-child-mode sm-foo c-mode "hello"))
C-j
-- Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#50898
; Package
emacs
.
(Wed, 01 Dec 2021 03:32:01 GMT)
Full text and
rfc822 format available.
Message #27 received at 50898 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>> In what cases does that happen? I tried both an incremental and
>> a bootstrap build.
>
> emacs -Q
> (with-suppressed-warnings ((obsolete foo)) (define-child-mode
> sm-foo c-mode "hello"))
> C-j
Right. But instead of duplicating the logic, autoloading
byte-compile-warning-enabled-p would fix that problem.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Wed, 29 Dec 2021 12:24:08 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 80 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.