GNU bug report logs - #65017
29.1; Byte compiler interaction with cl-lib function objects, removes symbol-function

Previous Next

Package: emacs;

Reported by: Eric Marsden <eric.marsden <at> risk-engineering.org>

Date: Wed, 2 Aug 2023 13:34:02 UTC

Severity: normal

Found in version 29.1

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Alan Mackenzie <acm <at> muc.de>
Cc: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>,
 65017 <at> debbugs.gnu.org, Eric Marsden <eric.marsden <at> risk-engineering.org>
Subject: Re: bug#65017: 29.1; Byte compiler interaction with cl-lib function
 objects, removes symbol-function
Date: Sat, 05 Aug 2023 18:53:48 -0400
>> I don't know why `symbols-with-pos-enabled` is non-nil at that point (I
>> thought we only enabled it wile byte-compiling), ....
>
> This is not quite the case.  symbols-with-pos-enabled gets erroneously
> bound to t in internal-macroexpand-for-load (emacs-lisp/macroexp.el).

Aha!

> diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el
> index b05aba3e1a7..ea838f5b7b2 100644
> --- a/lisp/emacs-lisp/macroexp.el
> +++ b/lisp/emacs-lisp/macroexp.el
> @@ -799,8 +799,7 @@ macroexp--debug-eager
>  
>  (defun internal-macroexpand-for-load (form full-p)
>    ;; Called from the eager-macroexpansion in readevalloop.
> -  (let ((symbols-with-pos-enabled t)
> -        (print-symbols-bare t))
> +  (let ((print-symbols-bare t))
>      (cond
>       ;; Don't repeat the same warning for every top-level element.
>       ((eq 'skip (car macroexp--pending-eager-loads)) form)

Looks good to me.  AFAICT this binding was added at some point where it
seemed like a good idea but we later figured better places to do it,
and we just didn't remove it because it seemed "harmless" (or because
we just didn't think of it).

> Stefan, it would still be nice for cl--labels-convert-cache to get
> initialised each time it gets used.

No, the problem is not initialization, as I pointed out.  The problem is
that this `eq` should not consider a symbol equal to a sympos *ever*
(contrary to most other uses of `eq` in macros).


        Stefan





This bug report was last modified 1 year and 337 days ago.

Previous Next


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