emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Setting buffer-level properties in code
@ 2024-10-11  3:47 mbork
  2024-10-12  7:28 ` Rohit Patnaik
  2024-10-12 18:48 ` Ihor Radchenko
  0 siblings, 2 replies; 3+ messages in thread
From: mbork @ 2024-10-11  3:47 UTC (permalink / raw)
  To: Org-Mode mailing list

Hi fellow Orgers,

I know that I can say

#+PROPERTY: name value

somewhere in the buffer to set the property `name' to `value' for every
entry (assuming I use inheritance, like in `(org-entry-get (point)
"name" t)`).

However, what I need is to programmatically insert or change that line
to set or update the property.  Is there a built-in function for that or
do I have to search and update that line myself?

TIA,

-- 
Marcin Borkowski
https://mbork.pl
https://crimsonelevendelightpetrichor.net/


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

* Re: Setting buffer-level properties in code
  2024-10-11  3:47 Setting buffer-level properties in code mbork
@ 2024-10-12  7:28 ` Rohit Patnaik
  2024-10-12 18:48 ` Ihor Radchenko
  1 sibling, 0 replies; 3+ messages in thread
From: Rohit Patnaik @ 2024-10-12  7:28 UTC (permalink / raw)
  To: mbork; +Cc: Org-Mode mailing list

> However, what I need is to programmatically insert or change that line
> to set or update the property.  Is there a built-in function for that or
> do I have to search and update that line myself?

I would look at `org-entry-put`. It seems like it does what you need --- it 
takes an element, marker or buffer position, and sets a property there, creating
the property drawer if necessary.

Thanks,
Rohit Patnaik


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

* Re: Setting buffer-level properties in code
  2024-10-11  3:47 Setting buffer-level properties in code mbork
  2024-10-12  7:28 ` Rohit Patnaik
@ 2024-10-12 18:48 ` Ihor Radchenko
  1 sibling, 0 replies; 3+ messages in thread
From: Ihor Radchenko @ 2024-10-12 18:48 UTC (permalink / raw)
  To: mbork; +Cc: Org-Mode mailing list

mbork@mbork.pl writes:

> #+PROPERTY: name value
> ...
> However, what I need is to programmatically insert or change that line
> to set or update the property.  Is there a built-in function for that or
> do I have to search and update that line myself?

There is nothing built-in, AFAIK.
Maybe https://github.com/ndwarshuis/org-ml has something.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

end of thread, other threads:[~2024-10-12 18:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11  3:47 Setting buffer-level properties in code mbork
2024-10-12  7:28 ` Rohit Patnaik
2024-10-12 18:48 ` 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).