From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: org-element-adopt-elements, append before children Date: Sun, 02 Sep 2018 14:27:46 +0200 Message-ID: <8736usxewt.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwRXL-0006eO-CO for emacs-orgmode@gnu.org; Sun, 02 Sep 2018 08:31:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fwRWr-0005hN-PL for emacs-orgmode@gnu.org; Sun, 02 Sep 2018 08:31:06 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:38711) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fwRWX-0005PS-FU for emacs-orgmode@gnu.org; Sun, 02 Sep 2018 08:30:57 -0400 In-Reply-To: (Ivan Tadeu Ferreira Antunes Filho's message of "Sun, 2 Sep 2018 02:52:08 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Ivan Tadeu Ferreira Antunes Filho Cc: emacs-orgmode@gnu.org Hello, Ivan Tadeu Ferreira Antunes Filho 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