unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Gemini Lasswell <gazally@runbox.com>
To: 28747@debbugs.gnu.org
Subject: bug#28747: 26.0.60; Usage of "&rest body" in Edebug specs
Date: Sun, 08 Oct 2017 08:02:56 -0700	[thread overview]
Message-ID: <87o9phznq7.fsf@runbox.com> (raw)

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?






             reply	other threads:[~2017-10-08 15:02 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-08 15:02 Gemini Lasswell [this message]
2017-10-13  0:54 ` bug#28747: 26.0.60; Usage of "&rest body" in Edebug specs 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

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87o9phznq7.fsf@runbox.com \
    --to=gazally@runbox.com \
    --cc=28747@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).