From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ben Liblit Newsgroups: gmane.emacs.bugs Subject: bug#24255: 25.1; incorrect edebug spec for cl-defun Date: Wed, 17 Aug 2016 15:15:20 -0500 Message-ID: <5cb85917-ccd6-0807-112d-8df7972194cd@acm.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1471464989 5428 195.159.176.226 (17 Aug 2016 20:16:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 17 Aug 2016 20:16:29 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 To: 24255@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 17 22:16:22 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ba7G8-0000wY-NT for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Aug 2016 22:16:20 +0200 Original-Received: from localhost ([::1]:49396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ba7G5-0004EN-SO for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Aug 2016 16:16:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57004) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ba7Fw-0004EG-7s for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2016 16:16:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ba7Fq-0004hz-5K for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2016 16:16:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ba7Fq-0004hv-1y for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2016 16:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ba7Fp-0002IM-S5 for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2016 16:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ben Liblit Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Aug 2016 20:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 24255 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14714649558807 (code B ref -1); Wed, 17 Aug 2016 20:16:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Aug 2016 20:15:55 +0000 Original-Received: from localhost ([127.0.0.1]:60540 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ba7Ff-0002Hu-DF for submit@debbugs.gnu.org; Wed, 17 Aug 2016 16:15:55 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:37731) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ba7Fa-0002He-H4 for submit@debbugs.gnu.org; Wed, 17 Aug 2016 16:15:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ba7FP-0004eS-M1 for submit@debbugs.gnu.org; Wed, 17 Aug 2016 16:15:40 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:53425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ba7FP-0004eI-DO for submit@debbugs.gnu.org; Wed, 17 Aug 2016 16:15:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ba7FK-0004Cl-2C for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2016 16:15:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ba7FD-0004cB-Qi for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2016 16:15:28 -0400 Original-Received: from smtpout.cs.wisc.edu ([128.105.6.53]:39404 helo=smtpout2.cs.wisc.edu) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ba7FD-0004bu-KE for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2016 16:15:23 -0400 Original-Received: from byrd.cs.wisc.edu (byrd.cs.wisc.edu [128.105.15.5]) by flint.cs.wisc.edu (8.14.7/8.14.4) with ESMTP id u7HKFKuU022434 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Wed, 17 Aug 2016 15:15:22 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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: 208.118.235.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:122334 Archived-At: The edebug specification for cl-defun seems to be incorrect. I believe it does not properly cover cases where cl-defun is used for destructuring along the lines of cl-destructuring-bind, such as in: (require 'cl-lib) (cl-defun sum ((x y)) (+ x y)) Notice that the argument list to sum is performing a destructuring bind. Thus, one would call this using something like "(sum '(1 2))". To see the bug, proceed as follows: (1) Start emacs using "emacs -Q". (2) Place the two-line example given above in an Emacs Lisp buffer. (3) Type "M-x eval-buffer". Observe that there is no error. (4) Type "M-x edebug-all-defs". (5) Type "M-x eval-buffer" again. Observe the following error: edebug-syntax-error: Invalid read syntax: "Failed matching", ([&rest arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] [&optional ["&rest" arg]] [&optional ["&key" [cl-&key-arg &rest cl-&key-arg] &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or (symbolp &optional def-form) symbolp]]) Destructuring in cl-defun is certainly valid. You can see this in the documentation for cl-defun, which notes that "VAR maybe be replaced recursively with an argument list for destructing". The info documentation for cl also states that "In Common Lisp, destructuring is only allowed with 'defmacro'; this package allows it with 'cl-defun' and other argument lists as well." I am reporting this bug against Emacs 25.1 rc1. However, I see the same problem going at least as far back as Emacs 24.3. You definitely do not need to build the release candidate in order to reproduce this bug. In GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.13) of 2016-08-16 built on localhost.localdomain Windowing system distributor 'The X.Org Foundation', version 11.0.11702000 System Description: Red Hat Enterprise Linux Server release 7.2 (Maipo) Configured using: 'configure --with-dbus --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3 --with-gpm=no --with-xwidgets --prefix=/u/l/i/liblit/Downloads/emacs-25.1-rc1' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GCONF GSETTINGS NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XWIDGETS Important settings: value of $LC_CTYPE: en_US.UTF-8 value of $LC_MONETARY: en_US.utf8 value of $LC_NUMERIC: en_US.utf8 value of $LC_TIME: en_US.utf8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: diff-auto-refine-mode: t tooltip-mode: t global-eldoc-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 auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Please type y, n, or !: y Making completion list... Edebugging all definitions is on. edebug-syntax-error: Invalid read syntax: "Failed matching", ([&rest arg] [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]] [&optional ["&rest" arg]] [&optional ["&key" [cl-&key-arg &rest cl-&key-arg] &optional "&allow-other-keys"]] [&optional ["&aux" &rest &or (symbolp &optional def-form) symbolp]]) Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode mail-prsvr mail-utils edebug cl-seq cl-macs gv cl-loaddefs pcase cl-lib vc-git diff-mode easymenu easy-mmode time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame 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 charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting xwidget-internal move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 95803 5203) (symbols 48 20828 0) (miscs 40 102 107) (strings 32 17346 4912) (string-bytes 1 501304) (vectors 16 14033) (vector-slots 8 453896 5184) (floats 8 172 26) (intervals 56 280 0) (buffers 976 21) (heap 1024 40970 1627))