Subject: Re: bug#69533: 30.0.50; Wrong byte compilation of a certain apply syntax

From: "Basil L. Contovounesios" <[email-masked]>
Date: Mon, 04 Mar 2024 13:52:55 +0100

Andreas Schwab [2024-03-04 10:39 +0100] wrote:

> On Mär 04 2024, Basil L. Contovounesios wrote:
>
>> Just curious: which convention are you referring to, and why do you say
>> it's new?  AFAICT the only recent Emacs version which accepted
>> (apply '(+ 1 2)) without any complaint is Emacs 28.
>
> It was added in commit 8edd4a2b64e, since Emacs 24.

Right, but that doesn't mean literal forms survive byte-compilation:

  $ cd "$(mktemp -d)"
  $ cat << EOF > foo.el
  > ; -*- lexical-binding: t -*-
  > (message "%s" (apply '(1+ 0)))
  > EOF
  $ emacs-24.5 -Q -batch -f batch-byte-compile foo.el

  In toplevel form:
  foo.el:2:1:Warning: `(1+ 0)' is a malformed function
  Wrote /tmp/tmp.aFbeBGQj7q/foo.elc
  $ emacs-24.5 -Q -script foo.elc
  Invalid function: (1+ 0)

By contrast:

  $ emacs-28.2 -Q -batch -f batch-byte-compile foo.el
  $ emacs-28.2 -Q -script foo.elc
  1

-- 
Basil