From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wGQ3CPzEomDvOwEAgWs5BA (envelope-from ) for ; Mon, 17 May 2021 21:33:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id OA0HBPzEomBgJwAA1q6Kng (envelope-from ) for ; Mon, 17 May 2021 19:33:16 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B1F1425DD4 for ; Mon, 17 May 2021 21:33:11 +0200 (CEST) Received: from localhost ([::1]:54202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liizG-0000Pz-KG for larch@yhetil.org; Mon, 17 May 2021 15:33:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liiNH-00061f-Im for emacs-orgmode@gnu.org; Mon, 17 May 2021 14:53:57 -0400 Received: from mailer-211-161.hitrost.net ([91.185.211.161]:6013) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liiND-0002HJ-OS for emacs-orgmode@gnu.org; Mon, 17 May 2021 14:53:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=christianmoe.com; s=x; h=Content-Type:MIME-Version:Message-ID:Date: In-reply-to:Subject:Cc:To:From:References:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hAYRqo3T1zDmJtIbIHbGlR2imDHaoN7n1zKDESFSy7k=; b=VgY7XzK17apjaagvc0Gjvs6JA cBJu/vUgkyewsobAS6219SyvFZFjyLURXsAFiB6sEMezBeYFpATxWQWR+xiY7V7tRkt8HWWn5KRfl mnTTyJV0PdW1G+pac0XrrAlOwKjjmzoBt9bRY6KE/zrgGvFB+T4wOm23M6dady4P2DeBzpdn7T7t8 JGlCbdf81QTYz9S5D4aoWIlngcRjANVbZMiuJ9FKDo5HeGFX731Vht/th8o++mBPWwSXfgUT+qLFn Jppvhk9riMJD0q0YoyO1Ynqf9S9YUPt2ffZcYvVkUEL77GYhims+kVZkGNeoW4PsNAsA8DCbjsBYu cVzay7UOQ==; Received: from lk.84.20.234.47.dc.cable.static.lj-kabel.net ([84.20.234.47] helo=Tauriel) by b1.hitrost.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1liiN6-002L8k-S6; Mon, 17 May 2021 20:53:44 +0200 References: <87wnsjx5rs.fsf@posteo.net> <87o8duyhxr.fsf@bzg.fr> <87sg36u5wa.fsf@nicolasgoaziou.fr> <87k0oinmy2.fsf@posteo.net> <87h7jkdesz.fsf@christianmoe.com> <87o8dascw4.fsf@christianmoe.com> User-agent: mu4e 0.9.19; emacs 25.3.2 From: Christian Moe To: Maxim Nikulin Subject: Re: [PATCH] Possibility of using alternative separators in macros In-reply-to: Date: Mon, 17 May 2021 20:51:43 +0200 Message-ID: <87k0nxry68.fsf@christianmoe.com> MIME-Version: 1.0 Content-Type: text/plain X-GeoIP: Country [IP], SI [84.20.234.47] X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-Authenticated-Id: mail@christianmoe.com Received-SPF: pass client-ip=91.185.211.161; envelope-from=mail@christianmoe.com; helo=mailer-211-161.hitrost.net X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621279991; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=hAYRqo3T1zDmJtIbIHbGlR2imDHaoN7n1zKDESFSy7k=; b=OAV4sdEZjpX0eSrTESv9q0sGmF+hNvZYbKRToZfKoFdVcaSfgskqwnHlPMIATovZ4yuot5 qHjIwFGs+IwUx5e5lQSdKZsGzF983xmMRICtfnsy27CThZD9d8/sG1tj4AVnNHZJ9FKGnL z6irS6vatTbdUlDBfLVq0T+qfvmPWj8scbubdWU7uLym9yU45vHz/XNcED8YVWgNopKLOi D4iC30i4V080zYS3ebzFAZZSynHqETy5LjGlzGa/7bQRNqBsxDsC0VWRGtnBtzU1GiVI8C dMgQj9bmThJhsEbPSOUwdZzCEN5yWBZbqv1UF62MV0GYmrsMsEIsNvd9j1aG0w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1621279991; a=rsa-sha256; cv=none; b=aI2rlBQDphyxT9skKbe0ebABCv2a7d4yiOi0SQLV81njk/bdQmpmeKQ39+bBTdR9bU0QWn RNsr0dBxr8x2N/m4JKf+SV9ygdlKZV+o5U7Ub3FVQTvo1c8sI0gD/bbP0BM2dsV+rGcfoa Yo9LnLCuEPdAAGJzcNpdX8BodZHJeTzXndfRuxE1VpxGKRCYE0oeewNSsSySEQBvfGefrJ abV6KOqhfzmHAAl0qkuUw2wf4GeqnsRkqbQPYeLIiurq4LfU8+xEpwOkJJjkTbxEpvg+/O OvpvwdVJ9BmIhucAuLAA/Bs6ZQ9VlJAKcBiOCaJctNZqEArcP6nroG/0o1/nNA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=VgY7XzK1; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.44 Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=VgY7XzK1; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: B1F1425DD4 X-Spam-Score: -2.44 X-Migadu-Scanner: scn0.migadu.com X-TUID: vgdZ4ffrv6KI Maxim Nikulin writes: > On 17/05/2021 02:21, Christian Moe wrote: >> Maxim Nikulin writes: >>> On 03/05/2021 04:08, Christian Moe wrote: >> [snip] >>> #+MACRO: allargshack (eval (format "- /%s/ :: %s" $1 (mapconcat >>> #'identity _ ","))) >>> >>> {{{allargshack(one, two, three)}}} >>> >>> I do not know if Eric can swap order of arguments of his credits >>> macro. Extracting namely last argument requires a bit more lisp code. >> >> Yes, I didn't think that far. This would provide a comprehensive >> backwards-compatible solution to the comma-escaping problem, though >> perhaps not the most newbie-friendly one. It would also make macros more >> flexible and powerful in the bargain (I'm sure people will think of >> other uses for this than commas). > > I agree that it would abuse arguments syntax, but I expect that namely > newbies would not bother since it would "just work": > > #+MACRO definition - $1 ::$_ > > {{{definition(one, two, three}}} > > It is more experienced users who may be confused why it works. That's not what I was trying to say. I don't think your suggestion abuses the argument syntax - it would extend it, in a way that is likely to prove helpful for multiple purposes. When I said it was probably not the most newbie-friendly solution for the comma-escaping problem, I thought that it required including a bit of lisp in their macros to add the commas back in (the mapconcat expression in your "allargshack" example above). But if the "definition" macro above "just works", I suppose that in your solution, the list of arguments $_ would by default expand to the same string as the mapconcat expression would, i.e. the commas would be added back in. That makes sense. The mapconcat expression would not even be needed, then, unless one wants the macro to do anything else than preserve commas. Or am I misunderstanding something? Yours, Christian