GNU bug report logs - #34481
27.0.50; cl-flet, cl-labels and lambda expressions

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Fri, 15 Feb 2019 02:10:01 UTC

Severity: normal

Found in version 27.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 34481 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 34481 <at> debbugs.gnu.org
Subject: Re: bug#34481: 27.0.50; cl-flet, cl-labels and lambda expressions
Date: Fri, 4 Oct 2019 00:28:26 +0200
Michael Heerdegen <michael_heerdegen <at> 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 <at> 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




This bug report was last modified 4 years and 165 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.