emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* properties using other properties
@ 2018-01-23  6:28 cpb
  2018-01-25  0:19 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: cpb @ 2018-01-23  6:28 UTC (permalink / raw)
  To: emacs-orgmode


Is there a way to set properties using other properties?  Doesn't matter
if its on export only, though it would be nice to have it in-situ.

here's an example (obviously doesn't work), where a project properties
for the project client only needs the CLIENT property filled, the rest
of it automatically populates on export.  Would save having to duplicate
the data where there are a lot of projects.


* client1
    :PROPERTIES:
    :CUSTOM_ID:        client1
    :NAME:             a client
    :ADDRESS:          an address
    :EMAIL:            an email
    :URL:              a website
    :END:

* project1
    :PROPERTIES:
    :CUSTOM_ID:        project1
    :NAME:             a project
    :CLIENT:           client1
    :CLIENT_NAME:      {{{property(NAME,#{{{property(CLIENT)}}})}}}
    :CLIENT_ADDRESS:   {{{property(ADDRESS,#{{{property(CLIENT)}}})}}}
    :CLIENT_EMAIL:     {{{property(EMAIL,#{{{property(CLIENT)}}})}}}
    :EXPORT_FILE_NAME: ./a_project
    :END:

    project....: {{{property(NAME)}}}
    for........: {{{property(CLIENT)}}}
                 {{{property(CLIENT_ADDRESS)}}}
                 {{{property(CLIENT_EMAIL)}}}

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

* Re: properties using other properties
  2018-01-23  6:28 properties using other properties cpb
@ 2018-01-25  0:19 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2018-01-25  0:19 UTC (permalink / raw)
  To: cpb, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1908 bytes --]

I recommend looking into org-edna
(http://www.nongnu.org/org-edna-el/#conditional_forms).
You can try to use "has-property" in combination with "set-property" as
a TRIGGER.

Alternatively, you can customize org-property-changed-functions (see
https://www.reddit.com/r/emacs/comments/7gr9ps/add_logbook_entry_and_note_on_orgmode_property/)
and reimplement org-edna functionality for your purposes.

Regards,
Ihor

cpb <cpb@snotbubble.com> writes:

> Is there a way to set properties using other properties?  Doesn't matter
> if its on export only, though it would be nice to have it in-situ.
>
> here's an example (obviously doesn't work), where a project properties
> for the project client only needs the CLIENT property filled, the rest
> of it automatically populates on export.  Would save having to duplicate
> the data where there are a lot of projects.
>
>
> * client1
>     :PROPERTIES:
>     :CUSTOM_ID:        client1
>     :NAME:             a client
>     :ADDRESS:          an address
>     :EMAIL:            an email
>     :URL:              a website
>     :END:
>
> * project1
>     :PROPERTIES:
>     :CUSTOM_ID:        project1
>     :NAME:             a project
>     :CLIENT:           client1
>     :CLIENT_NAME:      {{{property(NAME,#{{{property(CLIENT)}}})}}}
>     :CLIENT_ADDRESS:   {{{property(ADDRESS,#{{{property(CLIENT)}}})}}}
>     :CLIENT_EMAIL:     {{{property(EMAIL,#{{{property(CLIENT)}}})}}}
>     :EXPORT_FILE_NAME: ./a_project
>     :END:
>
>     project....: {{{property(NAME)}}}
>     for........: {{{property(CLIENT)}}}
>                  {{{property(CLIENT_ADDRESS)}}}
>                  {{{property(CLIENT_EMAIL)}}}
>

-- 
Ihor Radchenko,
PhD Student
Singapore University of Technology and Design,
8 Somapah Road Singapore 487372
Email: yantar92@gmail.com, ihor_radchenko@mymail.sutd.edu.sg
Tel: +6584017977

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

end of thread, other threads:[~2018-01-25  0:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-23  6:28 properties using other properties cpb
2018-01-25  0:19 ` Ihor Radchenko

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