all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#21920: 25.0.50; describe-symbols cannot be debugged with Edebug
@ 2015-11-14 17:32 Eli Zaretskii
  2015-11-15  9:35 ` Michael Heerdegen
  2015-11-15 16:09 ` Johan Bockgård
  0 siblings, 2 replies; 7+ messages in thread
From: Eli Zaretskii @ 2015-11-14 17:32 UTC (permalink / raw)
  To: 21920


M-x load-file RET lisp/help-fns.el
C-x C-f lisp/help-fns.el RET

Go to the describe-symbol function and type:

M-x edebug-defun RET

This signals an error:

  pcase--macroexpand: Unknown edebug-enter pattern: (edebug-enter (quote describe-symbol) nil (function (lambda nil (edebug-after 0 80 descfn))))




In GNU Emacs 25.0.50.7 (i686-pc-mingw32)
 of 2015-11-14
Repository revision: 855c6e8cdb9b0875ce9c5b2b0fd3e74a15888278
Windowing system distributor 'Microsoft Corp.', version 5.1.2600
Configured using:
 'configure --prefix=/d/usr --enable-checking=yes,glyphs --with-wide-int
 'CFLAGS=-O0 -gdwarf-4 -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1255

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.
Mark saved where search started
user-error: Beginning of history; no preceding item
Loading d:/gnu/git/emacs/branch/lisp/help-fns.el (source)...done
Edebug: edebug-anon0
Edebug: edebug-anon1
Edebug: edebug-anon2
Edebug: describe-symbol
pcase--macroexpand: Unknown edebug-enter pattern: (edebug-enter (quote describe-symbol) nil (function (lambda nil (edebug-after 0 80 descfn))))

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message dired format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils cl-macs edebug help-fns character-fold
misearch multi-isearch vc vc-dispatcher vc-git diff-mode easy-mmode map
seq byte-opt gv bytecomp byte-compile cconv cl-extra help-mode easymenu
cl-loaddefs pcase cl-lib time-date mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp
disp-table w32-win w32-vars term/common-win 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 w32notify w32 multi-tty
make-network-process emacs)

Memory information:
((conses 16 106834 6483)
 (symbols 56 21746 0)
 (miscs 48 51 150)
 (strings 16 23538 23523)
 (string-bytes 1 583706)
 (vectors 16 13868)
 (vector-slots 8 479693 4759)
 (floats 8 163 88)
 (intervals 40 540 207)
 (buffers 856 12))





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#21920: 25.0.50; describe-symbols cannot be debugged with Edebug
  2015-11-14 17:32 bug#21920: 25.0.50; describe-symbols cannot be debugged with Edebug Eli Zaretskii
@ 2015-11-15  9:35 ` Michael Heerdegen
  2015-11-15 19:41   ` Eli Zaretskii
  2015-11-15 16:09 ` Johan Bockgård
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Heerdegen @ 2015-11-15  9:35 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 21920

Eli Zaretskii <eliz@gnu.org> writes:

> pcase--macroexpand: Unknown edebug-enter pattern: (edebug-enter (quote
> describe-symbol) nil (function (lambda nil (edebug-after 0 80
> descfn))))

Eli, isn't this a duplicate of #21847 and #20503?

Michael.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#21920: 25.0.50; describe-symbols cannot be debugged with Edebug
  2015-11-14 17:32 bug#21920: 25.0.50; describe-symbols cannot be debugged with Edebug Eli Zaretskii
  2015-11-15  9:35 ` Michael Heerdegen
@ 2015-11-15 16:09 ` Johan Bockgård
  2015-11-15 19:46   ` Eli Zaretskii
  1 sibling, 1 reply; 7+ messages in thread
From: Johan Bockgård @ 2015-11-15 16:09 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 21920, Stefan Monnier

Eli Zaretskii <eliz@gnu.org> writes:

> M-x load-file RET lisp/help-fns.el
> C-x C-f lisp/help-fns.el RET
>
> Go to the describe-symbol function and type:
>
> M-x edebug-defun RET
>
> This signals an error:
>
>   pcase--macroexpand: Unknown edebug-enter pattern: (edebug-enter (quote describe-symbol) nil (function (lambda nil (edebug-after 0 80 descfn))))

That last part (pcase-QPAT) of the patch in

    http://lists.gnu.org/archive/html/emacs-devel/2015-10/msg02285.html

should fix this.


