all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#28747: 26.0.60; Usage of "&rest body" in Edebug specs
@ 2017-10-08 15:02 Gemini Lasswell
  2017-10-13  0:54 ` Noam Postavsky
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Gemini Lasswell @ 2017-10-08 15:02 UTC (permalink / raw)
  To: 28747

The symbol &rest in an Edebug spec has a different meaning than it has
in an argument list. In particular, "&rest body" in an Edebug spec is
erroneous usage because it is asking Edebug to match something that
can match nothing (body) as many times as it can, which makes an
infinite loop.

To repro, navigate to the definition of crm-completion-help in
lisp/emacs-lisp/crm.el and:

M-x eval-buffer RET
C-u C-M-x

Result: Too deep - perhaps infinite loop in spec?

Here are the macros I've found that have this incorrect usage of &rest
in their Edebug specs:

crm--completion-command
easy-mmode-define-navigation
inline--letlisteval
inline--leteval
ses--letref

Edebug specs have been using &rest for a really long time and it
mostly gets used correctly. But &repeat would be better, since it
actually describes the functionality and doesn't have a completely
different and more common usage in argument lists.

Here's a little example of what an Edebug spec would look like with
&repeat in place of &rest:

(defmacro msgmac (&rest args)
  (declare (debug ("start" [&repeat "middle"] "end")))
  `(message "%s" ',args))

(defun use-msgmac ()
  (msgmac start end)
  (msgmac start middle end)
  (msgmac start middle middle end))

Does anyone have thoughts on the idea of adding &repeat as a synonym
for &rest in Edebug specs, with the goal of moving &rest towards
obsolescence eventually?






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

end of thread, other threads:[~2022-05-01  8:49 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-08 15:02 bug#28747: 26.0.60; Usage of "&rest body" in Edebug specs Gemini Lasswell
2017-10-13  0:54 ` Noam Postavsky
2019-10-16  2:45 ` Lars Ingebrigtsen
2019-10-18  3:12   ` Richard Stallman
2019-10-18  3:35     ` Lars Ingebrigtsen
2019-10-18 14:14       ` Richard Stallman
2019-10-19  8:20         ` Lars Ingebrigtsen
2019-10-19 14:02   ` Michael Heerdegen
2022-01-29 15:56   ` Lars Ingebrigtsen
2022-02-01  5:03     ` Richard Stallman
2022-01-29 23:25 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-31  2:21   ` Lars Ingebrigtsen
2022-01-31  2:30     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-31  2:35       ` Lars Ingebrigtsen
2022-01-31  2:44         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-31  3:00           ` Lars Ingebrigtsen
2022-05-01  8:49             ` Lars Ingebrigtsen

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.