Subject: Re: bug#44849: [PATCH] Make XEmacs compat variable warning-level-aliases obsolete

From: Stefan Kangas <[email-masked]>
Date: Tue, 24 Nov 2020 12:15:56 -0800

"Basil L. Contovounesios" <[email-masked]> writes:

> Stefan Kangas <[email-masked]> 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)))