From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Ihor Radchenko <yantar92@posteo.net>
Newsgroups: gmane.emacs.bugs
Subject: bug#61281: Double backquote expansion and ",
 " (was: bug#61281: =?UTF-8?Q?=E2=80=9C`?=(a \,
 b)=?UTF-8?Q?=E2=80=9D?= equals to =?UTF-8?Q?=E2=80=9C`?=(a . ,
 b)=?UTF-8?Q?=E2=80=9D?=)
Date: Tue, 07 Feb 2023 11:50:47 +0000
Message-ID: <87pmal8zjc.fsf@localhost>
References: <SA0PR04MB7433BC96453731D173F8B8A5D7D49@SA0PR04MB7433.namprd04.prod.outlook.com>
 <SJ0PR10MB54882316327D577FD7D51D67F3D49@SJ0PR10MB5488.namprd10.prod.outlook.com>
 <87a61tgdkx.fsf@web.de>
 <SJ0PR10MB5488DA0892190846E3921B8FF3D59@SJ0PR10MB5488.namprd10.prod.outlook.com>
 <875ycghgv1.fsf@web.de> <871qn4hfte.fsf@web.de>
 <SJ0PR10MB5488652C2957D7B8121EE7E7F3D59@SJ0PR10MB5488.namprd10.prod.outlook.com>
 <87fsbju0of.fsf@web.de>
 <SJ0PR10MB54884414F3446BD5486B5FE9F3DA9@SJ0PR10MB5488.namprd10.prod.outlook.com>
 <875ycfoyph.fsf@localhost> <87o7q68d84.fsf@web.de>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="33868"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: Adam Porter <adam@alphapapa.net>, Xie Shynur <one.last.kiss@outlook.com>,
 "61281@debbugs.gnu.org" <61281@debbugs.gnu.org>,
 Drew Adams <drew.adams@oracle.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 07 12:51:28 2023
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
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 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1pPMVT-0008Y3-IA
	for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Feb 2023 12:51:27 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1pPMV7-0005BG-3Y; Tue, 07 Feb 2023 06:51:05 -0500
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 <Debian-debbugs@debbugs.gnu.org>)
 id 1pPMV5-00059z-A3
 for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2023 06:51:03 -0500
Original-Received: from debbugs.gnu.org ([209.51.188.43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1pPMV4-0007PO-Ni
 for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2023 06:51:02 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1pPMV4-0002wl-8e
 for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2023 06:51:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Ihor Radchenko <yantar92@posteo.net>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Tue, 07 Feb 2023 11:51:02 +0000
Resent-Message-ID: <handler.61281.B61281.167577062111275@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 61281
X-GNU-PR-Package: emacs
Original-Received: via spool by 61281-submit@debbugs.gnu.org id=B61281.167577062111275
 (code B ref 61281); Tue, 07 Feb 2023 11:51:02 +0000
Original-Received: (at 61281) by debbugs.gnu.org; 7 Feb 2023 11:50:21 +0000
Original-Received: from localhost ([127.0.0.1]:51354 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1pPMUO-0002vm-Vv
 for submit@debbugs.gnu.org; Tue, 07 Feb 2023 06:50:21 -0500
Original-Received: from mout01.posteo.de ([185.67.36.65]:60941)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@posteo.net>) id 1pPMUM-0002vT-UH
 for 61281@debbugs.gnu.org; Tue, 07 Feb 2023 06:50:19 -0500
Original-Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id D0C8A240487
 for <61281@debbugs.gnu.org>; Tue,  7 Feb 2023 12:50:12 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1675770612; bh=76lBSl7PUCd4Dv3e55+fKupjR2oYWQM4N42AyFdQ/9c=;
 h=From:To:Cc:Subject:Date:From;
 b=nAACc4p40ed9pdKQ6+PUunjPE0ZU1SJI/qKHn6FsonaTDDfEDdral28nhC3rFMgkP
 7yHvX56TbQi7H0DlPFfE6hcQuCA4g7UhAH5rAzjdGRhzKyw8JlTvS8bpU8RlheuZoY
 fkjtUTdtD4W/unTU5YYlODn1SzVcK0cody/zJzfCBa1OX9lmeb2hSh1iEc7BT4pIUK
 kwItR174Ifb1pGd9nD1avIT+84LtXrHHftUfwc7Kqiee+zkzBosvELE2TN1MALVVZ7
 XEK8QDT6uGBSGmaeT5pqeBN772g3WAMTeQxQukEtGLdHzne+n/k6YrCPC/du6/Dhym
 0X6/HyM5tekUw==
Original-Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4PB1dt0CJ6z6ts8;
 Tue,  7 Feb 2023 12:50:08 +0100 (CET)
In-Reply-To: <87o7q68d84.fsf@web.de>
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" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=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:255033
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/255033>

Michael Heerdegen <michael_heerdegen@web.de> writes:

> But this has not directly a relation to what we discuss here.  If you
> rewrite ,X as (\, X) you have additional ways to express the above
> things, looking like (,'\, X) etc (though these are less readable).

I may indeed be misunderstanding the case I raised vs. the discussed bug.
Let's branch this off.

> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> I recall one user had a need to macro-expand something that indented to
>> be passed to another macro-expand. We did not find a way to retain ","
>> in the macro-expanded sexp.
>
> I guess you are describing the common difficulties related to multiple
> levels of backquotes (nested backquotes).  These are tricky (for human
> brains) and you need to know little "tricks" to get what you want (took
> me a while to discover how to deal with nested backquotes, maybe we
> should have examples in the manual?).

I would appreciate having such examples in the manual.
Also, CCing Adam, who originally raised the question.

> Anyway, you (only) need to use trivial quoting, it is not necessary and
> probably not good style to use the symbol "," instead of the reader
> construct in human written code.

Could you elaborate?

> Compare:
>
> #+begin_src emacs-lisp
> ;; Substitution at the same place at multiple levels:
> (let ((f 'my-function))
>   ``(when (funcall ,,f) (do-something)))
> ==>
>  `(when (funcall ,my-function)
>     (do-something))
>
> ;; Substitution once, by outside level backquote:
> (let ((f 'my-function))
>   ``(when (funcall ,',f) (do-something)))
> ==>
>  `(when (funcall ,'my-function)
>     (do-something))
>
> ;; Substitution once, by the inside backquote
> ``(when (funcall ,,'f) (do-something))
> ==>
>   `(when (funcall ,f)
>      (do-something))
>
>   or simpler:
>
> ``(when (funcall ,f) (do-something))
> ==>
>   `(when (funcall ,f)
>      (do-something))
> #+end_src
>
> You probably tried to get some of these cases work, and it's not trivial
> to get to a solution the first time one encounters this problem.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>