GNU bug report logs -
#44849
[PATCH] Make XEmacs compat variable warning-level-aliases obsolete
Previous Next
Reported by: Stefan Kangas <stefan <at> marxist.se>
Date: Tue, 24 Nov 2020 18:10:01 UTC
Severity: wishlist
Tags: fixed, patch
Fixed in version 28.1
Done: Stefan Kangas <stefan <at> marxist.se>
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 44849 in the body.
You can then email your comments to 44849 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#44849
; Package
emacs
.
(Tue, 24 Nov 2020 18:10:01 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
.
(Tue, 24 Nov 2020 18:10:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Severity: wishlist
The `warning-level-aliases' exists only to provide compatibility with
XEmacs warning levels. I don't think this is very useful these days.
I propose to make it obsolete and warn when one of these levels are
used. Please see the attached patch.
[0001-Make-XEmacs-compat-variable-warning-level-aliases-ob.patch (text/x-diff, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44849
; Package
emacs
.
(Tue, 24 Nov 2020 19:54:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 44849 <at> debbugs.gnu.org (full text, mbox):
Stefan Kangas <stefan <at> marxist.se> writes:
> @@ -256,8 +257,10 @@ display-warning
> (setq level :warning))
> (unless buffer-name
> (setq buffer-name "*Warnings*"))
> - (if (assq level warning-level-aliases)
> - (setq level (cdr (assq level warning-level-aliases))))
> + (with-suppressed-warnings ((obsolete warning-level-aliases))
> + (when-let ((new (cdr-safe (assq level warning-level-aliases))))
Why the cdr-safe?
Thanks,
--
Basil
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44849
; Package
emacs
.
(Tue, 24 Nov 2020 20:17:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 44849 <at> debbugs.gnu.org (full text, mbox):
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> @@ -256,8 +257,10 @@ display-warning
>> (setq level :warning))
>> (unless buffer-name
>> (setq buffer-name "*Warnings*"))
>> - (if (assq level warning-level-aliases)
>> - (setq level (cdr (assq level warning-level-aliases))))
>> + (with-suppressed-warnings ((obsolete warning-level-aliases))
>> + (when-let ((new (cdr-safe (assq level warning-level-aliases))))
>
> Why the cdr-safe?
To avoid this:
(and (assq level warning-level-aliases)
(cdr (assq level warning-level-aliases)))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44849
; Package
emacs
.
(Tue, 24 Nov 2020 21:01:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 44849 <at> debbugs.gnu.org (full text, mbox):
Stefan Kangas <stefan <at> marxist.se> writes:
> "Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>
>> Why the cdr-safe?
>
> To avoid this:
>
> (and (assq level warning-level-aliases)
> (cdr (assq level warning-level-aliases)))
But (cdr nil) is well-defined as being nil.
--
Basil
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44849
; Package
emacs
.
(Tue, 24 Nov 2020 21:41:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 44849 <at> debbugs.gnu.org (full text, mbox):
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> "Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>>
>>> Why the cdr-safe?
>>
>> To avoid this:
>>
>> (and (assq level warning-level-aliases)
>> (cdr (assq level warning-level-aliases)))
>
> But (cdr nil) is well-defined as being nil.
Oops. Indeed.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44849
; Package
emacs
.
(Wed, 25 Nov 2020 07:20:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 44849 <at> debbugs.gnu.org (full text, mbox):
Stefan Kangas <stefan <at> marxist.se> writes:
> The `warning-level-aliases' exists only to provide compatibility with
> XEmacs warning levels. I don't think this is very useful these days.
>
> I propose to make it obsolete and warn when one of these levels are
> used. Please see the attached patch.
I'm slightly worried that these aliases are used out there in
out-of-tree packages. As a test, I grepped the GNU ELPA tree, but this
was the only place where the aliases are used:
(defun muse-display-warning (message)
"Display the given MESSAGE as a warning."
(if (fboundp 'display-warning)
(display-warning 'muse message
(if (featurep 'xemacs)
'warning
:warning))
And that's behind a featurep check, so it's fine, too.
So I think the proposed change is probably fine.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44849
; Package
emacs
.
(Thu, 10 Dec 2020 17:25:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 44849 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> The `warning-level-aliases' exists only to provide compatibility with
>> XEmacs warning levels. I don't think this is very useful these days.
>>
>> I propose to make it obsolete and warn when one of these levels are
>> used. Please see the attached patch.
>
> I'm slightly worried that these aliases are used out there in
> out-of-tree packages. As a test, I grepped the GNU ELPA tree, but this
> was the only place where the aliases are used:
>
> (defun muse-display-warning (message)
> "Display the given MESSAGE as a warning."
> (if (fboundp 'display-warning)
> (display-warning 'muse message
> (if (featurep 'xemacs)
> 'warning
> :warning))
>
> And that's behind a featurep check, so it's fine, too.
>
> So I think the proposed change is probably fine.
Thanks. I agree, and the way it is written it will simply show a
warning in case such a usage is not behind a featurep check.
There have been no further comments within 2 weeks, so I intend to push
the change in the next couple of days unless there are any objections.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#44849
; Package
emacs
.
(Mon, 14 Dec 2020 13:21:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 44849 <at> debbugs.gnu.org (full text, mbox):
tags 44849 fixed
close 44849 28.1
thanks
Stefan Kangas <stefan <at> marxist.se> writes:
> There have been no further comments within 2 weeks, so I intend to push
> the change in the next couple of days unless there are any objections.
No further comments within a couple of days; pushed to master as commit
4c41a8acc0.
Added tag(s) fixed.
Request was from
Stefan Kangas <stefan <at> marxist.se>
to
control <at> debbugs.gnu.org
.
(Mon, 14 Dec 2020 13:21:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 28.1, send any further explanations to
44849 <at> debbugs.gnu.org and Stefan Kangas <stefan <at> marxist.se>
Request was from
Stefan Kangas <stefan <at> marxist.se>
to
control <at> debbugs.gnu.org
.
(Mon, 14 Dec 2020 13:21: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
.
(Tue, 12 Jan 2021 12:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 4 years and 156 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.