emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-element-adopt-elements, append before children


From: Ivan Tadeu Ferreira Antunes Filho
Subject: Re: [O] org-element-adopt-elements, append before children
Date: Sun, 2 Sep 2018 16:48:23 -0400

Org element insert before would insert the new element before the selected element, not as the first element child (I think)


At the moment I'm finding the first child, checking if it is non nil, and if it is not nil, dolist insert before the first child, else, adopt the elements. Which is a fairly convoluted way

On Sun, Sep 2, 2018, 8:27 AM Nicolas Goaziou <address@hidden> wrote:
Hello,

Ivan Tadeu Ferreira Antunes Filho <address@hidden> writes:

> At the moment  org-element-adopt-elements always appends the new elements
> after the elements original children.  In many cases one might want to
> append before the original children.
>
> I want to propose adding an argument to org-element-adopt-elements that
> defines if the elements should be added before or after the children, i.e.
> (if append-before
>   (nconc children (org-element-contents parent))
>   (nconc (org-element-contents parent) children))
>
> Would this be okay?

You can simply use `org-element-insert-before'.

Regards,

--
Nicolas Goaziou
_______________________________________________
Ita mailing list
address@hidden
http://mailman.mit.edu/mailman/listinfo/ita

reply via email to

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