GNU bug report logs - #78792
[PATCH] Fix compilation of defalias with a constant macro cons pair

Previous Next

Package: emacs;

Reported by: zach shaftel <zach <at> shaf.tel>

Date: Sun, 15 Jun 2025 01:41:02 UTC

Severity: normal

Tags: patch

Full log


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

From: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: shigeru.fukaya <at> gmail.com, Andrea Corallo <acorallo <at> gnu.org>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>, zach shaftel <zach <at> shaf.tel>,
 78792 <at> debbugs.gnu.org
Subject: Re: bug#78792: [PATCH] Fix compilation of defalias with a constant
 macro cons pair
Date: Wed, 18 Jun 2025 10:11:09 +0200
>> byte-compile-file-form-defalias destructures (cons 'macro 'fn) and
>> '(macro . fn) the same way, so in the latter case fn would be unquoted,
>> and then eval would later signal (void-variable fn). this patch just
>> re-quotes fn, and adds a test for this scenario.

This seems to be a genuine bug indeed, thank you for reporting.

>> @@ -5159,7 +5159,8 @@ byte-compile-file-form-defalias
>>        (pcase-let*
>>            ;; `macro' is non-nil if it defines a macro.
>>            ;; `fun' is the function part of `arg' (defaults to `arg').
>> -           (((or (and (or `(cons 'macro ,fun) `'(macro . ,fun)) (let macro t))
>> +           (((or (and (or `(cons 'macro ,fun) `'(macro . ,(app (list 'quote) fun)))
>> +                      (let macro t))
>>                  (and (let fun arg) (let macro nil)))

Patch looks fine as far as I can tell. There is a test (naturally!) as well.






This bug report was last modified 1 day ago.

Previous Next


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