* bug#27747: 26.0.50; cl-defgeneric does not have an Edebug spec
@ 2017-07-18 5:06 Gemini Lasswell
2017-10-06 18:39 ` Gemini Lasswell
2017-10-23 17:52 ` Gemini Lasswell
0 siblings, 2 replies; 3+ messages in thread
From: Gemini Lasswell @ 2017-07-18 5:06 UTC (permalink / raw
To: 27747
There is no Edebug spec for cl-defgeneric, which means that default
method implementations and methods defined using its :method keyword
can't be Edebugged.
To reproduce the problem, start with this bit of code in a buffer:
(cl-defgeneric my-say (obj)
"Say something about OBJ."
(message "See the %s!" obj))
(cl-defmethod my-say ((obj number))
(message "See the number %s!" obj))
Then:
M-x edebug-all-defs RET
M-x eval-buffer RET
M-: (my-say "cat") RET
Result: the command completes without Edebug starting.
This works correctly:
M-: (my-say 3) RET
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#27747: 26.0.50; cl-defgeneric does not have an Edebug spec
2017-07-18 5:06 bug#27747: 26.0.50; cl-defgeneric does not have an Edebug spec Gemini Lasswell
@ 2017-10-06 18:39 ` Gemini Lasswell
2017-10-23 17:52 ` Gemini Lasswell
1 sibling, 0 replies; 3+ messages in thread
From: Gemini Lasswell @ 2017-10-06 18:39 UTC (permalink / raw
To: 27747-done
This is fixed by the patch for bug#24773, just pushed to emacs-26.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#27747: 26.0.50; cl-defgeneric does not have an Edebug spec
2017-07-18 5:06 bug#27747: 26.0.50; cl-defgeneric does not have an Edebug spec Gemini Lasswell
2017-10-06 18:39 ` Gemini Lasswell
@ 2017-10-23 17:52 ` Gemini Lasswell
1 sibling, 0 replies; 3+ messages in thread
From: Gemini Lasswell @ 2017-10-23 17:52 UTC (permalink / raw
To: 27747
[-- Attachment #1: Type: text/plain, Size: 553 bytes --]
Here's a revision to the cl-defgeneric Edebug spec, because I missed
this case:
(cl-defgeneric (setf foo) (v args))
which isn't documented but lets you create a generalized variable.
Also, the Edebug spec for cl-lambda-list isn't necessarily loaded and
isn't correct for cl-defgeneric anyway. Since there isn't any code for
Edebug to instrument inside the argument list, it can just be matched
with listp.
To reproduce these problems, start with emacs -Q and load
test/lisp/emacs-lisp/cl-generic-tests.el, then use edebug-all-defs and
eval-buffer.
[-- Attachment #2: 0001-Handle-generic-variables-in-cl-defgeneric-Edebug-spe.patch --]
[-- Type: text/plain, Size: 1116 bytes --]
From 912942457d93850b2d444cf25cf7e71e79259357 Mon Sep 17 00:00:00 2001
From: Gemini Lasswell <gazally@runbox.com>
Date: Mon, 23 Oct 2017 10:13:00 -0700
Subject: [PATCH] Handle generic variables in cl-defgeneric Edebug spec
*lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Match (setf name)
and replace incorrect cl-lambda-args with listp in Edebug spec.
---
lisp/emacs-lisp/cl-generic.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index 62befd4742..0027899679 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -206,7 +206,8 @@ cl-defgeneric
\(fn NAME ARGS [DOC-STRING] [OPTIONS-AND-METHODS...] &rest DEFAULT-BODY)"
(declare (indent 2) (doc-string 3)
(debug
- (&define name cl-lambda-list lambda-doc
+ (&define [&or name ("setf" name :name setf)] listp
+ lambda-doc
[&rest [&or
("declare" &rest sexp)
(":argument-precedence-order" &rest sexp)
--
2.14.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-23 17:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-18 5:06 bug#27747: 26.0.50; cl-defgeneric does not have an Edebug spec Gemini Lasswell
2017-10-06 18:39 ` Gemini Lasswell
2017-10-23 17:52 ` Gemini Lasswell
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.