GNU bug report logs - #50136
28.0.50; A problem with rx-let expansion

Previous Next

Package: emacs;

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

Date: Fri, 20 Aug 2021 14:01:01 UTC

Severity: normal

Found in version 28.0.50

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 50136 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: bug#50136: 28.0.50; A problem with rx-let expansion
Date: Mon, 23 Aug 2021 12:45:41 +0200
Mattias Engdegård <mattiase <at> acm.org> writes:

> Or just put all the actual code in a plain function:
>
> (eval-when-compile
>  (defun expand-my-rx-thing (x y &optional z &rest r) ...))
>
> (rx-define my-rx-thing (x y &rest more) (eval (expand-my-rx-thing x y
> more)))
>
> and use &optional and &rest arguments as you are used to, without any
> risks of substitution accidents like "string" in the example you
> showed earlier. The function would effectively work exactly like a
> macro of the sort you requested.

A good idea, I like it!

> > [... talking about docstring tweaks ...]
>
> I'll see what can be done. It's not really Emacs tradition to have
> examples in doc strings but maybe they can be improved a bit as you
> say.

I you find a way to get along without examples, all the better.  I
suggested to use an example because it might be the simplest way to
explain how things work, and because the way things work may come
unexpected for some (like me).  But providing some more details more
explicitly might be as good as well.


Regards,

Michael.




This bug report was last modified 3 years and 273 days ago.

Previous Next


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