From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: org-id: always add IDs Date: Sun, 1 Mar 2009 17:11:36 +0100 Message-ID: <6D1E4E86-E0C2-4B26-9DF2-2BE9951FEEA1@uva.nl> References: <877i392qki.fsf@kassiopeya.MSHEIMNETZ> Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LdoGS-0007NA-QG for emacs-orgmode@gnu.org; Sun, 01 Mar 2009 11:11:40 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LdoGR-0007Mb-FA for emacs-orgmode@gnu.org; Sun, 01 Mar 2009 11:11:40 -0500 Received: from [199.232.76.173] (port=50411 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LdoGR-0007MU-3K for emacs-orgmode@gnu.org; Sun, 01 Mar 2009 11:11:39 -0500 Received: from mail-ew0-f179.google.com ([209.85.219.179]:45338) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LdoGQ-0001K1-Ke for emacs-orgmode@gnu.org; Sun, 01 Mar 2009 11:11:38 -0500 Received: by ewy27 with SMTP id 27so1900976ewy.42 for ; Sun, 01 Mar 2009 08:11:37 -0800 (PST) In-Reply-To: <877i392qki.fsf@kassiopeya.MSHEIMNETZ> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastian Rose Cc: emacs-orgmode Org-Mode On Feb 27, 2009, at 10:30 AM, Sebastian Rose wrote: > Hi, > > > I have several questions concerning IDs. > > > Is there a prefered method to _always_ add an org-id to an entry? (add-hook 'org-insert-heading-hook (lambda () (org-id-get-create))) > The IDs would become _realy_ usefull, if I could add them > automatically > whenever a new entry is created (a headline) that is _not_ below > `org-export-headline-levels'. You need to do more work if you want to have id' only for the top few levels, then you first need to find out what the level is. You can look at the dynamically scoped variable `head' which will contain the stars to be inserted (and, maybe, also a space, careful there) On the other hand, I don't see why it it would be a problem to have ids in headlines below the limit. But I do not yet know how well my ID mechanism will scale. Should be pretty good, actually. > Is it possible to have an ID added, even if the headline is added by > hand (i.e. typing `* headline')? No easily. The fastest way to get one added by hand is to store a link to the heading with `C-c l'. If `org-link-to-org-use-id' is t or 'create-if-interactive', an id will be added. > Can this be achieved using an advice? How to do that? Since no special function is called when you type a headline, it would have to be advice to org-self-insert-command. Very likely that would significantly slow down typing, I strongly advice against doing that. > Is it possible to tell Org-mode to add IDs to all the entries that > have > none yet? (org-map-entries '(org-id-get-create) "LEVEL<5" 'agenda) Make sure the scope (here `agenda') is so that you will reach the files you want. > How would I tell emacs to update Org-mode's ID database? M-x org-id-update-id-locations RET See the docstring to make sure it will reach the right files > Could the org-id be added when publishing? > Like >

HEADLINE > THE-ORG-ID-ITSELF span> >

> or similar? They already are in the HTML, I am surprised you never noticed. - Carsten