From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: check if properties drawer exists before creating or manipulating? Date: Thu, 31 Oct 2013 11:34:59 -0400 Message-ID: <878ux9pi70.fsf@alphaville.bos.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbuHL-0008H2-6j for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 11:35:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbuHA-0000Fb-Co for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 11:35:23 -0400 Received: from plane.gmane.org ([80.91.229.3]:58662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbuHA-0000FO-5g for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 11:35:12 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VbuH9-0003ef-2c for emacs-orgmode@gnu.org; Thu, 31 Oct 2013 16:35:11 +0100 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 31 Oct 2013 16:35:11 +0100 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 31 Oct 2013 16:35:11 +0100 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 Matt Price writes: > (still trying to set properties automatically when a minor-mode is > set, see first message in thread) > > Is there a simple way to check if the properties drawer exists before > creating one? > I'm trying to add a hook to org-insert-heading-hook that will create a > property drawer if one doesn't exist; I don't want to create a bunch > of independent properties drawers. > Why can't you set properties directly with org-set-property? It'll create the drawer if it does not exist and reuse the existing drawer if it does. Nick