From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Rose Subject: Re: org-id-get-create maybe... Date: Wed, 05 Aug 2009 13:33:27 +0200 Message-ID: <877hxitrzs.fsf@kassiopeya.MSHEIMNETZ> References: <87my6f5gcc.fsf@kassiopeya.MSHEIMNETZ> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MYegG-0003xU-1o for emacs-orgmode@gnu.org; Wed, 05 Aug 2009 07:29:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MYegB-0003v9-Cm for emacs-orgmode@gnu.org; Wed, 05 Aug 2009 07:29:15 -0400 Received: from [199.232.76.173] (port=35946 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MYegB-0003v2-5q for emacs-orgmode@gnu.org; Wed, 05 Aug 2009 07:29:11 -0400 Received: from mail.gmx.net ([213.165.64.20]:42402) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MYegA-00006f-G5 for emacs-orgmode@gnu.org; Wed, 05 Aug 2009 07:29:10 -0400 In-Reply-To: (Carsten Dominik's message of "Wed, 5 Aug 2009 01:49:06 +0200") 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: Carsten Dominik Cc: Emacs-orgmode mailing list Carsten Dominik writes: > On Aug 5, 2009, at 1:06 AM, Sebastian Rose wrote: > >> >> >> In my org-setup, I want to have something like this: >> >> (defun sr-org-id-insert-maybe () >> (if (y-or-n-p "Create a unique ID for this section?") >> (org-id-get-create))) >> >> (org-insert-heading-hook (quote (sr-org-id-insert-maybe))) >> >> >> >> But I don't want to enable it globally. Instead, I want to create IDs >> semi-automatic for special files (or projects) only. >> >> How would I do that? > > Take a look at > > file variables > > http://www.gnu.org/software/emacs/manual/html_node/emacs/File-Variables.html#File-Variables > > and directory variables. > > http://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html#Directory-Variables > > And then make your hook dependent on the value of such a variable. I knew there were a solution somewhere :) Thanks a bunch! Sebastian