[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] How to call org-set-property from a function
From: |
Rasmus |
Subject: |
Re: [O] How to call org-set-property from a function |
Date: |
Wed, 06 Jan 2016 00:34:19 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
Julien Cubizolles <address@hidden> writes:
> Rasmus <address@hidden> writes:
>
>
>> Does this do what you want:
>>
>> (call-interactively 'org-set-property)
>
> Thanks, indeed it does, Marcin beat you to it though :-)
>
>>> Also, I will sometimes need to include several different
>>> properties. What would be the right way to run a loop where a new
>>> property is set until the user answers something like C-return at the
>>> prompt ?
>>
>> Here's naive approach. Probably you can find a more elegant way.
>>
>> (condition-case nil
>> (while t
>> (call-interactively 'org-set-property))
>> (quit nil))
>
> That's working, I'm breaking out of the loop with C-g, is that what you
> intended ?
Yes.
When you enter no value (C-j when ido is enabled) it insert :: VALUE.
For more fine grained control you probably need to write something akin to
org-set-property and check the actual values (e.g. to signal quit if an
empty quote is returned).
Rasmus
--
And when I’m finished thinking, I have to die a lot