From unknown Sat Jun 14 19:00:42 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#50034 <50034@debbugs.gnu.org> To: bug#50034 <50034@debbugs.gnu.org> Subject: Status: 28.0.50; elisp capf error "Wrong type argument: listp, elisp--witness--lisp" Reply-To: bug#50034 <50034@debbugs.gnu.org> Date: Sun, 15 Jun 2025 02:00:42 +0000 retitle 50034 28.0.50; elisp capf error "Wrong type argument: listp, elisp-= -witness--lisp" reassign 50034 emacs submitter 50034 Daniel Mendler severity 50034 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 12 21:26:19 2021 Received: (at submit) by debbugs.gnu.org; 13 Aug 2021 01:26:19 +0000 Received: from localhost ([127.0.0.1]:40139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mELxf-0007fd-37 for submit@debbugs.gnu.org; Thu, 12 Aug 2021 21:26:19 -0400 Received: from lists.gnu.org ([209.51.188.17]:42352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mELxa-0007fS-5Y for submit@debbugs.gnu.org; Thu, 12 Aug 2021 21:26:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37398) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mELxY-0004BQ-8X for bug-gnu-emacs@gnu.org; Thu, 12 Aug 2021 21:26:09 -0400 Received: from server.qxqx.de ([2a01:4f8:121:346::180]:51429 helo=mail.qxqx.de) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mELxV-0002A0-1x for bug-gnu-emacs@gnu.org; Thu, 12 Aug 2021 21:26:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=qxqx.de; s=mail1392553390; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date: Message-ID:Subject:From:To:Sender:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=pmUSmfwVuFQHUGovcJceHIjYv6BEBxImwUXxUaJry8Y=; b=aAr0K5P4Gp2rnJFbmGAbuO+V1c YM/YLmzLO4Ds4MGZyuIwhcyu0voBoKY9PEsxiykBcjlUNCO7LhLE7mA0yVnSCOgovdtpkiaF1sn8E LyM21LiH2kZhqKOAM9HzYWvLX/QGNmbT/Arhuri1LF/ODgY4S0+d8CNaN8Cq8cuces2g=; To: bug-gnu-emacs@gnu.org From: Daniel Mendler Subject: 28.0.50; elisp capf error "Wrong type argument: listp, elisp--witness--lisp" Message-ID: <02b75b43-616e-51f1-5d7b-ecb2661d1838@daniel-mendler.de> Date: Fri, 13 Aug 2021 03:25:42 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a01:4f8:121:346::180; envelope-from=mail@daniel-mendler.de; helo=mail.qxqx.de X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Steps to reproduce: 1. Start "emacs -Q" 2. Enter "(defmacro foo bar" in the scratch buffer 3. Press M- to invoke 'completion-at-point' The capf will throw the error "Wrong type argument: listp, elisp--witness--lisp". This error will be shown on Emacs 27 and Emacs 28. The input is nonsensical. I hit this while experimenting with my Corfu completion UI package. A capf should never error in case no completion is possible, such that another completion function of lower priority registered in 'completion-at-point-functions' can take over. Stack trace: Debugger entered--Lisp error: (wrong-type-argument listp elisp--witness--lisp) remq(&rest elisp--witness--lisp) elisp--local-variables-1(nil (lambda elisp--witness--lisp nil)) #f(compiled-function (vars sexp) #)(nil (#'(lambda elisp--witness--lisp nil))) elisp--local-variables-1(nil #'(lambda elisp--witness--lisp nil)) #f(compiled-function (vars sexp) #)(nil ((cons 'macro #'(lambda elisp--witness--lisp nil)))) elisp--local-variables-1(nil (cons 'macro #'(lambda elisp--witness--lisp nil))) #f(compiled-function (vars sexp) #)(nil ((defalias 'foo (cons 'macro #'(lambda elisp--witness--lisp nil))))) elisp--local-variables-1(nil (defalias 'foo (cons 'macro #'(lambda elisp--witness--lisp nil)))) elisp--local-variables() #f(compiled-function (string) #)(#("bar" 0 3 (fontified t))) #f(compiled-function (string pred action) #)(#("bar" 0 3 (fontified t)) nil nil) try-completion(#("bar" 0 3 (fontified t)) #f(compiled-function (string pred action) #) nil) #f(compiled-function (table) #)(#f(compiled-function (string pred action) #)) mapcar(#f(compiled-function (table) #) (#f(compiled-function (string pred action) #) #f(compiled-function (&rest args2) #))) #f(compiled-function (string pred action) #)(#("bar" 0 3 (fontified t)) nil nil) try-completion(#("bar" 0 3 (fontified t)) #f(compiled-function (string pred action) #) nil) completion-basic-try-completion(#("bar" 0 3 (fontified t)) #f(compiled-function (string pred action) #) nil 3) #f(compiled-function (style) #)(basic) completion--some(#f(compiled-function (style) #) (basic partial-completion emacs22)) completion--nth-completion(1 #("bar" 0 3 (fontified t)) #f(compiled-function (string pred action) #) nil 3 (metadata)) completion-try-completion(#("bar" 0 3 (fontified t)) #f(compiled-function (string pred action) #) nil 3 (metadata)) completion--do-completion(# 163) completion--in-region-1(# 163) #f(compiled-function (start end collection predicate) #)(# 163 #f(compiled-function (string pred action) #) nil) apply(#f(compiled-function (start end collection predicate) #) (# 163 #f(compiled-function (string pred action) #) nil)) #f(compiled-function (funs global args) #)(nil nil (# 163 #f(compiled-function (string pred action) #) nil)) completion--in-region(# 163 #f(compiled-function (string pred action) #) nil) completion-in-region(# 163 #f(compiled-function (string pred action) #) nil) completion-at-point() In GNU Emacs 28.0.50 (build 54, x86_64-pc-linux-gnu, GTK+ Version 3.24.5, cairo version 1.16.0) of 2021-08-12 built on projects Windowing system distributor 'The X.Org Foundation', version 11.0.12004000 System Description: Debian GNU/Linux 10 (buster) From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 13 08:13:44 2021 Received: (at 50034) by debbugs.gnu.org; 13 Aug 2021 12:13:45 +0000 Received: from localhost ([127.0.0.1]:40694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEW4G-0007qM-Mw for submit@debbugs.gnu.org; Fri, 13 Aug 2021 08:13:44 -0400 Received: from quimby.gnus.org ([95.216.78.240]:50726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEW4B-0007q3-HV for 50034@debbugs.gnu.org; Fri, 13 Aug 2021 08:13:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=4hNnOPKFxB5HamgY55Kx4bFLYT/Yc9ZA/VN6M7Yslp4=; b=cTBqFBTSFSH/fYulofxUGK3Cdx FIfsM9xPmEjuZcDhak7s/JOy9TJkvbQkCiLXW1OB/aktlALLsqrzQK4gXjLxOnthhaBsCCi46s35E PmxNqqJ58IUrHZEoHiES5kf7siwf7ERGr3VjOCNfCmV2cGuukhPVL3fuqQbtxEdgu8Yg=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mEW40-0003MP-5a; Fri, 13 Aug 2021 14:13:32 +0200 From: Lars Ingebrigtsen To: Daniel Mendler Subject: Re: bug#50034: 28.0.50; elisp capf error "Wrong type argument: listp, elisp--witness--lisp" References: <02b75b43-616e-51f1-5d7b-ecb2661d1838@daniel-mendler.de> Date: Fri, 13 Aug 2021 14:13:27 +0200 In-Reply-To: <02b75b43-616e-51f1-5d7b-ecb2661d1838@daniel-mendler.de> (Daniel Mendler's message of "Fri, 13 Aug 2021 03:25:42 +0200") Message-ID: <87v949ee54.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Daniel Mendler writes: > Steps to reproduce: > > 1. Start "emacs -Q" > 2. Enter "(defmacro foo bar" in the scratch buffer > 3. Press M- to invoke 'completion-at-point' > > The capf will throw the error "Wrong type argu [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50034 Cc: Stefan Monnier , 50034@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Daniel Mendler writes: > Steps to reproduce: > > 1. Start "emacs -Q" > 2. Enter "(defmacro foo bar" in the scratch buffer > 3. Press M- to invoke 'completion-at-point' > > The capf will throw the error "Wrong type argument: listp, > elisp--witness--lisp". This error will be shown on Emacs 27 and Emacs 28. Slightly simpler repro: (defmacro foo bar M-: (elisp--local-variables) RET It fails here: (`(lambda ,args . ,body) (elisp--local-variables-1 (append (remq '&optional (remq '&rest args)) vars) (car (last body)))) where it expects args to be a list, but it's the symbol `elisp--witness--lisp'. I'm not quite sure what the correct fix is here, so I've added Stefan to the CCs. :-) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 22 09:15:54 2022 Received: (at 50034) by debbugs.gnu.org; 22 Aug 2022 13:15:54 +0000 Received: from localhost ([127.0.0.1]:38314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQ7HW-0007zE-JH for submit@debbugs.gnu.org; Mon, 22 Aug 2022 09:15:54 -0400 Received: from quimby.gnus.org ([95.216.78.240]:54236) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQ7HU-0007z0-PC for 50034@debbugs.gnu.org; Mon, 22 Aug 2022 09:15:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=miMmBIHBSg2tvCvfyypYxtRxhOhx9tiuyWSpTMul/HU=; b=hh7fZkofu7ly1nMRlzYD1lKWJ3 1Nd5HnCOnfeEg2BcWnfZZ22sZXV8wrI6b1DBbLMJ8tNPyGzLsgpwARSX2H5aKZZJbfVE4tQmD/RqV bmWM1gkWqOqPgIMurOC0AgVwPs3/fkUE6C37Z5y0EXNLjUcZDoZZYidO9HIsvO8+3ynU=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oQ7HK-0005l2-JK; Mon, 22 Aug 2022 15:15:44 +0200 From: Lars Ingebrigtsen To: Daniel Mendler Subject: Re: bug#50034: 28.0.50; elisp capf error "Wrong type argument: listp, elisp--witness--lisp" In-Reply-To: <87v949ee54.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 13 Aug 2021 14:13:27 +0200") References: <02b75b43-616e-51f1-5d7b-ecb2661d1838@daniel-mendler.de> <87v949ee54.fsf@gnus.org> X-Now-Playing: The Amorphous Androgynous & Peter Hammill's _The Amorphous Androgynous & Peter Hammill_: "We Persuade Ourselves We Are Immortal" Date: Mon, 22 Aug 2022 15:15:41 +0200 Message-ID: <87v8qk5shu.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: >> 1. Start "emacs -Q" >> 2. Enter "(defmacro foo bar" in the scratch buffer >> 3. Press M- to invoke 'completion-at-point' >> >> The capf will throw the error "Wrong type argument: listp, >> eli [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50034 Cc: Stefan Monnier , 50034@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen writes: >> 1. Start "emacs -Q" >> 2. Enter "(defmacro foo bar" in the scratch buffer >> 3. Press M- to invoke 'completion-at-point' >> >> The capf will throw the error "Wrong type argument: listp, >> elisp--witness--lisp". This error will be shown on Emacs 27 and Emacs 28. > > Slightly simpler repro: > > (defmacro foo bar > M-: (elisp--local-variables) RET > > It fails here: > > (`(lambda ,args . ,body) > (elisp--local-variables-1 > (append (remq '&optional (remq '&rest args)) vars) > (car (last body)))) > > where it expects args to be a list, but it's the symbol > `elisp--witness--lisp'. I'm not quite sure what the correct fix is > here, so I've added Stefan to the CCs. :-) One year later, this problem is still present in Emacs 29. Stefan, do you have any idea what the fix here should be? From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 22 22:05:40 2022 Received: (at 50034) by debbugs.gnu.org; 23 Aug 2022 02:05:40 +0000 Received: from localhost ([127.0.0.1]:42140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQJIS-0005kk-2z for submit@debbugs.gnu.org; Mon, 22 Aug 2022 22:05:40 -0400 Received: from mout.web.de ([212.227.17.12]:34813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQJIO-0005kS-HL for 50034@debbugs.gnu.org; Mon, 22 Aug 2022 22:05:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1661220309; bh=/wiS+DQrHkUhJZbnwSxkl/cmRtQjslhejtEYWZ7DrCA=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=iKpbyqg6xUR8BAwzCbbC1twd7uwsvHVByC6B9D4XD3g4JsBuaR3UP94zktpbpPtMu HryYBY6BF43Q3rUu3FmiPDMIjpUfuNMW9l3GtlX4eucDDa/1AArZyiwEBu/aRIPUWX fC32QleAIC8/7TUedYVcxH0+cAeeb6R2TnRa+OWk= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([84.57.248.18]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1Mf3uS-1p6muV0HM2-00gYdy; Tue, 23 Aug 2022 04:05:09 +0200 From: Michael Heerdegen To: Lars Ingebrigtsen Subject: Re: bug#50034: 28.0.50; elisp capf error "Wrong type argument: listp, elisp--witness--lisp" In-Reply-To: <87v949ee54.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 13 Aug 2021 14:13:27 +0200") References: <02b75b43-616e-51f1-5d7b-ecb2661d1838@daniel-mendler.de> <87v949ee54.fsf@gnus.org> Date: Tue, 23 Aug 2022 04:05:07 +0200 Message-ID: <87v8qjiujw.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:Gm23TYhqX/24tIW9tFQHgVVXhkLHiV06dlk02RRhnoFTvcVMraM moBbm6ZtVFPSaCx+GfwiyS/rVcpsFnyA8+Wart56h7d3vPLdkzcJaixVcpCQX0xuXEPwCBs NQqEpMW/CNn0BiEnmDWLcuE09Yg/680ahiSUq4Ofkf73QTFDSYUa1LtFFS1RYJF03a2Yu5Y eldZKkUtZu2vpye0B99uA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:iFKBwgBaBsA=:/m3VHcA6llK4UUT9JC9tqw RGSpb6mveUWU5jMGcwNhjvAwDDsR/nlZiMNFWCMpjAgZUk6ToDVypgnCAlgrKPgSeEF78kHE0 bNbVxtv5tKnShywobz1jiwWmdruUqpkAITutg7LzrETKvzXXT/4Px9ScDRi5tWBFz/x8yphMA nVdF7qXZVJm2eQtmliNikQFJzBvCoU1tJxCvPAuo50tfgyiuLvfoS8s+4O+Xu9CUYLS6K/lnz bBngLlrP0kBHBsvDrBYS6js5hhz4JTvYPs2nazlqOgTVU0vcVvxLTr3xVHvhqjxzWctAl+LCx uI+3JH5y92je3d2foKfyLgksvW9SKQdyQcbVefw2t0TzVrtZcpR6Mxi9LsHr19JIsLnpKjhz3 rSQQYM8kSuHCWGkLBPkz1yZ5CbGckbN17Rnea24TSTu+GKtE66jhBD/D5oNtqzuuxh7rq3qrj p+WfXegO25N43pnYovjT/qxLPvj0oOHKc9Ee31phVVDptsk2rlaTW3622NMNmj45I2cS4lojx YX+fCtsof5X51g4ru+BRBTvp1RJ/LWsbMDf42O3/QXO2rcTtf/7l10uSgd29ilK5eHj95/yrp +MGmbkuly7fESnmHx6/Qg4MinhljBTmqfr84SlR6DRiiHQZNsOKpQc4d93sy5o9GZhVf7SBFY jn72MdOjG+nKE3VXk108mizAY3nUyWF3FHqAZczr7yGeg3JgmVFnMuYsu0Pw1djDWvC6XqTq1 ss/FoEENiAr+spKJTQFiSjGP/DG7FcWIMMlxNPLO4RlmWOD2Wr11dlzMnbFL+uXuLeP69SWbb hKqMoeJhw/LEl6Du3DGm9dfQP95q+MyQCH3zdF0Fq2VXyAxVMR0CIZLmy2P5Zv+cp1cuWqSo3 ANaq8TVH48tjxZC5AUcSc/D+PO9ySaO9kKsVqnnmJf4D81h7kzPMw3RHudUrRI9HOkhLA+erG xkCTpPoojKwf8z5NZxj4jmEtZAwB8y0srSo6AKMFMomCCNbLowjLbrdJLwOuEbqBQAv1NmKZ6 a9c7+jwR9Lrct7J8PSS4vpEaDtJY1794c2FfufKDK14BAD5frgxLPRuBAXIEtUOCw2xrPe5QU BtTxZfycJKargGVZU9MebdLZW2xLfyMrI5SffIBwfnnP4AyUMhcSHOUaw== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 50034 Cc: Daniel Mendler , Stefan Monnier , 50034@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen writes: > It fails here: > > (`(lambda ,args . ,body) > (elisp--local-variables-1 > (append (remq '&optional (remq '&rest args)) vars) > (car (last body)))) I have the impression that the clause before that is supposed to match in this case (also see the FIXME). It doesn't because the defmacro macro expander adds an explicit `nil' body, i.e. the body is not empty as assumed in that clause. Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 23 10:18:03 2022 Received: (at 50034-done) by debbugs.gnu.org; 23 Aug 2022 14:18:03 +0000 Received: from localhost ([127.0.0.1]:44706 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQUjD-0006Xc-5f for submit@debbugs.gnu.org; Tue, 23 Aug 2022 10:18:03 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:49769) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQUjB-0006X7-6C for 50034-done@debbugs.gnu.org; Tue, 23 Aug 2022 10:18:01 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 75E2B4416BB; Tue, 23 Aug 2022 10:17:55 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 135BD4416C7; Tue, 23 Aug 2022 10:17:54 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1661264274; bh=ZYEMG3t/vo0/dROf+OlGfCA3nL1ZJ/dddGmwpJA4nyc=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=iCWNAc4lldQifHlQCD/9jNFHVvdmU4athqVWOWsRlRr7e1r8Edj7e3zHynx0j1X6Q upyL10PQr5tc1KYyGpWUmZW7tam1IPI3D3Q9SKcqqDwZXNYed2u7mpSZ4Y1b5LL3En V53AiDMdW01HtWupbebXSJmknDoWjsbNLqD3DTIrmBsDAEcffW9245vjMrgvA401Mq cuhERrzUjl3PR6fsjszKKkLoFuy5rS34cZTzTxxT7CzvyHFpAyeKAeumaZ9JGrmpQv wzUqSMwfBtiQ/+Vi1d+zzRYDdZJ/yvbU8kPFVG+XAU1KdTr+6JsA44ypByMrj2jvdM dmXsIuaBoGq/A== Received: from pastel (unknown [45.72.195.111]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 950931203D5; Tue, 23 Aug 2022 10:17:53 -0400 (EDT) From: Stefan Monnier To: Lars Ingebrigtsen Subject: Re: bug#50034: 28.0.50; elisp capf error "Wrong type argument: listp, elisp--witness--lisp" In-Reply-To: <87v949ee54.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 13 Aug 2021 14:13:27 +0200") Message-ID: References: <02b75b43-616e-51f1-5d7b-ecb2661d1838@daniel-mendler.de> <87v949ee54.fsf@gnus.org> Date: Tue, 23 Aug 2022 10:17:52 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.066 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50034-done Cc: Daniel Mendler , 50034-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Slightly simpler repro: > > (defmacro foo bar > M-: (elisp--local-variables) RET > > It fails here: > > (`(lambda ,args . ,body) > (elisp--local-variables-1 > (append (remq '&optional (remq '&rest args)) vars) > (car (last body)))) > > where it expects args to be a list, but it's the symbol > `elisp--witness--lisp'. Since the code can be completely non-sensical, `elisp--local-variables` shouldn't presume that the arglist is indeed a list. I installed the fix below on `master`. Stefan diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 0c4a9bfdbea..6d8ced7f220 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -383,7 +383,9 @@ elisp--local-variables-1 (setq sexp nil)) (`(lambda ,args . ,body) (elisp--local-variables-1 - (append (remq '&optional (remq '&rest args)) vars) + (let ((args (if (listp args) args))) + ;; FIXME: Exit the loop if witness is in args. + (append (remq '&optional (remq '&rest args)) vars)) (car (last body)))) (`(condition-case ,_ ,e) (elisp--local-variables-1 vars e)) (`(condition-case ,v ,_ . ,catches) From unknown Sat Jun 14 19:00:42 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 21 Sep 2022 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator