From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72328: [PATCH] Nested backquote in pcase Date: Sat, 07 Sep 2024 10:18:26 +0300 Message-ID: <86o750ylrx.fsf@gnu.org> References: <87jzh62vtr.fsf@gmail.com> <877cd5k1ra.fsf@web.de> <871q3d347e.fsf@gmail.com> <877cd4rxqo.fsf@web.de> <867cd4ywnq.fsf@gnu.org> <87mslumpsw.fsf@gmail.com> <86msluuox9.fsf@gnu.org> <875xshn3km.fsf@gmail.com> <87cymo6wp9.fsf@web.de> <87v80gkmg7.fsf@gmail.com> <86ikwfqj9w.fsf@gnu.org> <87a5hqzrxg.fsf@gmail.com> <86o765q4yo.fsf@gnu.org> <871q31ztju.fsf@gmail.com> <87bk2580rv.fsf@web.de> <87msloxmmv.fsf@gmail.com> <86jzgrmua0.fsf@gnu.org> <87v7zrncmw.fsf@web.de> <86plpzp6oc.fsf@gnu.org> <86ed6fox6h.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35857"; mail-complaints-to="usenet@ciao.gmane.io" Cc: michael_heerdegen@web.de, monnier@iro.umontreal.ca, thuna.cing@gmail.com, 72328@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 07 09:19:26 2024 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 1smpjA-0009Ag-Ty for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Sep 2024 09:19:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smpiq-0007bj-0i; Sat, 07 Sep 2024 03:19:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smpio-0007bJ-Oo for bug-gnu-emacs@gnu.org; Sat, 07 Sep 2024 03:19:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1smpio-0005AC-Fs for bug-gnu-emacs@gnu.org; Sat, 07 Sep 2024 03:19:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=+1saVO23Ra371aXVjl0dFdR/2v+G80sV7iOXuFbM0nY=; b=gkXsMv597bLuSfm7IEjBxRBkiYiHwS/XuEILwY4noRAPwTz4L+wuz+NF2G1eBw/z8k3ULwYr5EN909FA7blz5gxLkHh+zbrrNMNp3Zjj6cr80ee4WeLlTB4/xEuydC55G+WFJRoomcwhFtbxwy+1bEzOQ8b05Kt7K9o6izSUW9GFPZU7/KbR87MWHear4kg+Ds8GrO0LQRufbkZ4Bfn/8frDGeIATCT8Zt+r/lOuDVcc/ZTw11kF69UiAUJupqSjMPcNEHmebBQwLLVocuVqZadiv6M9Cyy59SpxlCGjg1HFiudH7SRbdnte0eRyGZDV57wmRHPyq371DIexAhKm7w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1smpio-0000MO-Tg for bug-gnu-emacs@gnu.org; Sat, 07 Sep 2024 03:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Sep 2024 07:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72328 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 72328-submit@debbugs.gnu.org id=B72328.17256935321348 (code B ref 72328); Sat, 07 Sep 2024 07:19:02 +0000 Original-Received: (at 72328) by debbugs.gnu.org; 7 Sep 2024 07:18:52 +0000 Original-Received: from localhost ([127.0.0.1]:54646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smpid-0000Lf-Rf for submit@debbugs.gnu.org; Sat, 07 Sep 2024 03:18:52 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smpib-0000LH-VJ for 72328@debbugs.gnu.org; Sat, 07 Sep 2024 03:18:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smpiV-00058C-Vj; Sat, 07 Sep 2024 03:18:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=+1saVO23Ra371aXVjl0dFdR/2v+G80sV7iOXuFbM0nY=; b=UGJL3iPfdmcB YT7SRA1fQVLBH3BVaOFRMFSKkErxhqMxWmWh62RKQyCU1nP0CJb5Nk8Ytlc7kZuUC50TtwVHlj4CT SqCEHC6ambJuM+DAxa9SoopVdzYfoMaNnIH6AlTuD6sml7c4UHJ0m40oDi98vkklFXT2aJTb4BGMU Jv0cTYJNzUcctYJ4+LQqUxt5A7s8Qp4SdrDH+CD5PHzxFmX12rAXDZ8j0f6fksks/Es9838t9l9oI 7qVk1MLbZTJ4nXgxKdfr0Na6k12uKPWvKFAuPcvUsHwBUjAoGNgRXJv8eMTGvXE9cZK5iIKMoSlAB btxJuQaHTKIzgFTo22KUDQ==; In-Reply-To: <86ed6fox6h.fsf@gnu.org> (message from Eli Zaretskii on Fri, 23 Aug 2024 22:29:10 +0300) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:291350 Archived-At: Ping! Stefan, should I install this in your name? > Cc: michael_heerdegen@web.de, thuna.cing@gmail.com, 72328@debbugs.gnu.org > Date: Fri, 23 Aug 2024 22:29:10 +0300 > From: Eli Zaretskii > > > From: Stefan Monnier > > Cc: michael_heerdegen@web.de, thuna.cing@gmail.com, 72328@debbugs.gnu.org > > Date: Fri, 23 Aug 2024 15:11:04 -0400 > > > > >> > Would be good to hear from Stefan > > >> The first step is to declare nested backquotes unsupported and add > > >> a warning when we encounter them. > > > Where and how would you suggest to do that? > > > > Somethink like... > > > > > > Stefan > > > > > > diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el > > index fd6b0c8db5c..fe62820f0cb 100644 > > --- a/lisp/emacs-lisp/pcase.el > > +++ b/lisp/emacs-lisp/pcase.el > > @@ -1172,7 +1172,10 @@ pcase--expand-\` > > (upatd (pcase--expand-\` (cdr qpat)))) > > (if (and (eq (car-safe upata) 'quote) (eq (car-safe upatd) 'quote)) > > `'(,(cadr upata) . ,(cadr upatd)) > > - `(and (pred consp) > > + `(and ,@(when (eq (car qpat) '\`) > > + `((guard ,(macroexp-warn-and-return > > + "Nested ` are not supported" t nil nil qpat)))) > > + (pred consp) > > (app car-safe ,upata) > > (app cdr-safe ,upatd))))) > > ((or (stringp qpat) (numberp qpat) (symbolp qpat)) `',qpat) > > Feel free to install on master, and thanks. > > > >