GNU bug report logs - #55323
29.0.50; Session-compiled interactive form gives (invalid-function #<symbol list at 476>)

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Bob Rogers <rogers@HIDDEN>; Done: Alan Mackenzie <acm@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 55323-done <at> debbugs.gnu.org:


Received: (at 55323-done) by debbugs.gnu.org; 18 May 2022 09:30:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 18 05:30:54 2022
Received: from localhost ([127.0.0.1]:59043 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nrG18-0006dA-0o
	for submit <at> debbugs.gnu.org; Wed, 18 May 2022 05:30:54 -0400
Received: from colin.muc.de ([193.149.48.1]:63423 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1nrG16-0006UY-NV
 for 55323-done <at> debbugs.gnu.org; Wed, 18 May 2022 05:30:53 -0400
Received: (qmail 24503 invoked by uid 3782); 18 May 2022 09:30:46 -0000
Received: from acm.muc.de (p4fe15a4c.dip0.t-ipconnect.de [79.225.90.76])
 (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Wed, 18 May 2022 11:30:45 +0200
Received: (qmail 17161 invoked by uid 1000); 18 May 2022 09:30:45 -0000
Date: Wed, 18 May 2022 09:30:45 +0000
To: Bob Rogers <rogers@HIDDEN>
Subject: Re: 29.0.50; Session-compiled interactive form gives
 (invalid-function #<symbol list at 476>)
Message-ID: <YoS8xcoTQTBXREpC@ACM>
References: <25208.6664.823303.406026@HIDDEN> <YnvUJLxLr9PN0fY7@ACM>
 <25213.36332.986929.499425@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <25213.36332.986929.499425@HIDDEN>
X-Submission-Agent: TMDA/1.3.x (Ph3nix)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 55323-done
Cc: 55323-done <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Bob.

On Thu, May 12, 2022 at 18:45:00 -0400, Bob Rogers wrote:

[ .... ]

> The patch does work when I run my test case (though I get a different
> error because I'm not invoking align-highlight-rule appropriately).  And
> (as you say) the "interactive" form is compiled when lexical-binding
> is nil.

Thanks for the testing.  I've now committed the patch (slightly
enhanced), and I'm closing the bug with this post.

> 					-- Bob

-- 
Alan Mackenzie (Nuremberg, Germany).




Notification sent to Bob Rogers <rogers@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Alan Mackenzie <acm@HIDDEN>:
You have taken responsibility. Full text available.

Message received at 55323 <at> debbugs.gnu.org:


Received: (at 55323) by debbugs.gnu.org; 12 May 2022 22:45:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 12 18:45:11 2022
Received: from localhost ([127.0.0.1]:42449 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1npHYV-0005lD-9l
	for submit <at> debbugs.gnu.org; Thu, 12 May 2022 18:45:11 -0400
Received: from mail-qk1-f172.google.com ([209.85.222.172]:37804)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rogers@HIDDEN>) id 1npHYS-0005ks-5w
 for 55323 <at> debbugs.gnu.org; Thu, 12 May 2022 18:45:09 -0400
Received: by mail-qk1-f172.google.com with SMTP id 126so5897299qkm.4
 for <55323 <at> debbugs.gnu.org>; Thu, 12 May 2022 15:45:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=rgrjr-com.20210112.gappssmtp.com; s=20210112;
 h=from:mime-version:content-transfer-encoding:message-id:date:to:cc
 :subject:in-reply-to:references;
 bh=13szyBOWkP2nbKu9peowMu96quAlBtNJX6LEaKTjCyk=;
 b=IFsy6I6OTQWK0y/RemeaG2KuUujz8hxhFMpu9OA/V3fy2mqvICZEWqV2ABJgYzaEaW
 LAgS0ypRlFrOvA4JbagK/SrWkXpXCVITP9oqPkQvhLRC0SsCIW1kPJo6asrinWI0PBe+
 mbP1HLjGPVQFw/Akd7XF1ssSXcQIPetnx5++u/w8Uot5kOMt3S92DdJIthn0Jwjjkvgy
 llnWM0vNyyOnXmgJr2n1BpnXoWQnLHorBm0tAZl20vAgFmQ9UrZ71nCeRJWU2QodXexO
 C9/gN7+CTgXKt+VoNUfTGeg79z5dN9hrklpEf2v7b3DpMuLoBqodlluyIkAFkT4D1hfO
 CXDQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:mime-version:content-transfer-encoding
 :message-id:date:to:cc:subject:in-reply-to:references;
 bh=13szyBOWkP2nbKu9peowMu96quAlBtNJX6LEaKTjCyk=;
 b=T/TsYHU9xEHN+pB/fudRizfUZ0/h0BHn6CzRTC1Yel37YXY4Xh6nJr0JKFYCQIRxep
 kpqeARN3L4QL46VPJVPGLxkORcQTZxkeiabn7+Nrty91rrUfcWr6i+osRRkV969qy+oY
 rZiiUPvTerDBpDLSpbm9AYMQzsaJQbi1OL9PFr0UX3lK1vwAOgvmPUZZj4Ob/1eJAWuE
 uUupkv0PT8Z88Isn14fBxtLwM/MnKF4KtphwOjEQD13f4qE5Ub1juo9cfJ+Afuo1KAww
 PjhWbSZD3WNsiaaNUvqpq8pzg8kwuf76EpjrI6l5obEthFiTES3kNlNf3tPlg+iTb5ok
 M7mg==
X-Gm-Message-State: AOAM533QqLO3v84H+mcORa3YflVvaGhgFnBtdt12t0+KqsWops/IkD7F
 /ch1axkZZh0pAET8jvCcP/HF8cO3NvdgCg==
X-Google-Smtp-Source: ABdhPJzCC40+JwFkBPFbCzZjiJoiKNakQZw2lwBf9Ol5CHGFAgcBs5Hl2Xy6iKt6k/Qe4amU46TrvA==
X-Received: by 2002:a05:620a:3ca:b0:69e:88ef:5c75 with SMTP id
 r10-20020a05620a03ca00b0069e88ef5c75mr1726953qkm.255.1652395502492; 
 Thu, 12 May 2022 15:45:02 -0700 (PDT)
Received: from orion.rgrjr.com ([2601:19c:4600:3270:1eb7:2cff:fea9:e38b])
 by smtp.gmail.com with ESMTPSA id
 v7-20020a05622a188700b002f39b99f6c5sm478411qtc.95.2022.05.12.15.45.01
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 12 May 2022 15:45:02 -0700 (PDT)
From: Bob Rogers <rogers@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <25213.36332.986929.499425@HIDDEN>
Date: Thu, 12 May 2022 18:45:00 -0400
To: Alan Mackenzie <acm@HIDDEN>
Subject: Re: 29.0.50; Session-compiled interactive form gives
 (invalid-function #<symbol list at 476>)
In-Reply-To: <YnvUJLxLr9PN0fY7@ACM>
References: <25208.6664.823303.406026@HIDDEN> <YnvUJLxLr9PN0fY7@ACM>
X-Mailer: VM 7.19 under Emacs 29.0.50
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 55323
Cc: 55323 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

   From: Alan Mackenzie <acm@HIDDEN>
   Date: Wed, 11 May 2022 15:20:04 +0000

   Hello again, Bob.

   On Sun, May 08, 2022 at 15:29:12 -0400, Bob Rogers wrote:

   . . .

   >    The problem occurs with an evaluated "interactive" form in a defun
   > that is compiled with compile-defun -- and it may have escaped notice
   > until now because it doesn't seem to happen if the source is part of
   > Emacs (i.e. is compiled in a file that git knows about).

   I think what's different is that the source has been copied into a
   different file, and that file doesn't have a

       ;; -*- lexical-binding:t -*-

   at the top.  :-)

Aha!  That makes much more sense.  I first encountered this in some of
my own code which I've been lazy about switching to "lexical-binding:t".

   . . .

   > Disassembly shows that the interactive form is not compiled, and the
   > arglist is full of #<symbol X at Y>:

   . . .

   Yes.  For some reason, the interactive form is not compiled when both
   lexical-binding is nil AND the form looks like (list .....).  I don't
   know why this is, and suspect it's a remnant of a very old bug fix which
   is no longer relevant.

   >    And of course "M-x eval-defun" and "M-x byte-compile-file" continue
   > to DTRT, so I am not in any hurry for a fix.  TIA,

   Would you please try out the following patch, which removes the
   positions from the symbols with positions in the arglist and the
   interactive form.  Then please let me know how it goes.  Thanks!

   . . .

   -- 
   Alan Mackenzie (Nuremberg, Germany).

The patch does work when I run my test case (though I get a different
error because I'm not invoking align-highlight-rule appropriately).  And
(as you say) the "interactive" form is compiled when lexical-binding
is nil.

					-- Bob




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55323; Package emacs. Full text available.

Message received at 55323 <at> debbugs.gnu.org:


Received: (at 55323) by debbugs.gnu.org; 11 May 2022 15:20:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 11 11:20:14 2022
Received: from localhost ([127.0.0.1]:38161 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1noo8L-00026T-JJ
	for submit <at> debbugs.gnu.org; Wed, 11 May 2022 11:20:13 -0400
Received: from colin.muc.de ([193.149.48.1]:20958 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1noo8J-000269-J3
 for 55323 <at> debbugs.gnu.org; Wed, 11 May 2022 11:20:12 -0400
Received: (qmail 95251 invoked by uid 3782); 11 May 2022 15:20:04 -0000
Received: from acm.muc.de (p4fe159db.dip0.t-ipconnect.de [79.225.89.219])
 (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Wed, 11 May 2022 17:20:04 +0200
Received: (qmail 19294 invoked by uid 1000); 11 May 2022 15:20:04 -0000
Date: Wed, 11 May 2022 15:20:04 +0000
To: Bob Rogers <rogers@HIDDEN>
Subject: Re: 29.0.50; Session-compiled interactive form gives
 (invalid-function #<symbol list at 476>)
Message-ID: <YnvUJLxLr9PN0fY7@ACM>
References: <25208.6664.823303.406026@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <25208.6664.823303.406026@HIDDEN>
X-Submission-Agent: TMDA/1.3.x (Ph3nix)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 55323
Cc: acm@HIDDEN, 55323 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello again, Bob.

On Sun, May 08, 2022 at 15:29:12 -0400, Bob Rogers wrote:
> In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)
>  of 2022-05-08 built on orion
> Repository revision: 278b18a460caf34e422847d10ac3f0b62bef4996
> Repository branch: master
> Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
> System Description: openSUSE Leap 15.3

>    The problem occurs with an evaluated "interactive" form in a defun
> that is compiled with compile-defun -- and it may have escaped notice
> until now because it doesn't seem to happen if the source is part of
> Emacs (i.e. is compiled in a file that git knows about).

I think what's different is that the source has been copied into a
different file, and that file doesn't have a

    ;; -*- lexical-binding:t -*-

at the top.  :-)

>    1.  emacs -Q

>    2.  Find an elisp file with an interactive form that does not belong
> to an Emacs working copy.  I used the align-highlight-rule snippet
> below, copied from lisp/align.el.

>    3.  Evaluate the first two forms, and do "M-x compile-defun" to
> compile the third.

>    4.  Attempt to invoke the command via "M-x align-highlight-rule RET".

> What you should see then is a backtrace that starts something like this:

> 	Debugger entered--Lisp error: (invalid-function #<symbol list at 476>)
> 	  (#<symbol list at 476> (#<symbol region-beginning at 482>) ...)
> 	  call-interactively(align-highlight-rule record nil)
> 	  command-execute(align-highlight-rule record)

> Disassembly shows that the interactive form is not compiled, and the
> arglist is full of #<symbol X at Y>:

> 	byte code for align-highlight-rule:
> 	  doc:  Highlight the whitespace which a given rule would have modified. ...
> 	  args: (#<symbol beg at 49> #<symbol end at 53> #<symbol title at 57> ...)
> 	 interactive: (#<symbol list at 476> (#<symbol region-beginning at 482>) ...)
> 	0	constant  intern
> 	1	varref	  title
> 	2	call	  1
> 	3	varref	  align-mode-exclude-rules-list

Yes.  For some reason, the interactive form is not compiled when both
lexical-binding is nil AND the form looks like (list .....).  I don't
know why this is, and suspect it's a remnant of a very old bug fix which
is no longer relevant.

> Disassembling the in-tree version, whether from "M-x compile-defun" or
> file compilation, shows neither of these problems (go figure).

See above.

>    And of course "M-x eval-defun" and "M-x byte-compile-file" continue
> to DTRT, so I am not in any hurry for a fix.  TIA,

Would you please try out the following patch, which removes the
positions from the symbols with positions in the arglist and the
interactive form.  Then please let me know how it goes.  Thanks!



diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 28237d67d2..c282d79446 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -3084,7 +3084,8 @@ byte-compile-lambda
                        ;; which may include "calls" to
                        ;; internal-make-closure (Bug#29988).
                        lexical-binding)
-                   (setq int `(,(car int) ,newform)))))
+                   (setq int `(,(car int) ,newform))
+                 (setq int (byte-run-strip-symbol-positions int))))) ; for compile-defun.
             ((cdr int)                  ; Invalid (interactive . something).
 	     (byte-compile-warn-x int "malformed interactive spec: %s"
 				  int))))
@@ -3099,7 +3100,7 @@ byte-compile-lambda
                                         (byte-compile-make-lambda-lexenv
                                          arglistvars))
                                    reserved-csts))
-          (bare-arglist arglist))
+          (bare-arglist (byte-run-strip-symbol-positions arglist))) ; for compile-defun.
       ;; Build the actual byte-coded function.
       (cl-assert (eq 'byte-code (car-safe compiled)))
       (let ((out



> 					-- Bob Rogers
> 					   http://www.rgrjr.com/

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55323; Package emacs. Full text available.

Message received at 55323 <at> debbugs.gnu.org:


Received: (at 55323) by debbugs.gnu.org; 10 May 2022 10:32:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 10 06:32:50 2022
Received: from localhost ([127.0.0.1]:60421 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1noNAg-00053g-3f
	for submit <at> debbugs.gnu.org; Tue, 10 May 2022 06:32:50 -0400
Received: from colin.muc.de ([193.149.48.1]:39124 helo=mail.muc.de)
 by debbugs.gnu.org with smtp (Exim 4.84_2)
 (envelope-from <acm@HIDDEN>) id 1noNAe-00053Q-LW
 for 55323 <at> debbugs.gnu.org; Tue, 10 May 2022 06:32:49 -0400
Received: (qmail 89345 invoked by uid 3782); 10 May 2022 10:32:41 -0000
Received: from acm.muc.de (p4fe15691.dip0.t-ipconnect.de [79.225.86.145])
 (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP;
 Tue, 10 May 2022 12:32:41 +0200
Received: (qmail 5618 invoked by uid 1000); 10 May 2022 10:32:40 -0000
Date: Tue, 10 May 2022 10:32:40 +0000
To: Bob Rogers <rogers@HIDDEN>
Subject: Re: 29.0.50; Session-compiled interactive form gives
 (invalid-function #<symbol list at 476>)
Message-ID: <Yno/SJNp0dRaVfAK@ACM>
References: <25208.6664.823303.406026@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <25208.6664.823303.406026@HIDDEN>
X-Submission-Agent: TMDA/1.3.x (Ph3nix)
From: Alan Mackenzie <acm@HIDDEN>
X-Primary-Address: acm@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 55323
Cc: acm@HIDDEN, 55323 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, Bob.

On Sun, May 08, 2022 at 15:29:12 -0400, Bob Rogers wrote:
> In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)
>  of 2022-05-08 built on orion
> Repository revision: 278b18a460caf34e422847d10ac3f0b62bef4996
> Repository branch: master
> Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
> System Description: openSUSE Leap 15.3

>    The problem occurs with an evaluated "interactive" form in a defun
> that is compiled with compile-defun -- and it may have escaped notice
> until now because it doesn't seem to happen if the source is part of
> Emacs (i.e. is compiled in a file that git knows about).

>    1.  emacs -Q

>    2.  Find an elisp file with an interactive form that does not belong
> to an Emacs working copy.  I used the align-highlight-rule snippet
> below, copied from lisp/align.el.

>    3.  Evaluate the first two forms, and do "M-x compile-defun" to
> compile the third.

>    4.  Attempt to invoke the command via "M-x align-highlight-rule RET".

> What you should see then is a backtrace that starts something like this:

> 	Debugger entered--Lisp error: (invalid-function #<symbol list at 476>)
> 	  (#<symbol list at 476> (#<symbol region-beginning at 482>) ...)
> 	  call-interactively(align-highlight-rule record nil)
> 	  command-execute(align-highlight-rule record)

> Disassembly shows that the interactive form is not compiled, and the
> arglist is full of #<symbol X at Y>:

> 	byte code for align-highlight-rule:
> 	  doc:  Highlight the whitespace which a given rule would have modified. ...
> 	  args: (#<symbol beg at 49> #<symbol end at 53> #<symbol title at 57> ...)
> 	 interactive: (#<symbol list at 476> (#<symbol region-beginning at 482>) ...)
> 	0	constant  intern
> 	1	varref	  title
> 	2	call	  1
> 	3	varref	  align-mode-exclude-rules-list

> Disassembling the in-tree version, whether from "M-x compile-defun" or
> file compilation, shows neither of these problems (go figure).

Thanks for taking the trouble to report this bug.  I can reproduce it
here.  At a guess, the critical detail is having align-highlight-rule
in a different file's buffer on doing M-x compile-defun.

>    And of course "M-x eval-defun" and "M-x byte-compile-file" continue
> to DTRT, so I am not in any hurry for a fix.  TIA,

I hope to be able to fix this within a few days.

> 					-- Bob Rogers
> 					   http://www.rgrjr.com/

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#55323; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 8 May 2022 19:29:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun May 08 15:29:38 2022
Received: from localhost ([127.0.0.1]:55240 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nnmar-0001IF-MC
	for submit <at> debbugs.gnu.org; Sun, 08 May 2022 15:29:38 -0400
Received: from lists.gnu.org ([209.51.188.17]:52338)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rogers@HIDDEN>) id 1nnmap-0001I7-Nq
 for submit <at> debbugs.gnu.org; Sun, 08 May 2022 15:29:24 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:41334)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <rogers@HIDDEN>) id 1nnmam-0007ip-Nf
 for bug-gnu-emacs@HIDDEN; Sun, 08 May 2022 15:29:21 -0400
Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]:45684)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <rogers@HIDDEN>) id 1nnmaj-0002tS-Nc
 for bug-gnu-emacs@HIDDEN; Sun, 08 May 2022 15:29:20 -0400
Received: by mail-qk1-x733.google.com with SMTP id a76so9461367qkg.12
 for <bug-gnu-emacs@HIDDEN>; Sun, 08 May 2022 12:29:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=rgrjr-com.20210112.gappssmtp.com; s=20210112;
 h=from:mime-version:content-transfer-encoding:message-id:date:to:cc
 :subject; bh=GAAL1qFMvkO41hfk1nwYrao1C511gzzk/xhUM1B41Tg=;
 b=dHPSnzoCVoiTLGMurtlTNUaLxf8sDLalSYaxhpWTsM0DMb0Bca/BVZ01nbVwohHs/I
 pGBwJ9anY9cX1oeH/WaYP4eGsMIbIWi6AJcU/l9mt+KShk4AZ920br1bb+4QnEiOjXpi
 SSAgXhdPiFU0vBQ24s9UoMVs32ne27/bTrhJgrU7xB9m+LffXB0oCFENSUEaoNg8/WWT
 UFonkGMg5J58KGHh7PBiYDRUslHNWPAOsh+sZPQC0lT9WXL06SYloVdieKw+rfA48jxM
 GisQMndNxlTGWHjxVkP53ub9TxrjSplf3I2cOM+v5GCyQiN1PYnDW5Qi41sF3926itpN
 7XEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:mime-version:content-transfer-encoding
 :message-id:date:to:cc:subject;
 bh=GAAL1qFMvkO41hfk1nwYrao1C511gzzk/xhUM1B41Tg=;
 b=0dX32wSdXtGw6c5N+n8nS6rUrJEHLftH9qVG1CZRSbSWfk9AzG9rwZw0LAsPgo5emx
 obVLKWf9f+EqXBmfh/CEjiw5dlg7cLjJOK8zcW8Chk33Zk0R8L5rKNKJane5b1NjZBNv
 z6nt7iRqn6wsORllRZzqhBvAUtq08EmY7bH9BLXEcs6d9WwY1YQifdY4a/M76TMAdUMI
 hSnSRJ5C0CFR1ZWkwML5m3UmirCldQKVuD8uKf+U2I8IQ96y8lCrsfm6QcQ0sNb0RsbD
 g0m+NTrjND1XMEh9G6YQ1BKi8EdxEdffuKzIAAdRPv7C8BDNgMXPpmKmfWuq6NCT5PF4
 5I3A==
X-Gm-Message-State: AOAM531P/7nAujDrpHypL9P7TWXt7ZFoH24RZHCR8GNtiiqcZTMd0/Wa
 29A7D6u070GQvNK0ZjgvAy1G8olA4kqI2A==
X-Google-Smtp-Source: ABdhPJzYvHlCcSPG2Kv85gW0FQu51G/qZ5dXgfHLK7AXisK4Rwl1FkmYa3FdQOnQpaSFh8LRVWwN8g==
X-Received: by 2002:a05:620a:2a09:b0:6a0:924:a3b4 with SMTP id
 o9-20020a05620a2a0900b006a00924a3b4mr9718120qkp.548.1652038154396; 
 Sun, 08 May 2022 12:29:14 -0700 (PDT)
Received: from orion.rgrjr.com ([2601:19c:4600:3270:1eb7:2cff:fea9:e38b])
 by smtp.gmail.com with ESMTPSA id
 r184-20020ae9ddc1000000b0069fc13ce230sm5868138qkf.97.2022.05.08.12.29.13
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 08 May 2022 12:29:14 -0700 (PDT)
From: Bob Rogers <rogers@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <25208.6664.823303.406026@HIDDEN>
Date: Sun, 8 May 2022 15:29:12 -0400
To: bug-gnu-emacs@HIDDEN
Subject: 29.0.50;
 Session-compiled interactive form gives (invalid-function #<symbol
 list at 476>)
X-Mailer: VM 7.19 under Emacs 29.0.50
Received-SPF: none client-ip=2607:f8b0:4864:20::733;
 envelope-from=rogers@HIDDEN; helo=mail-qk1-x733.google.com
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
Cc: Alan Mackenzie <acm@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)
 of 2022-05-08 built on orion
Repository revision: 278b18a460caf34e422847d10ac3f0b62bef4996
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description: openSUSE Leap 15.3

   The problem occurs with an evaluated "interactive" form in a defun
that is compiled with compile-defun -- and it may have escaped notice
until now because it doesn't seem to happen if the source is part of
Emacs (i.e. is compiled in a file that git knows about).

   1.  emacs -Q

   2.  Find an elisp file with an interactive form that does not belong
to an Emacs working copy.  I used the align-highlight-rule snippet
below, copied from lisp/align.el.

   3.  Evaluate the first two forms, and do "M-x compile-defun" to
compile the third.

   4.  Attempt to invoke the command via "M-x align-highlight-rule RET".

What you should see then is a backtrace that starts something like this:

	Debugger entered--Lisp error: (invalid-function #<symbol list at 476>)
	  (#<symbol list at 476> (#<symbol region-beginning at 482>) ...)
	  call-interactively(align-highlight-rule record nil)
	  command-execute(align-highlight-rule record)

Disassembly shows that the interactive form is not compiled, and the
arglist is full of #<symbol X at Y>:

	byte code for align-highlight-rule:
	  doc:  Highlight the whitespace which a given rule would have modified. ...
	  args: (#<symbol beg at 49> #<symbol end at 53> #<symbol title at 57> ...)
	 interactive: (#<symbol list at 476> (#<symbol region-beginning at 482>) ...)
	0	constant  intern
	1	varref	  title
	2	call	  1
	3	varref	  align-mode-exclude-rules-list

Disassembling the in-tree version, whether from "M-x compile-defun" or
file compilation, shows neither of these problems (go figure).

   And of course "M-x eval-defun" and "M-x byte-compile-file" continue
to DTRT, so I am not in any hurry for a fix.  TIA,

					-- Bob Rogers
					   http://www.rgrjr.com/

------------------------------------------------------------------------

(require 'align)

(setq debug-on-error t)

(defun align-highlight-rule (beg end title &optional rules exclude-rules)
  "Highlight the whitespace which a given rule would have modified.
BEG and END mark the extent of the region.  TITLE identifies the rule
that should be highlighted.  If RULES or EXCLUDE-RULES is set to a
list of rules (see `align-rules-list'), it can be used to override the
default alignment rules that would have been used to identify the text
to be colored."
  (interactive
   (list (region-beginning) (region-end)
	 (completing-read
	  "Title of rule to highlight: "
	  (mapcar
           (lambda (rule)
             (list (symbol-name (car rule))))
	   (append (or align-mode-rules-list align-rules-list)
		   (or align-mode-exclude-rules-list
		       align-exclude-rules-list))) nil t)))
  (let ((ex-rule (assq (intern title)
		       (or align-mode-exclude-rules-list
			   align-exclude-rules-list)))
	face)
    (align-unhighlight-rule)
    (align-region
     beg end 'entire
     (or rules (if ex-rule
		   (or exclude-rules align-mode-exclude-rules-list
		       align-exclude-rules-list)
		 (or align-mode-rules-list align-rules-list)))
     (unless ex-rule (or exclude-rules align-mode-exclude-rules-list
			 align-exclude-rules-list))
     (lambda (b e mode)
       (if (and mode (listp mode))
           (if (equal (symbol-name (car mode)) title)
               (setq face (cons align-highlight-change-face
                                align-highlight-nochange-face))
             (setq face nil))
         (when face
           (let ((overlay (make-overlay b e)))
             (setq align-highlight-overlays
                   (cons overlay align-highlight-overlays))
             (overlay-put overlay 'face
                          (if mode
                              (car face)
                            (cdr face))))))))))

------------------------------------------------------------------------
Configured using:
 'configure --with-dbus=no --with-gsettings=no --with-gif=ifavailable
 --with-tiff=no --with-gnutls=yes --with-gconf=no'

Configured features:
ACL CAIRO FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ JPEG LIBSELINUX LIBXML2
MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS
TOOLKIT_SCROLL_BARS X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Debugger

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  buffer-read-only: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media rmc puny
dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg
rfc6068 epg-config gnus-util time-date mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils help-fns radix-tree
cl-print debug backtrace help-mode find-func compile
text-property-search comint ansi-color ring align vc-git diff-mode
easy-mmode vc-dispatcher cl-loaddefs cl-lib seq gv subr-x byte-opt
bytecomp byte-compile cconv iso-transl tooltip eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice simple cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop
case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads inotify
dynamic-setting font-render-setting cairo move-toolbar gtk x-toolkit
xinput2 x multi-tty make-network-process emacs)

Memory information:
((conses 16 63054 8598)
 (symbols 48 7628 1)
 (strings 32 21891 2878)
 (string-bytes 1 716772)
 (vectors 16 15096)
 (vector-slots 8 202859 11567)
 (floats 8 28 36)
 (intervals 56 345 0)
 (buffers 992 13))




Acknowledgement sent to Bob Rogers <rogers@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#55323; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 18 May 2022 09:30:02 UTC

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