From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Rettke Subject: org-element approach to modify or add ID to every headline Date: Sat, 8 Aug 2015 22:01:12 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOGrL-0008GD-AR for emacs-orgmode@gnu.org; Sat, 08 Aug 2015 23:01:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZOGrK-0000BM-DX for emacs-orgmode@gnu.org; Sat, 08 Aug 2015 23:01:15 -0400 Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]:37439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZOGrK-0000BE-5p for emacs-orgmode@gnu.org; Sat, 08 Aug 2015 23:01:14 -0400 Received: by wibhh20 with SMTP id hh20so109249369wib.0 for ; Sat, 08 Aug 2015 20:01:12 -0700 (PDT) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "emacs-orgmode@gnu.org" Good evening, Emacs 24.4 and Org from Git. Goal: 1) Visit every headline 2) If there is an ID property 1) Then replace it's value with a UUID 3) If there is not an ID property 1) Add an ID property and give it a UUID. `org-uuid' [provides] the functionality to add the ID with a UUID. [This post] explains how to do it: =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80 =E2=94=82 (require 'org-id) =E2=94=82 (save-excursion =E2=94=82 (goto-char (point-max)) =E2=94=82 (while (outline-previous-heading) =E2=94=82 (org-id-get-create))) =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80 What is the best way to do it with `org-element'? [provides] http://orgmode.org/w/?p=3Dorg-mode.git;a=3Dblob_plain;f=3Dlisp/org-id.el;hb= =3DHEAD [This post] https://stackoverflow.com/questions/13340616/assign-ids-to-every-entry-in-o= rg-mode