all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ben Liblit <liblit@acm.org>
To: 24255@debbugs.gnu.org
Subject: bug#24255: 25.1; incorrect edebug spec for cl-defun
Date: Wed, 17 Aug 2016 15:15:20 -0500	[thread overview]
Message-ID: <5cb85917-ccd6-0807-112d-8df7972194cd@acm.org> (raw)

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))





             reply	other threads:[~2016-08-17 20:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17 20:15 Ben Liblit [this message]
     [not found] ` <handler.24255.B.14714649558807.ack@debbugs.gnu.org>
2016-08-17 20:27   ` bug#24255: Acknowledgement (25.1; incorrect edebug spec for cl-defun) Ben Liblit
2017-10-06 18:07 ` bug#24255: 25.1; incorrect edebug spec for cl-defun Gemini Lasswell
2017-10-16 18:15   ` Gemini Lasswell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5cb85917-ccd6-0807-112d-8df7972194cd@acm.org \
    --to=liblit@acm.org \
    --cc=24255@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.