emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* check if properties drawer exists before creating or manipulating?
@ 2013-10-31 14:17 Matt Price
  2013-10-31 15:34 ` Nick Dokos
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Price @ 2013-10-31 14:17 UTC (permalink / raw)
  To: Org Mode

(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.

Thanks!

Matt

^ permalink raw reply	[flat|nested] 4+ messages in thread

* check if properties drawer exists before creating or manipulating?
@ 2013-10-31 14:18 Matt Price
  2013-10-31 14:36 ` Marcin Borkowski
  0 siblings, 1 reply; 4+ messages in thread
From: Matt Price @ 2013-10-31 14:18 UTC (permalink / raw)
  To: Org Mode

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 (see my earlier email, in which I
ask,

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: check if properties drawer exists before creating or manipulating?
  2013-10-31 14:18 check if properties drawer exists before creating or manipulating? Matt Price
@ 2013-10-31 14:36 ` Marcin Borkowski
  0 siblings, 0 replies; 4+ messages in thread
From: Marcin Borkowski @ 2013-10-31 14:36 UTC (permalink / raw)
  To: emacs-orgmode

Dnia 2013-10-31, o godz. 10:18:01
Matt Price <moptop99@gmail.com> napisał(a):

> 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 (see my earlier email, in which I
> ask,
> 

What about narrowing to the current entry and then searching for the
regex in the variable org-property-drawer-re (which see)?

Hth,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: check if properties drawer exists before creating or manipulating?
  2013-10-31 14:17 Matt Price
@ 2013-10-31 15:34 ` Nick Dokos
  0 siblings, 0 replies; 4+ messages in thread
From: Nick Dokos @ 2013-10-31 15:34 UTC (permalink / raw)
  To: emacs-orgmode

Matt Price <moptop99@gmail.com> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-31 15:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-31 14:18 check if properties drawer exists before creating or manipulating? Matt Price
2013-10-31 14:36 ` Marcin Borkowski
  -- strict thread matches above, loose matches on Subject: below --
2013-10-31 14:17 Matt Price
2013-10-31 15:34 ` Nick Dokos

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).