From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Neff Subject: Re: CUSTOM_ID vs ID Date: Mon, 29 Jul 2019 19:38:17 -0500 Message-ID: References: <87k1c2mvfq.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000031544d058edb3ad5" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:59711) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsG9y-0000wf-E4 for emacs-orgmode@gnu.org; Mon, 29 Jul 2019 20:38:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsG9w-0000RU-3K for emacs-orgmode@gnu.org; Mon, 29 Jul 2019 20:38:34 -0400 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]:38633) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hsG9v-0000Q4-HY for emacs-orgmode@gnu.org; Mon, 29 Jul 2019 20:38:32 -0400 Received: by mail-io1-xd30.google.com with SMTP id j6so4419437ioa.5 for ; Mon, 29 Jul 2019 17:38:29 -0700 (PDT) In-Reply-To: <87k1c2mvfq.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nathan Neff , emacs-orgmode --00000000000031544d058edb3ad5 Content-Type: text/plain; charset="UTF-8" On Sun, Jul 28, 2019 at 3:10 AM Nicolas Goaziou wrote: > Hello, > > Nathan Neff writes: > > > I've often been confused why org-mode has both a CUSTOM_ID > > and a ID property. I mean, why not just use one or the other name? > > Custom ID are user-defined, and only meaningful in the scope of the > document. Also, they may appear as-is when exported, e.g., as an anchor > in HTML. > > ID are (or should be) generated by Org, and are valid across files, > which means they need to be absolutely unique. > I have a lot of org files and one of the main purposes of links is to be able to link to different headings across documents. This seems to imply I should use the ID property. However, I usually *do* manually assign IDs (not CUSTOM_IDs) myself. The reason is so I can reasonably search for the ID within my org files and that the link ID makes some sense to me. For example, if I see a link to "id:keyboard_shortcuts" I can tell where it's going. Later on, if I want to insert a link to my keyboard shortcuts heading in another place in my org files, I can make a guess of the ID I want to link to. So, I guess I'm okay manually assigning ID properties, as long as I don't have conflicts. Thanks for the explanation! Thanks, --Nate > > Org keeps track of ID if `org-id-track-globally' is non-nil (the > default). If this is nil, there is almost no difference between ID and > custom ID. > > > When would I ever have both an ID and a CUSTOM_ID property for > > a heading? > > You may want to refer to a heading from anywhere with id:... but need > a clean anchor in HTML export, for example. > > FWIW, I never use ID property. > > Regards, > > -- > Nicolas Goaziou > --00000000000031544d058edb3ad5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, Jul 28, 2019 at 3:10 AM Nicol= as Goaziou <mail@nicolasgoazio= u.fr> wrote:
Hello,

Nathan Neff <= nathan.neff@gmail.com> writes:

> I've often been confused why org-mode has both a CUSTOM_ID
> and a ID property.=C2=A0 I mean, why not just use one or the other nam= e?

Custom ID are user-defined, and only meaningful in the scope of the
document. Also, they may appear as-is when exported, e.g., as an anchor
in HTML.

ID are (or should be) generated by Org, and are valid across files,
which means they need to be absolutely unique.=C2=A0
=
I have a lot of org files and one of the main purposes of li= nks is to be able to link
to different headings across documents.= =C2=A0 This seems to imply I should use=C2=A0
the ID property.

However, I usually *do* manually assign IDs (not CUS= TOM_IDs) myself. =C2=A0 The
reason is so I can reasonably search = for the ID within my org files and that the link
ID makes some se= nse to me.

For example, if I see a link to "i= d:keyboard_shortcuts" I can tell where it's going.
Later= on, if I want to insert a link to my keyboard shortcuts heading in another= place
in my org files, =C2=A0I can make a guess of the ID I want= to link to.

So, I guess I'm okay manually ass= igning ID properties, as long as I don't have conflicts.

=
Thanks for the explanation!

Thanks,
=
--Nate


=C2=A0

Org keeps track of ID if `org-id-track-globally' is non-nil (the
default). If this is nil, there is almost no difference between ID and
custom ID.

> When would I ever have both an ID and a CUSTOM_ID property for
> a heading?

You may want to refer to a heading from anywhere with id:... but need
a clean anchor in HTML export, for example.

FWIW, I never use ID property.

Regards,

--
Nicolas Goaziou
--00000000000031544d058edb3ad5--