From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1 with LMTPS id AJKUBgkqil5cVgAAk0OIDg (envelope-from ) for ; Sun, 05 Apr 2020 18:57:13 +0000 Received: from aspmx2.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id ABc/Igcqil5YZQAAB5/wlQ (envelope-from ) for ; Sun, 05 Apr 2020 18:57:11 +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 aspmx2.migadu.com (Postfix) with ESMTPS id 5BF916839B3 for ; Sun, 5 Apr 2020 17:06:45 +0000 (UTC) Received: from localhost ([::1]:50208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jL8jL-00056M-Ts for larch@yhetil.org; Sun, 05 Apr 2020 13:06:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49266) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jL8j1-00056D-Gt for emacs-orgmode@gnu.org; Sun, 05 Apr 2020 13:06:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jL8j0-0007jt-3F for emacs-orgmode@gnu.org; Sun, 05 Apr 2020 13:06:23 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:59269) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jL8iz-0007hj-UM for emacs-orgmode@gnu.org; Sun, 05 Apr 2020 13:06:22 -0400 Received: from localhost (40-67.ipv4.commingeshautdebit.fr [185.131.40.67]) (Authenticated sender: admin@nicolasgoaziou.fr) by relay10.mail.gandi.net (Postfix) with ESMTPSA id EC7FC240005; Sun, 5 Apr 2020 17:06:18 +0000 (UTC) From: Nicolas Goaziou To: Johan =?utf-8?Q?Tol=C3=B6?= Subject: Re: Why is `org-element-affiliated-keywords' a var when `org-element--affiliated-re' is a const? References: <87imigzzdy.fsf@toloe.se> Mail-Followup-To: Johan =?utf-8?Q?Tol=C3=B6?= , emacs-orgmode@gnu.org Date: Sun, 05 Apr 2020 19:06:17 +0200 In-Reply-To: <87imigzzdy.fsf@toloe.se> ("Johan =?utf-8?Q?Tol=C3=B6=22's?= message of "Fri, 03 Apr 2020 11:34:17 +0200") Message-ID: <87ftdhc16e.fsf@nicolasgoaziou.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.70.178.230 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=default; t=1586106405; 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; bh=FsXtrndupbN1F3yEph3o9r59qjU/A1NnOpYAbuvGYIE=; b=JsRrOaq/b3OzgEEeQIo+KBFo7mljI2CalCzc+SpR+TnIqFl0wzUvvThG+p6Ecyy3brWmSj I9cpu43G84APY8NUMx7y/ra/P0N2ll8J9PesmG2maheKwHZIOY2Q3aKzVTN2yfZUCvM4Tn bljc467m2ATlIIgvm48JBd1QhOPDU7k= ARC-Seal: i=1; s=default; d=yhetil.org; t=1586106405; a=rsa-sha256; cv=none; b=CZeL1KrbJ22AV5IZYBvgTiOwtoXEoqU2LeKvVXFeqj35+HIqHB8VDACL5wbocsXSdLmqmS wFz4ojJmVtPLN+DJ8quwzziBhdB+7CRguoVsQHhevEeoD/Zn726jcCk3ze9Whg6AYTfIBV b/nDHjib4RF1v1zBsipaOE9DNHGoc7A= ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=none; spf=pass (aspmx2.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-Scanner: scn0 X-Spam-Score: -0.01 Authentication-Results: aspmx2.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx2.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-Scan-Result: default: False [-0.01 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.58546170046487]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.33), country: US(-0.01), ip: 209.51.188.17(-0.59)]; ARC_SIGNED(0.00)[i=1]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; RCPT_COUNT_TWO(0.00)[2]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; FROM_NEQ_ENVFROM(0.00)[mail@nicolasgoaziou.fr,emacs-orgmode-bounces@gnu.org]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[nicolasgoaziou.fr]; HAS_LIST_UNSUB(-0.01)[]; SUBJECT_ENDS_QUESTION(1.00)[]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: l4EL9krWkwDh Hello, Johan Tol=C3=B6 writes: > Dear all, > > I want to add my own org-element affiliated keyword "REF" in order=20 > to provide a reference to some other part of an org mode document=20 > (or another document) for a link. > > For example: > > #+NAME: a-figure > #+REF: [[file:another_document.org]] > > [[file:a-figure.png]] > > I want to use `org-element-context' to get the link element and=20 > use `org-element-property' to get the `REF' property. > > I tried changing `org-element-affiliated-keywords' in order to=20 > define my own keyword. This is never picked up by=20 > `org-element-context' since it uses `org-element--affiliated-re'=20 > which is defined as a const and thus is never updated to reflect=20 > the change to `org-element-affiliated-keywords'. The help text for=20 > `org-element--affiliated-re' even mentions changing=20 > `org-element-affiliated-keywords'. > > Is this an oversight or am I trying to use this is a way that is=20 > not intended? Syntax is not meant to be changed by users. Also, `org-element-affiliated-keywords' is a defconst. You might abuse #+header: affiliated keyword to add a reference. Regards, --=20 Nicolas Goaziou