emacs-orgmode
[Top][All Lists]
Advanced

[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: Tue, 05 Jan 2016 23:27:19 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Hi Julien,


Julien Cubizolles <address@hidden> writes:

> I have the following function to automate the creation of a new entry:
>
> #+begin_src emacs-lisp
>   (interactive)
>   (save-excursion
>     (org-beamer-select-environment)
>     (org-set-tags-command)
>     )
> #+end_src
>
> I'd like to add the possibility to set some properties through
> (org-set-property) but I can't figure out how to call it in its
> interactive way, so that it prompts me for a property and value ? Of
> course adding (org-set-property) or (interactive (org-set-property))
> doesn't work.

Does this do what you want:

     (call-interactively 'org-set-property) 

> 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))

Rasmus

-- 
Spil noget med Slayer!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]