[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Upstreaming org-element-ast (was: Improving Emacs' iCalendar support
From: |
Ihor Radchenko |
Subject: |
Re: Upstreaming org-element-ast (was: Improving Emacs' iCalendar support) |
Date: |
Wed, 01 Jan 2025 09:29:41 +0000 |
Richard Lawrence <rwl@recursewithless.net> writes:
> 1) Is there any way to use my own list of standard-properties? In
> particular, besides :begin, :end, :contents-begin, :contents-end, I'd
> like to have :value-begin and :value-end as standard properties, and
> always include (:value) in :secondary. If there's no way to do that
> yet, I think it would be useful to add for use outside of org.
Currently, there is no such way. But it is one of the obvious problems
that need to be solved to make the library truly generic.
I am not 100% sure how though.
The idea behind standard properties is inlining the calls to
`org-element-property' for faster access.
Dynamic standard-properties will defeat the purpose of this whole arrangement.
The only thing coming to my mind is asking the libraries to use
(let ((org-element--standard-properties <custom value>))
(defun library-x (...)
...))
Or maybe the library can somehow flag to org-element-ast during compile
time about the properties to be optimized.
> 2) I'm finding org-element-create rather unintuitive to work with, I
> think because of its &rest argument for children and the handling of
> "anonymous" nodes.
> ...
> As it is, I can't figure out how to call org-element-create and
> org-element-contents in the right way to set the contents of a node
> to a list of other nodes, and return that list from
> org-element-contents.
Should be just
(org-element-create type props contents)
and then
(org-element-contents new-node)
> I always seem to end up with an extra level of nesting.
> e.g. Instead of (child1 child2 child3 ...)
> org-element-contents returns ((child1 child2 child3 ...)).
> Likewise, if there are no children, instead of nil it returns (nil).
> I can't figure out why this happens; as far as I can tell, I'm
> calling both org-element-create and org-element-contents in the right
> way.
May you give some examples when things misbehave?
--
Ihor Radchenko // yantar92,
Org mode maintainer,
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>
- Re: Upstreaming org-element-ast (was: Improving Emacs' iCalendar support),
Ihor Radchenko <=
- Re: Upstreaming org-element-ast (was: Improving Emacs' iCalendar support), Richard Lawrence, 2025/01/01
- Re: Upstreaming org-element-ast (was: Improving Emacs' iCalendar support), Ihor Radchenko, 2025/01/02
- Re: Upstreaming org-element-ast (was: Improving Emacs' iCalendar support), Richard Lawrence, 2025/01/02
- Re: Upstreaming org-element-ast (was: Improving Emacs' iCalendar support), Ihor Radchenko, 2025/01/02
- Re: Upstreaming org-element-ast (was: Improving Emacs' iCalendar support), Richard Lawrence, 2025/01/05
- Re: Upstreaming org-element-ast (was: Improving Emacs' iCalendar support), Ihor Radchenko, 2025/01/05
- Re: Upstreaming org-element-ast (was: Improving Emacs' iCalendar support), Richard Lawrence, 2025/01/10
- Re: Upstreaming org-element-ast (was: Improving Emacs' iCalendar support), Ihor Radchenko, 2025/01/12
- Re: Upstreaming org-element-ast (was: Improving Emacs' iCalendar support), Richard Lawrence, 2025/01/15
- Re: Upstreaming org-element-ast (was: Improving Emacs' iCalendar support), Ihor Radchenko, 2025/01/15