From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#66136: 29.1; byte-compiler reports "misplaced interactive spec" with empty fct in lexical environment Date: Fri, 22 Sep 2023 10:59:21 -0400 Message-ID: References: <58a3814205a241729c60ed277fa871b9@vodafonemail.de> <87o7hvs2gf.fsf@sappc2.fritz.box> <87leczrysc.fsf@sappc2.fritz.box> <838r8y92aw.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39933"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Jens Schmidt , 66136@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 22 17:02:07 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qjhfS-000AFf-8L for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 Sep 2023 17:02:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjhfG-0000qI-U0; Fri, 22 Sep 2023 11:01:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjhfE-0000my-1a for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2023 11:01:52 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qjhfD-0002TM-KG for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2023 11:01:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qjhfO-0003YJ-7q for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2023 11:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Sep 2023 15:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66136 X-GNU-PR-Package: emacs Original-Received: via spool by 66136-submit@debbugs.gnu.org id=B66136.169539486313588 (code B ref 66136); Fri, 22 Sep 2023 15:02:02 +0000 Original-Received: (at 66136) by debbugs.gnu.org; 22 Sep 2023 15:01:03 +0000 Original-Received: from localhost ([127.0.0.1]:37084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjheQ-0003X6-Pc for submit@debbugs.gnu.org; Fri, 22 Sep 2023 11:01:03 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:19576) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjheO-0003WB-Ni for 66136@debbugs.gnu.org; Fri, 22 Sep 2023 11:01:02 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 5F82F440968; Fri, 22 Sep 2023 11:00:44 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1695394842; bh=4QMHK7C9XL9cFk9b/2zcRV3IqfSCCOLdKoWnb5XegPE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=krgSaTHw5eeLTvesxiPgz5Ncz4d1Tia5utoOo+IKg4QpeQerZozfOy42sCNSGCUNC G87zsuBkBDdA0u8ejMkAf7HlDmDX05FQYN2sxTEr8GzouBexbfo23+jIinDdrfHKQR bYqr5/EvVh7txoWK7Pa2/MXhIWMQHeW2WtUUnQKedDKUHWA5cFyfGXSsziUGtNqeXC gymM48Jc9AeMAGwQWZYX2+fjkyftDxi8xwLCXfuA3ons6bpoBWXhfoB+LvMDF1UxFg VI6AgVncnBrcY27GHXn5m1m5oxYxSDu2VVuY+rMNRdVfg+YgZntM0FYv7f/XGFxSwa 7rwO+oCc8zBoA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C5DF6440922; Fri, 22 Sep 2023 11:00:42 -0400 (EDT) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B630A120223; Fri, 22 Sep 2023 11:00:42 -0400 (EDT) In-Reply-To: <838r8y92aw.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 22 Sep 2023 08:58:47 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:271108 Archived-At: >> Date: Thu, 21 Sep 2023 23:39:47 +0200 >> From: Jens Schmidt via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> Found the issue I think: >> >> -------------------- bad case -------------------- >> (macroexp-parse-body '("Allows interactive calls." (interactive "^P"))) >> >> => >> >> (("Allows interactive calls.") >> (interactive "^P")) >> -------------------- bad case -------------------- >> >> -------------------- good case -------------------- >> (macroexp-parse-body '("Allows interactive calls." (interactive "^P") nil)) >> >> => >> >> (("Allows interactive calls." (interactive "^P")) >> nil) >> -------------------- good case -------------------- >> >> That is, macroexp-parse-body does not consider the case that a body can >> consist of declarations only and, if this is the case, puts the last >> declaration into the body forms. >> >> Could provide a patch if somebody confirms that this is really the root >> cause of this issue. Yet on the other hand this is pretty deep elisp, >> so if somebody else steps forward, I'll be glad as well. > > Adding Stefan, in case he has comments/suggestions. I'm in favor of requiring *something* after the declarations. So yes, the first case above is a bug and should be fixed, but rather than return (("Allows interactive calls." (interactive "^P")) nil) I think it should return something like (("Allows interactive calls." (interactive "^P")) ,(macroexp-warn-and-return "Missing body" ...)) -- Stefan