unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: 34481@debbugs.gnu.org
Subject: bug#34481: 27.0.50; cl-flet, cl-labels and lambda expressions
Date: Fri, 4 Oct 2019 00:28:26 +0200	[thread overview]
Message-ID: <CADwFkmkpyXk4Pqprcbc4sFc0M3vKeF7SwvPmr+mnq-f3Fkq3ow@mail.gmail.com> (raw)
In-Reply-To: <87r2c9iz02.fsf@web.de>

Michael Heerdegen <michael_heerdegen@web.de> writes:

>> 1.  `cl-flet's edebug spec only works with one allowed syntax, when all
>> bindings look like (FUNC ARGLIST BODY...).  The second possible syntax
>> (FUNC EXP) makes edebug barf, no edebugging possible :-(

I also ran into this today.

> Who knows if this is correct?

The below patch fixes the problem for me at least.  If no one objects,
perhaps we could install it?  Or could it make matters worse?

> From 3859414d19bc9de1593af7276decafe9b34ee628 Mon Sep 17 00:00:00 2001
> From: Michael Heerdegen <michael_heerdegen@web.de>
> Date: Tue, 19 Feb 2019 01:12:07 +0100
> Subject: [PATCH] Extend debug spec of cl-flet
>
> * lisp/emacs-lisp/cl-macs.el (cl-flet): Extend debug spec to cover
> definitions of the form (FUNC EXP).
> ---
>  lisp/emacs-lisp/cl-macs.el | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
> index 5faa055f99..9f79b1a7cf 100644
> --- a/lisp/emacs-lisp/cl-macs.el
> +++ b/lisp/emacs-lisp/cl-macs.el
> @@ -2044,7 +2044,9 @@ cl-flet
>  info node `(cl) Function Bindings' for details.
>
>  \(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
> -  (declare (indent 1) (debug ((&rest (cl-defun)) cl-declarations body)))
> +  (declare (indent 1)
> +           (debug ((&rest [&or (&define name form) (cl-defun)])
> +                   cl-declarations body)))
>    (let ((binds ()) (newenv macroexpand-all-environment))
>      (dolist (binding bindings)
>        (let ((var (make-symbol (format "--cl-%s--" (car binding))))
> --
> 2.20.1
>
>
> I wasn't sure if I need to use "def-form" instead of "form" (I guess
> not) or if some "nil" or "gate" magic is needed in addition.

I don't know either, unfortunately.  I have only tested and verified
it fixed the problem for me.

Best regards,
Stefan Kangas





  parent reply	other threads:[~2019-10-03 22:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-15  2:09 bug#34481: 27.0.50; cl-flet, cl-labels and lambda expressions Michael Heerdegen
2019-02-19  0:22 ` Michael Heerdegen
2019-02-19  1:03 ` Michael Heerdegen
2019-02-19  2:36   ` Michael Heerdegen
2019-10-03 22:28 ` Stefan Kangas [this message]
2019-10-17 10:36   ` Michael Heerdegen
2019-10-17 10:45     ` Stefan Kangas
2019-10-17 12:31       ` Michael Heerdegen
2019-10-17 18:20         ` Michael Heerdegen
2019-11-07 13:44         ` Stefan Kangas
2021-03-01 15:53         ` Lars Ingebrigtsen
2021-03-01 16:23           ` Stefan Monnier
2021-03-01 23:15             ` Michael Heerdegen
2021-03-01 23:18           ` Michael Heerdegen
2021-03-01 23:29             ` Lars Ingebrigtsen
2021-03-01 23:49               ` Michael Heerdegen
2021-03-02  1:11                 ` Michael Heerdegen
2021-03-02  6:53                   ` Lars Ingebrigtsen
2021-03-02  2:41                 ` Stefan Monnier

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=CADwFkmkpyXk4Pqprcbc4sFc0M3vKeF7SwvPmr+mnq-f3Fkq3ow@mail.gmail.com \
    --to=stefan@marxist.se \
    --cc=34481@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    /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).