From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id SJfgJlUsTmMVsQAAbAwnHQ (envelope-from ) for ; Tue, 18 Oct 2022 06:32:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id OF/OJlUsTmOoAAEAauVa8A (envelope-from ) for ; Tue, 18 Oct 2022 06:32:21 +0200 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 39E7720343 for ; Tue, 18 Oct 2022 06:32:21 +0200 (CEST) Received: from localhost ([::1]:36738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okeH5-0007ZV-Tm for larch@yhetil.org; Tue, 18 Oct 2022 00:32:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okeFx-0007Z5-0Y for emacs-orgmode@gnu.org; Tue, 18 Oct 2022 00:31:09 -0400 Received: from mout01.posteo.de ([185.67.36.65]:47649) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okeFp-0000mr-31 for emacs-orgmode@gnu.org; Tue, 18 Oct 2022 00:31:08 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id C169A240027 for ; Tue, 18 Oct 2022 06:30:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1666067457; bh=1IA7A+trqujI35o+RLNll1h7QrTpUo1G5pvVcSL041E=; h=From:To:Cc:Subject:Date:From; b=KLY1ThOrAptgwKxrS+LYRU36o6VaSn9mJ63SNg/PfhdVBl3tPWFspY55Mdsp2/5eE 2YOBJTfURUaypgsYmZYzmAdzGFbgiGYixHE9jpfS5x9WzISmGIE1BF1QGK5wqbiYAC yQfQ8NYr1ki2pkXAg9atclAZt+nXtIIVs3Ll71g99TeTtRpWssiqe6V5smRKL5HxY2 aLHI8yh1XMpU9hckFzxeY/J2IOt/xUhu40fXUSAehEM2Dn00W4eePnGi5jvl1tSSEC QoKV0cwmTZOnnZ6bsbEhMOTJK/ZHRegCsi6mHizYn2EmWHmvQMt0XUWe6L/Hu+TqtZ r/gpIY4NPxSgA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Ms1Bj45zRz9rxP; Tue, 18 Oct 2022 06:30:53 +0200 (CEST) From: Ihor Radchenko To: =?utf-8?Q?M=2E_=E2=80=98quintus=E2=80=99_G=C3=BClker?= Cc: Nicolas Goaziou , emacs-orgmode@gnu.org Subject: [RFC PATCH] Re: [bug] Macro in citation not expanded In-Reply-To: <87tu425pla.fsf@guelker.eu> References: <8735bot9dp.fsf@guelker.eu> <87lepg6rmh.fsf@localhost> <87tu425pla.fsf@guelker.eu> Date: Tue, 18 Oct 2022 04:31:40 +0000 Message-ID: <87k04xhhw3.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666067541; 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=YDO6wR8jYyAD4IUPkxyq3O81gzW3/Flyy3AI/8voMXQ=; b=oc8bXzwTO0PdskFpiNSvn4ODR7SYLYYc1K9eZHjI/+DAuELeYO6wzG+5P4PMOdYP9GQICX 57saENFb/Ho9LyUIfvC7WN1ACqDDpbqK2uSZ4D8F+NKJ6Ks5MHrTEGL3A6tJPVjTw/sb9p eASEMg073n58K8LRXYJTH2VrW2k4iuDwlrVFHk4RBpu5MVFofeZmhTzsFtkqRFCJyyQ0Kh GXTrSGOmKIqZZ1d5BcsRoeEUMkBKb0CSWPgXUPgfkfPRk8CCSYBgsOQ9ssgvGU9TKQFKGv grjQcUaVfzBjm19kBk2eUeYj/W2klBVj5ISol04Nuf2jpj9Vdn/CqdPr2kBRhw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666067541; a=rsa-sha256; cv=none; b=TtOisbO65PUYPR1his673yr/u8Q/7UnktvPme0qYfryipEbkCsJY1sAtSqOl4WfcLvE+EM 7Dq43dmjixXIjvucZP81v9NfwGZfOFRs4P/CUrgUmy5UsQHlk/7cqtoOoHxvUeZpRjJgr1 Zy2OHiLAKaJgmD+f7udO3GHO0hg6tQufM9V6uss+AK/cgbNJ+K4/75yX3gDFRJNmpd8X07 USv1piv0bzF7xJk26G1faQUnsxPxJ4Inrc6JwytvtyAgx5oAoogtKZT8qObc53rxPR5+UL VEJmz9/YKE7RJY/oL2Jhk2FqvdudkYYbICLH4GMdGhNNeS/lyeI7Dv3tkEk0wQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=KLY1ThOr; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.62 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=KLY1ThOr; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 39E7720343 X-Spam-Score: -3.62 X-Migadu-Scanner: scn1.migadu.com X-TUID: KRy0Z1BrY8a2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable M. =E2=80=98quintus=E2=80=99 G=C3=BClker writes: >> It sounds reasonable to allow macros inside citation references. >> Maybe we also want to allow other things. Maybe simply allow all objects >> but other citations, line-breaks, and table-cells? > > I have no strong opinion on this. I certainly do not need tables inside > citations. If it is easy to just permit everything except what you > named, I would say just allow it. Maybe someone has use for it. Maybe > footnotes inside [cite:] construct should also not be allowed, at least > for footnote-based styles. See the attached WIP patch. Note that I also removed link as our tests explicitly test against having links inside citation references. However, I can see how links can be useful in prefix/suffix... I am wondering what was the rationale behind disallowing so many objects inside citation references. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-org-element-Allow-more-objects-inside-citations.patch Content-Transfer-Encoding: quoted-printable >From aa3fac7248aa1201bbf92d492dcd5c79f8d0a544 Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Tue, 18 Oct 2022 12:22:56 +0800 Subject: [PATCH] org-element: Allow more objects inside citations MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * lisp/org-element.el (org-element-object-restrictions): Allow all but citation, citation-reference, line-break, table-cell, link and footnote-reference objects inside citations. Reported-by: M. =E2=80=98quintus=E2=80=99 G=C3=BClker Link: https://orgmode.org/list/87tu425pla.fsf@guelker.eu --- lisp/org-element.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index 7b26e877e..7aac00087 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -401,10 +401,14 @@ (defconst org-element-object-restrictions subscript superscript underline verbatim)) (standard-set (remq 'citation-reference (remq 'table-cell org-element-all-objects))) - (standard-set-no-line-break (remq 'line-break standard-set))) + (standard-set-no-line-break (remq 'line-break standard-set)) + (standard-set-for-citations (seq-difference + standard-set-no-line-break + '( citation citation-reference + footnote-reference link)))) `((bold ,@standard-set) (citation citation-reference) - (citation-reference ,@minimal-set) + (citation-reference ,@standard-set-for-citations) (footnote-reference ,@standard-set) (headline ,@standard-set-no-line-break) (inlinetask ,@standard-set-no-line-break) --=20 2.35.1 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--