From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#29345: 27.0.50; Error message for cl-destructuring-bind could be improved Date: Sun, 14 Jul 2019 21:41:59 +0200 Message-ID: <87ftn8wghk.fsf@mouse.gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="197845"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 29345@debbugs.gnu.org To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 14 21:43:07 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hmkOo-000pII-UB for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jul 2019 21:43:07 +0200 Original-Received: from localhost ([::1]:33854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmkOn-0007Wr-WF for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Jul 2019 15:43:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41734) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmkOl-0007WY-8g for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 15:43:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmkOk-00051t-8B for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 15:43:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37183) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hmkOk-00051l-4g for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 15:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hmkOj-0005r4-VR for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2019 15:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Jul 2019 19:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29345 X-GNU-PR-Package: emacs Original-Received: via spool by 29345-submit@debbugs.gnu.org id=B29345.156313332822301 (code B ref 29345); Sun, 14 Jul 2019 19:43:01 +0000 Original-Received: (at 29345) by debbugs.gnu.org; 14 Jul 2019 19:42:08 +0000 Original-Received: from localhost ([127.0.0.1]:46004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmkNr-0005nb-Vm for submit@debbugs.gnu.org; Sun, 14 Jul 2019 15:42:08 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:57464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmkNo-0005nA-70 for 29345@debbugs.gnu.org; Sun, 14 Jul 2019 15:42:04 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hmkNj-0005Nv-Rd; Sun, 14 Jul 2019 21:42:02 +0200 In-Reply-To: (Philipp Stephani's message of "Fri, 17 Nov 2017 21:30:09 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:163030 Archived-At: Philipp Stephani writes: > $ emacs -Q -batch -l cl-lib -eval '(cl-destructuring-bind (a b) (list 1))' > Wrong number of arguments: nil, 1 > > It would be nice if the first error data item weren't nil, but > e.g. `(cl-destructuring-bind (a b))` so that the error is obvious. What about Wrong number of arguments: (a b), 1 The following patch achieves that, but since it was explicitly 'cl-none before (which is the magic value that gives you nil in that error message), I'm not sure whether this has any negative effects? Probably not, because there's this: (defvar cl--bind-block) ;Name of surrounding block, only use for `signal' data. Any opinions? diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 4347b4b71b..8b9224bd1b 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -695,8 +695,11 @@ cl-destructuring-bind "Bind the variables in ARGS to the result of EXPR and execute BODY." (declare (indent 2) (debug (&define cl-macro-list1 def-form cl-declarations def-body))) - (let* ((cl--bind-lets nil) (cl--bind-forms nil) - (cl--bind-defs nil) (cl--bind-block 'cl-none) (cl--bind-enquote nil)) + (let* ((cl--bind-lets nil) + (cl--bind-forms nil) + (cl--bind-defs nil) + (cl--bind-block args) + (cl--bind-enquote nil)) (cl--do-arglist (or args '(&aux)) expr) (macroexp-let* (nreverse cl--bind-lets) (macroexp-progn (append (nreverse cl--bind-forms) body))))) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no