From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Help on org-export-filter-link-functions Date: Sun, 05 Oct 2014 09:11:12 -0400 Message-ID: References: <87lhox2yf0.fsf@tanger.home> <87a95be2t3.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xalat-0002zn-2I for emacs-orgmode@gnu.org; Sun, 05 Oct 2014 09:11:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xalam-0005de-9R for emacs-orgmode@gnu.org; Sun, 05 Oct 2014 09:11:23 -0400 Received: from mail-qc0-x22a.google.com ([2607:f8b0:400d:c01::22a]:57004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xalam-0005c9-5T for emacs-orgmode@gnu.org; Sun, 05 Oct 2014 09:11:16 -0400 Received: by mail-qc0-f170.google.com with SMTP id m20so2948676qcx.1 for ; Sun, 05 Oct 2014 06:11:15 -0700 (PDT) In-Reply-To: <87a95be2t3.fsf@gmx.us> (rasmus@gmx.us's message of "Sun, 05 Oct 2014 03:13:44 +0200") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rasmus Cc: emacs-orgmode@gnu.org Rasmus writes: hmmm... the sometimes makes me nervous. I found even for links, this only works sometimes. That doesn't seem reliable to me. I think extending existing backends (e.g. http://orgmode.org/manual/Advanced-configuration.html) is probably more reliable for getting element properties, and approximately the same amount of work. I guess it just depends on how significantly you are modifying the export, and what information you need to modify it. Filters are great for simple wrapping and regexp based modifications. A derived backend is better if you need reliable element properties, and a different format than the default export. > John Kitchin writes: > >> I too am wondering if there is a defined way to get to the element >> properties within a filter function. > > qNo. But sometimes you can recover it from the text-properties, if it > is not a verb, (~=C2=B7~, =3D=C2=B7=3D). Her's an example: > > (defun rasmus/get-org-headline-string-element (headline backend info) > "Return the org element representation of a headline." > (let ((prop-point (next-property-change 0 headline))) > (and prop-point (plist-get (text-properties-at prop-point headline)= :parent)))) --=20 ----------------------------------- John Kitchin Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu