From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#53227: master: Wrong error message with M-: (funcall). Date: Thu, 13 Jan 2022 18:24:30 +0000 Message-ID: References: <874k683smu.fsf@gmail.com> <87mtk0ugjn.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20279"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 53227@debbugs.gnu.org, Robert Pluim , Stefan Monnier To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 13 19:25:21 2022 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 1n84mn-00054t-Go for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Jan 2022 19:25:21 +0100 Original-Received: from localhost ([::1]:44722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n84mm-0005h5-0y for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Jan 2022 13:25:20 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n84mV-0005gL-1E for bug-gnu-emacs@gnu.org; Thu, 13 Jan 2022 13:25:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n84mU-0003k1-O7 for bug-gnu-emacs@gnu.org; Thu, 13 Jan 2022 13:25:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n84mU-0004Bm-Fh for bug-gnu-emacs@gnu.org; Thu, 13 Jan 2022 13:25:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 13 Jan 2022 18:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53227 X-GNU-PR-Package: emacs Original-Received: via spool by 53227-submit@debbugs.gnu.org id=B53227.164209828216066 (code B ref 53227); Thu, 13 Jan 2022 18:25:02 +0000 Original-Received: (at 53227) by debbugs.gnu.org; 13 Jan 2022 18:24:42 +0000 Original-Received: from localhost ([127.0.0.1]:34559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n84mA-0004B4-BC for submit@debbugs.gnu.org; Thu, 13 Jan 2022 13:24:42 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:15285 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1n84m7-0004Ao-Vo for 53227@debbugs.gnu.org; Thu, 13 Jan 2022 13:24:41 -0500 Original-Received: (qmail 8133 invoked by uid 3782); 13 Jan 2022 18:24:32 -0000 Original-Received: from acm.muc.de (p4fe1586e.dip0.t-ipconnect.de [79.225.88.110]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 13 Jan 2022 19:24:31 +0100 Original-Received: (qmail 7706 invoked by uid 1000); 13 Jan 2022 18:24:30 -0000 Content-Disposition: inline In-Reply-To: <87mtk0ugjn.fsf@gnus.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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" Xref: news.gmane.io gmane.emacs.bugs:224127 Archived-At: Hello, Lars. On Thu, Jan 13, 2022 at 10:32:44 +0100, Lars Ingebrigtsen wrote: > Robert Pluim writes: > > Itʼs not Ffuncall's responsibility to check that, itʼs 'eval' that > > should be doing it. Compare with eg M-: (format), which correctly > > signals 'wrong-number-of-arguments. > Or rather macroexpand-all: > (macroexpand-all '(format)) > => (format) > (macroexpand-all '(funcall)) > => (funcall nil) Yes, it is the macro expansion causing the problem, thanks. The following fixes it (or, at least, "fixes" it; I'm not clear exactly what the pcase--dontcare clause is there for). diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 663856a8fb..eb5af9ece6 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -441,8 +373,9 @@ macroexp--expand-all (macroexp--all-forms args) form) (macroexp--expand-all newform)))) - - (`(funcall . ,(or `(,exp . ,args) pcase--dontcare)) + (`(funcall) + form) + (`(funcall . (,exp . ,args)) (let ((eexp (macroexp--expand-all exp)) (eargs (macroexp--all-forms args))) ;; Rewrite (funcall #'foo bar) to (foo bar), in case `foo' > Perhaps Stefan has some insights into this; added to the CCs. > -- > (domestic pets only, the antidote for overdose, milk.) > bloggy blog: http://lars.ingebrigtsen.no -- Alan Mackenzie (Nuremberg, Germany).