From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#50136: 28.0.50; A problem with rx-let expansion Date: Sat, 21 Aug 2021 15:02:47 +0200 Message-ID: <3541B092-BD63-4610-BDA8-A43ABD4FAF6D@acm.org> References: <878s0wcj3j.fsf@web.de> <87y28whw1b.fsf@web.de> <878s0vc97a.fsf@web.de> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15109"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 50136@debbugs.gnu.org, monnier@iro.umontreal.ca To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 21 15:03:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mHQeT-0003jw-7e for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Aug 2021 15:03:09 +0200 Original-Received: from localhost ([::1]:60122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mHQeS-0007Pb-7k for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Aug 2021 09:03:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHQeM-0007PI-Df for bug-gnu-emacs@gnu.org; Sat, 21 Aug 2021 09:03:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52706) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mHQeM-0006ae-69 for bug-gnu-emacs@gnu.org; Sat, 21 Aug 2021 09:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mHQeM-00033R-2v for bug-gnu-emacs@gnu.org; Sat, 21 Aug 2021 09:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Aug 2021 13:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50136 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org, Stefan Monnier Original-Received: via spool by submit@debbugs.gnu.org id=B.162955098011733 (code B ref -1); Sat, 21 Aug 2021 13:03:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Aug 2021 13:03:00 +0000 Original-Received: from localhost ([127.0.0.1]:36019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHQeK-00033B-13 for submit@debbugs.gnu.org; Sat, 21 Aug 2021 09:03:00 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:35298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHQeI-000332-4l for submit@debbugs.gnu.org; Sat, 21 Aug 2021 09:02:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHQeH-0007PC-Um for bug-gnu-emacs@gnu.org; Sat, 21 Aug 2021 09:02:57 -0400 Original-Received: from mail1438c50.megamailservers.eu ([91.136.14.38]:41432 helo=mail263c50.megamailservers.eu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mHQeF-0006UU-JJ for bug-gnu-emacs@gnu.org; Sat, 21 Aug 2021 09:02:57 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1629550970; bh=V2iNDmoj0nbFcFoMyoAyS1bQNGUzYC1ErKOUMfHH+P8=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=RTsUMznVqzR76w74Vobve/RkJlZTSquWQu3UOH23JDRnjDzsjR8m/JouN8h6sLnVi +pOpYe2M9vaVUNMA5m6bsjJ/ICQ+FdMEY6/ldP+lhZaZ1lqIWoGaD9eTk96H/04+0x Mj/7K11yJQ2rPSduOM8H+RiV0gwIvVZtsg4/xI0U= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] (c188-150-171-71.bredband.tele2.se [188.150.171.71]) (authenticated bits=0) by mail263c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id 17LD2mQJ010875; Sat, 21 Aug 2021 13:02:49 +0000 In-Reply-To: <878s0vc97a.fsf@web.de> X-Mailer: Apple Mail (2.3445.104.21) X-CTCH-RefID: str=0001.0A742F17.6120F97A.0058, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=St3uF8G0 c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=S9lYUY0PayAX-g-VJosA:9 a=CjuIK1q_8ugA:10 X-Origin-Country: SE Received-SPF: softfail client-ip=91.136.14.38; envelope-from=mattiase@acm.org; helo=mail263c50.megamailservers.eu X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:212342 Archived-At: 21 aug. 2021 kl. 13.45 skrev Michael Heerdegen = : > (let ((args (list rest))) ...) >=20 > inside rx `eval' and use that as argument list variable. 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. > Maybe it would be good to improve the docstring to say the things that = I > missed clearer? - Say explicitly that this mechanism is different from > macros, instead it's just a simple substitution mechanism, and add a > simple example to the docstring as a reference, even if we already = have > examples in the manual. 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. > Maybe also tell that using `eval' you can still have a macro-like > behavior in the end. Not a bad idea!