From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wKCpHXIVj2BxEQAAgWs5BA (envelope-from ) for ; Sun, 02 May 2021 23:11:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 0C00GXIVj2A3aAAAbx9fmQ (envelope-from ) for ; Sun, 02 May 2021 21:11:14 +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 B872B15E49 for ; Sun, 2 May 2021 23:11:13 +0200 (CEST) Received: from localhost ([::1]:33924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldJMu-0005Pz-Uo for larch@yhetil.org; Sun, 02 May 2021 17:11:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldJMF-0005Ps-QO for emacs-orgmode@gnu.org; Sun, 02 May 2021 17:10:32 -0400 Received: from mailer-211-152.hitrost.net ([91.185.211.152]:17725) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldJMD-0005wZ-DV for emacs-orgmode@gnu.org; Sun, 02 May 2021 17:10:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=christianmoe.com; s=x; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:In-reply-to:Subject:Cc:To:From:References:Sender :Reply-To: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=7DW66Vo3XdDqOYlaw9szddhAA4HUoP+8DofefiQsTo8=; b=Lpw372ONR5h46cNIX/ds8MEyHq JexBybfrtPfs0JVCKDxi93ZITo+DXWQP2XQcas/rXyhZbaVzv1tXz7SAT2Gp6uotP9IKV22kzwTcg hYZYk35t0W/7UKXvX5hq5zUFLTlCvxyskwmsBizYHe4Svs45mlz9KrV4Ouxuy6JW2kK2q+R+3ZtW1 gAP4tjmoKFfOBXLSP+uf2QXo281DhOwafirdK7xR3KsDbzDNEKRRV8bcg3+tZw5IA/PC3GsFz3XH8 1/MnnV8hySnA4LHOumd5EX0Emzr9fEg/9+h+H9d7bc6lrvYE/h6a9a/UQbIHjXfUJmxOVUkJB+iiC gAW+rvnA==; 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 1ldJM6-00Fw9n-8h; Sun, 02 May 2021 23:10:22 +0200 References: <87wnsjx5rs.fsf@posteo.net> <87o8duyhxr.fsf@bzg.fr> <87sg36u5wa.fsf@nicolasgoaziou.fr> <87k0oinmy2.fsf@posteo.net> User-agent: mu4e 0.9.19; emacs 25.3.2 From: Christian Moe To: Juan Manuel =?utf-8?Q?Mac=C3=ADas?= Subject: Re: [PATCH] Possibility of using alternative separators in macros In-reply-to: <87k0oinmy2.fsf@posteo.net> Date: Sun, 02 May 2021 23:08:28 +0200 Message-ID: <87h7jkdesz.fsf@christianmoe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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.152; envelope-from=mail@christianmoe.com; helo=mailer-211-152.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: Bastien , orgmode , Nicolas Goaziou 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=1619989873; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=7DW66Vo3XdDqOYlaw9szddhAA4HUoP+8DofefiQsTo8=; b=CfSkDyOKG4hLBiJmVNNtwPCmF3DZ4HkeKMUb/U096KGbkX1D3stWx8K4v5TTbDQYu29Bwr 9gfhuiOunWjYoSJarxRv2cIPiAsHurglPYQ2JRdkTnrbkgd75ugrMYmoRhdnYW5X4IbHJN S0jJLjGmaZEEkZvA8W77SwBM/7x2thKJ7f1D+FqClO/s3fVf76whItlOCo4afAsMCK4C6H 2BjSgOBALzZGp0Nt1R929NMcSUxZDnk366OOYVK16ZVpq7R31CS2DUk3rkNggJKVJU22Xs Vo1uFfTzm8cxNUbChxVoRqsQQNYdYgNJS3x8RFNnvo4ytUi8WnOZCg1vc3wHww== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619989873; a=rsa-sha256; cv=none; b=uJnjP+ZanWXmc12p2IQdsxES1pPC9MsTBlUs0qFJJlVfIp7b247VWcafx1/a30ztWGH03Y 6eGQJvEzwdKyRqmR2eb22gt4DmgR0LrWEiiotnK4serFNPfWtMkMGo2Ryyp0C8KBShOJYA lcuaa3rV58svqALnlLcooNi4IXmBmnRHJhFMS/Vj7RuJE7iA2ltn8Z3gclXvT+pPGWAjhe qpFhw0/TQZFC+lTM1zMNwDoffYG8cYYGqGJIhkztzko1m4R9xOJY+asRSQJSN++NRQBVWb twXR8YKBaEKxGeRpDAiS9AFToLrNdVmDucj+Bb9bbB83T+vmGBvsQ5xBK2cpOg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=Lpw372ON; 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.46 Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=christianmoe.com header.s=x header.b=Lpw372ON; 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: B872B15E49 X-Spam-Score: -2.46 X-Migadu-Scanner: scn0.migadu.com X-TUID: 5lPh05rI63L9 I frequently need to escape commas in macros, which is a bit of a pain and easy to forget. My most frequent use case is a macro that expands in ODT export to a margin comment (like #+begin_annotation does, but without causing a line break). It takes one argument which typically consists of several lines of text with commas in them. If I forget to escape a comma, the rest of the comment is silently lost to the reader. So a backwards-compatible remedy would be nice. Juan's/Nicholas's solution is smart, but I'm not sure if it's exactly what I've been waiting for. It saves escaping every comma, but I'd still have to remember to add the separator character every time I *invoke* a macro, and remembering is the tricky part. I don't know if you've already considered the option of instead specifying a different separator in the macro *definition*, say something like #+macro: comment @@html:@@ :sep "&" Another point: Something that would help, without adding new syntax, is making macro expansion smart enough to *ignore* separators when the macro definition contains only *one* argument anyway, as in the cases above. That behavior would also be safely backwards-compatible, I think. It would not help with macros with more than one arg, like Juan's example, but it would solve most of my problems, for example. Yours, Christian Juan Manuel Macías writes: > Hi all, > > Thanks for your comments, Bastien and Nicolas. > > I think macros can work out of the box as a perfect 'backend' for those > LaTeX commands that include at least one argument with textual content. > In my case they are very useful to 'extend' the markup language. Apart > from the LaTeX example that I put previously > (\foreignlanguage{lang}{short-text}), there are commands like > \textsc{text in small caps}, \textcolor{color}{text}, and so on. When > one of the arguments consists of textual content, even if it is a short > text, it can be tedious to escape constantly commas[1]. Anyway, I > understand that my use case may not be that of the rest of the users, > and what is a 'problem' for me, it may not be seen as a problem by other > users; therefore, I fully understand Bastien's warnings about making a > modification to something that already works fine, and has been working > fine since always. > > Nicolas's suggestion seemed the most reasonable, or the least > destructive, in the hypothetical scenario that there would be a great > demand among users of an alternative separator. Now I see unlikely, > however, that such a demand exists ;-) So, if my use case is a minority, > of course I agree with give up this proposal... > > [1] To mitigate 'comma issue' I wrote a function that escapes commas > when saving document :-D > > Best regards, > > Juan Manuel > > Nicolas Goaziou writes: > >> Hello, >> >> Bastien writes: >> >>> thank you for the patch. I understand the general idea, but I think >>> we should be careful not to overload the macro syntax - escaping the >>> coma seems okay to me. I'm closing this suggestion. >>> >>> I'm cc'ing Nicolas: if he thinks it's a useful addition, I won't of >>> course insist on rejecting it. >> >> This is a followup to a previous discussion in this mailing list, in >> which Juan Manuel explained his use-case for a different argument >> separator in macros. I noticed then that there was an opening for >> a backward compatible syntax extension for it. As I was also not certain >> it would be a good idea overall, I suggested him to start a new, more >> visible, thread with the proposal, and collect feedback. >> >> So, maybe it is a bit early to close it. >> >> BTW, I would like to amend the proposed syntax, so as to limit friction >> with the rest of Org. What would be more reasonable is the following: >> >> {{{macroname·(...)}}} >> >> where · is either nothing or a _single_ printable non-alphanumeric >> non-space non-parenthesis character that isn't already meaningful in >> Org. For example, if for some reason, we limit ourselves to ASCII >> characters only, the set of allowed separators would be: >> >> ! % & , ; ? ` >> >> So, again, I'm not saying we should do this. TBH, I'm not convinced by >> the idea of duplicate syntax (comma-escaping and alternate characters) >> for the same thing. But hard-core macro users may have a word to say >> about it. >> >> WDYT? >> >> Regards,