The patch also contains code to step through SYMBOL bindings as was
suggested in that thread, i.e. it will make Edebug pause after x and y
in

    (pcase '(0 1) (`(,x 2) 3) (y 4))

This may make pcase a little more easy to understand—which branches it
tried and where it backtracked. On the other hand it may be illogical
since it would be a bit like stepping through the ARGS of lambda or
destructuring-bind.


Finally, here's a second patch that adds full support for stepping of
`pred' and `app' patterns. It instruments each ARG (x) of FUN (+) as
well as the result of FUN itself (including the hidden argument):

    (pcase '(1 2) (`(,x ,(pred (+ x))) t))

This completes the edebug support for pcase.


diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el
index 3ea519c..adac2d9 100644
--- a/lisp/emacs-lisp/pcase.el
+++ b/lisp/emacs-lisp/pcase.el
@@ -94,12 +94,21 @@ (defun pcase--edebug-match-macro (cursor)
 		 specs)))))
     (edebug-match cursor (cons '&or specs))))
 
-(def-edebug-spec
-  pcase-FUN
-  (&or lambda-expr
-       ;; Punt on macros/special forms.
-       (functionp &rest form)
-       sexp))
+(def-edebug-spec pcase-FUN pcase--edebug-match-fun)
+(defun pcase--edebug-match-fun (cursor)
+  (let ((sexp (edebug-top-element-required cursor "Expected" '(pcase-FUN))))
+    ;; FUN = (lambda ...) | (F ...) | F
+    (if (eq 'lambda (car-safe sexp))
+        (list (edebug-match cursor '(lambda-expr)))
+      (let* ((x (make-symbol "x"))
+             (f (car (edebug-match cursor '(form))))
+             ;; Hack edebug instrumented form.
+             (g (let ((e (nthcdr 3 f)))
+                  (if (consp (car e))
+                      (setcdr (last (car e)) (list x))
+                    (setcar e (cons (car e) (list x))))
+                  f)))
+        (list `(lambda (,x) ,g))))))
 
 (def-edebug-spec
   pcase-PAT





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#21920: 25.0.50; describe-symbols cannot be debugged with Edebug
  2015-11-15  9:35 ` Michael Heerdegen
@ 2015-11-15 19:41   ` Eli Zaretskii
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2015-11-15 19:41 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 21920

> From: Michael Heerdegen <michael_heerdegen@web.de>
> Cc: 21920@debbugs.gnu.org
> Date: Sun, 15 Nov 2015 10:35:47 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > pcase--macroexpand: Unknown edebug-enter pattern: (edebug-enter (quote
> > describe-symbol) nil (function (lambda nil (edebug-after 0 80
> > descfn))))
> 
> Eli, isn't this a duplicate of #21847 and #20503?

It certainly looks like that.  Sorry for not checking the database.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#21920: 25.0.50; describe-symbols cannot be debugged with Edebug
  2015-11-15 16:09 ` Johan Bockgård
@ 2015-11-15 19:46   ` Eli Zaretskii
  2015-11-16 23:02     ` Johan Bockgård
  0 siblings, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2015-11-15 19:46 UTC (permalink / raw)
  To: Johan Bockgård; +Cc: 21920, monnier

> From: Johan Bockgård <bojohan@gnu.org>
> Cc: 21920@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Sun, 15 Nov 2015 17:09:54 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > M-x load-file RET lisp/help-fns.el
> > C-x C-f lisp/help-fns.el RET
> >
> > Go to the describe-symbol function and type:
> >
> > M-x edebug-defun RET
> >
> > This signals an error:
> >
> >   pcase--macroexpand: Unknown edebug-enter pattern: (edebug-enter (quote describe-symbol) nil (function (lambda nil (edebug-after 0 80 descfn))))
> 
> That last part (pcase-QPAT) of the patch in
> 
>     http://lists.gnu.org/archive/html/emacs-devel/2015-10/msg02285.html
> 
> should fix this.

Any reason why that part could not be applied to emacs-25 branch?

Thanks.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#21920: 25.0.50; describe-symbols cannot be debugged with Edebug
  2015-11-15 19:46   ` Eli Zaretskii
@ 2015-11-16 23:02     ` Johan Bockgård
  2015-11-19 22:45       ` Johan Bockgård
  0 siblings, 1 reply; 7+ messages in thread
From: Johan Bockgård @ 2015-11-16 23:02 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 21920

Eli Zaretskii <eliz@gnu.org> writes:

> Any reason why that part could not be applied to emacs-25 branch?

Committed.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#21920: 25.0.50; describe-symbols cannot be debugged with Edebug
  2015-11-16 23:02     ` Johan Bockgård
@ 2015-11-19 22:45       ` Johan Bockgård
  0 siblings, 0 replies; 7+ messages in thread
From: Johan Bockgård @ 2015-11-19 22:45 UTC (permalink / raw)
  To: 21920-done


Closing.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-11-19 22:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-14 17:32 bug#21920: 25.0.50; describe-symbols cannot be debugged with Edebug Eli Zaretskii
2015-11-15  9:35 ` Michael Heerdegen
2015-11-15 19:41   ` Eli Zaretskii
2015-11-15 16:09 ` Johan Bockgård
2015-11-15 19:46   ` Eli Zaretskii
2015-11-16 23:02     ` Johan Bockgård
2015-11-19 22:45       ` Johan Bockgård

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.