GNU bug report logs - #20525
25.0.50; edebug doesn't cooperate with when-let

Previous Next

Package: emacs;

Reported by: Aaron Ecay <aaronecay <at> gmail.com>

Date: Thu, 7 May 2015 15:35:03 UTC

Severity: normal

Found in version 25.0.50

Done: Artur Malabarba <bruce.connor.am <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20525 in the body.
You can then email your comments to 20525 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#20525; Package emacs. (Thu, 07 May 2015 15:35:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Aaron Ecay <aaronecay <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 07 May 2015 15:35:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Aaron Ecay <aaronecay <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; edebug doesn't cooperate with when-let
Date: Thu, 07 May 2015 16:33:38 +0100
Edebug does not play well with the single-binding form of the when-let
macro.  This is with git rev 08431a20c55 (and seems to have been the
case on master for several months, possibly since the introduction of
the when-let macro).

Steps to reproduce in emacs -Q:

Evaluate in scratch buffer:

(require 'subr-x)
(setq debug-on-error t)

Then write:

(defun awe-test ()
  (when-let ((foo t))
    foo))

Put point inside the defun and C-u C-M-x.  All works fine.

Remove the outer set of parentheses on the binding, as the when-let
docstring says is possible (“In the special case you only want to bind a
single value, BINDINGS can just be a plain tuple.”):

(defun awe-test ()
  (when-let (foo t)
    foo))

C-u C-M-x leads to the backtrace reproduced below.

Thanks,
Aaron

Debugger entered--Lisp error: (invalid-read-syntax "Failed matching" (&rest (symbolp form)))
  signal(invalid-read-syntax ("Failed matching" (&rest (symbolp form))))
  edebug-syntax-error("Failed matching" (&rest (symbolp form)))
  apply(edebug-syntax-error ("Failed matching" (&rest (symbolp form))))
  edebug-no-match(((foo t) (243 . 246) (247 . 248) . 249) "Failed matching" (&rest (symbolp form)))
  edebug-match-sublist(((foo t) (243 . 246) (247 . 248) . 249) (&rest (symbolp form)))
  edebug-match-list((((foo t) foo) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) (&rest (symbolp form)))
  edebug-match-one-spec((((foo t) foo) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) (&rest (symbolp form)))
  edebug-match-specs((((foo t) foo) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) ((&rest (symbolp form)) form body) edebug-match-specs)
  edebug-match-sublist((((foo t) foo) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) ((&rest (symbolp form)) form body))
  edebug-list-form((((foo t) foo) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258))
  edebug-form((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259))
  edebug-match-form((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259))
  edebug-match-symbol((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) form)
  edebug-match-one-spec((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) form)
  edebug-match-specs((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (form) edebug-&rest-wrapper)
  edebug-&optional-wrapper((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (form) edebug-&rest-wrapper)
  edebug-&rest-wrapper((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (form) edebug-&rest-wrapper)
  edebug-match-&rest((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (form))
  edebug-match-specs((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (&rest form) edebug-match-specs)
  edebug-match((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (&rest form))
  edebug-match-def-body((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259))
  edebug-match-symbol((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) def-body)
  edebug-match-one-spec((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) def-body)
  edebug-match-specs((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (def-body) edebug-match-specs)
  edebug-match-specs((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) ([&optional ("interactive" interactive)] def-body) edebug-match-specs)
  edebug-match-specs((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) ([&optional stringp] [&optional ("interactive" interactive)] def-body) edebug-match-specs)
  edebug-match-specs((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body) edebug-match-specs)
  edebug-match-specs((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body) edebug-match-specs)
  edebug-match-specs((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) ("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body) edebug-match-specs)
  edebug-match-sublist((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) ("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body))
  edebug-match-list((((defun awe-test nil (when-let (foo t) foo))) (211 (212 . 217) (218 . 226) (227 . 229) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259)) ("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body))
  edebug-match-one-spec((((defun awe-test nil (when-let (foo t) foo))) (211 (212 . 217) (218 . 226) (227 . 229) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259)) ("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body))
  edebug-match-specs((((defun awe-test nil (when-let (foo t) foo))) (211 (212 . 217) (218 . 226) (227 . 229) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259)) (("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body)) edebug-match-specs)
  edebug-match((((defun awe-test nil (when-let (foo t) foo))) (211 (212 . 217) (218 . 226) (227 . 229) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259)) (("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body)))
  edebug-make-form-wrapper((((defun awe-test nil (when-let (foo t) foo))) (211 (212 . 217) (218 . 226) (227 . 229) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259)) 211 258 (("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body)))
  edebug-read-and-maybe-wrap-form1()
  edebug-read-and-maybe-wrap-form()
  edebug-read-top-level-form()
  edebug-eval-defun((4))
  apply(edebug-eval-defun (4))
  eval-defun((4))
  funcall-interactively(eval-defun (4))
  call-interactively(eval-defun nil nil)
  command-execute(eval-defun)

In GNU Emacs 25.0.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.2)
 of 2015-05-03 on haize
Windowing system distributor `The X.Org Foundation', version 11.0.11701000
Configured using:
 `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --mandir=/usr/share/man
 --pdfdir=/usr/share/doc/emacs/pdf --with-sound=alsa --without-gconf
 --with-x-toolkit=gtk3 --with-xft 'CFLAGS=-march=x86-64 -mtune=generic
 -O2 -pipe -fstack-protector --param=ssp-buffer-size=4'
 CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix



-- 
Aaron Ecay




Added indication that bug 20525 blocks19759 Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 07 May 2015 15:45:03 GMT) Full text and rfc822 format available.

Reply sent to bruce.connor.am <at> gmail.com:
You have taken responsibility. (Thu, 07 May 2015 20:17:01 GMT) Full text and rfc822 format available.

Notification sent to Aaron Ecay <aaronecay <at> gmail.com>:
bug acknowledged by developer. (Thu, 07 May 2015 20:17:02 GMT) Full text and rfc822 format available.

Message #12 received at 20525-done <at> debbugs.gnu.org (full text, mbox):

From: Artur Malabarba <bruce.connor.am <at> gmail.com>
To: 20525-done <at> debbugs.gnu.org
Subject: Re: bug#20525: 25.0.50; edebug doesn't cooperate with when-let
Date: Thu, 7 May 2015 21:16:10 +0100
Fixed by setting the debug spec to ([&or (&rest (symbolp form))
(symbolp form)] form body)

3a33ac8 * lisp/emacs-lisp/subr-x.el (if-let): Fix debug spec

2015-05-07 16:33 GMT+01:00 Aaron Ecay <aaronecay <at> gmail.com>:
>
> Edebug does not play well with the single-binding form of the when-let
> macro.  This is with git rev 08431a20c55 (and seems to have been the
> case on master for several months, possibly since the introduction of
> the when-let macro).
>
> Steps to reproduce in emacs -Q:
>
> Evaluate in scratch buffer:
>
> (require 'subr-x)
> (setq debug-on-error t)
>
> Then write:
>
> (defun awe-test ()
>   (when-let ((foo t))
>     foo))
>
> Put point inside the defun and C-u C-M-x.  All works fine.
>
> Remove the outer set of parentheses on the binding, as the when-let
> docstring says is possible (“In the special case you only want to bind a
> single value, BINDINGS can just be a plain tuple.”):
>
> (defun awe-test ()
>   (when-let (foo t)
>     foo))
>
> C-u C-M-x leads to the backtrace reproduced below.
>
> Thanks,
> Aaron
>
> Debugger entered--Lisp error: (invalid-read-syntax "Failed matching" (&rest (symbolp form)))
>   signal(invalid-read-syntax ("Failed matching" (&rest (symbolp form))))
>   edebug-syntax-error("Failed matching" (&rest (symbolp form)))
>   apply(edebug-syntax-error ("Failed matching" (&rest (symbolp form))))
>   edebug-no-match(((foo t) (243 . 246) (247 . 248) . 249) "Failed matching" (&rest (symbolp form)))
>   edebug-match-sublist(((foo t) (243 . 246) (247 . 248) . 249) (&rest (symbolp form)))
>   edebug-match-list((((foo t) foo) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) (&rest (symbolp form)))
>   edebug-match-one-spec((((foo t) foo) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) (&rest (symbolp form)))
>   edebug-match-specs((((foo t) foo) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) ((&rest (symbolp form)) form body) edebug-match-specs)
>   edebug-match-sublist((((foo t) foo) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) ((&rest (symbolp form)) form body))
>   edebug-list-form((((foo t) foo) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258))
>   edebug-form((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259))
>   edebug-match-form((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259))
>   edebug-match-symbol((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) form)
>   edebug-match-one-spec((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) form)
>   edebug-match-specs((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (form) edebug-&rest-wrapper)
>   edebug-&optional-wrapper((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (form) edebug-&rest-wrapper)
>   edebug-&rest-wrapper((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (form) edebug-&rest-wrapper)
>   edebug-match-&rest((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (form))
>   edebug-match-specs((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (&rest form) edebug-match-specs)
>   edebug-match((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (&rest form))
>   edebug-match-def-body((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259))
>   edebug-match-symbol((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) def-body)
>   edebug-match-one-spec((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) def-body)
>   edebug-match-specs((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (def-body) edebug-match-specs)
>   edebug-match-specs((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) ([&optional ("interactive" interactive)] def-body) edebug-match-specs)
>   edebug-match-specs((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) ([&optional stringp] [&optional ("interactive" interactive)] def-body) edebug-match-specs)
>   edebug-match-specs((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body) edebug-match-specs)
>   edebug-match-specs((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) (name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body) edebug-match-specs)
>   edebug-match-specs((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) ("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body) edebug-match-specs)
>   edebug-match-sublist((((when-let (foo t) foo)) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259) ("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body))
>   edebug-match-list((((defun awe-test nil (when-let (foo t) foo))) (211 (212 . 217) (218 . 226) (227 . 229) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259)) ("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body))
>   edebug-match-one-spec((((defun awe-test nil (when-let (foo t) foo))) (211 (212 . 217) (218 . 226) (227 . 229) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259)) ("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body))
>   edebug-match-specs((((defun awe-test nil (when-let (foo t) foo))) (211 (212 . 217) (218 . 226) (227 . 229) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259)) (("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body)) edebug-match-specs)
>   edebug-match((((defun awe-test nil (when-let (foo t) foo))) (211 (212 . 217) (218 . 226) (227 . 229) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259)) (("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body)))
>   edebug-make-form-wrapper((((defun awe-test nil (when-let (foo t) foo))) (211 (212 . 217) (218 . 226) (227 . 229) (232 (233 . 241) (242 (243 . 246) (247 . 248) . 249) (254 . 257) . 258) . 259)) 211 258 (("defun" name lambda-list [&optional stringp] [&optional ("interactive" interactive)] def-body)))
>   edebug-read-and-maybe-wrap-form1()
>   edebug-read-and-maybe-wrap-form()
>   edebug-read-top-level-form()
>   edebug-eval-defun((4))
>   apply(edebug-eval-defun (4))
>   eval-defun((4))
>   funcall-interactively(eval-defun (4))
>   call-interactively(eval-defun nil nil)
>   command-execute(eval-defun)
>
> In GNU Emacs 25.0.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.16.2)
>  of 2015-05-03 on haize
> Windowing system distributor `The X.Org Foundation', version 11.0.11701000
> Configured using:
>  `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
>  --localstatedir=/var --mandir=/usr/share/man
>  --pdfdir=/usr/share/doc/emacs/pdf --with-sound=alsa --without-gconf
>  --with-x-toolkit=gtk3 --with-xft 'CFLAGS=-march=x86-64 -mtune=generic
>  -O2 -pipe -fstack-protector --param=ssp-buffer-size=4'
>  CPPFLAGS=-D_FORTIFY_SOURCE=2
>  LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'
>
> Configured features:
> XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY
> ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
>
> Important settings:
>   value of $LC_COLLATE: C
>   value of $LANG: en_US.UTF-8
>   locale-coding-system: utf-8-unix
>
>
>
> --
> Aaron Ecay
>
>
>




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 05 Jun 2015 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 18 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.