From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Alexander_Wing=E5rd?= Subject: Go to heading using LISP Date: Sat, 8 Jun 2013 15:52:21 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c2c6ce4cad4f04dea4db29 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlJZC-00005O-Cn for emacs-orgmode@gnu.org; Sat, 08 Jun 2013 09:52:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UlJZ8-000143-UW for emacs-orgmode@gnu.org; Sat, 08 Jun 2013 09:52:26 -0400 Received: from mail-qa0-x22c.google.com ([2607:f8b0:400d:c00::22c]:55229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlJZ8-00013x-QF for emacs-orgmode@gnu.org; Sat, 08 Jun 2013 09:52:22 -0400 Received: by mail-qa0-f44.google.com with SMTP id j8so1580457qah.17 for ; Sat, 08 Jun 2013 06:52:22 -0700 (PDT) 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: emacs-orgmode --001a11c2c6ce4cad4f04dea4db29 Content-Type: text/plain; charset=ISO-8859-1 Hi! I want to create special key-bindings that use the org-refile goto interface to jump to specific headings. My initial attempt was: (org-refile 4 "gtd.org" "Projects/Work/Bugs") But it seems specifying RFLOC is not that simple. Someone have any idea how to achieve this or another way to jump to a heading? Best Regards /Alexander --001a11c2c6ce4cad4f04dea4db29 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi!

I want to create special key-bindin= gs that use the org-refile goto interface to jump to specific headings.

My initial attempt was:
(org-re= file 4 "gtd.org" "Projects/Wo= rk/Bugs")

But it seems specifying RFLOC is not that s= imple.

Someone have any idea how to ac= hieve this or another way to jump to a heading?

Best Regards /Alexander
--001a11c2c6ce4cad4f04dea4db29-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: Go to heading using LISP Date: Sun, 09 Jun 2013 09:36:00 +0800 Message-ID: <874nd8awvz.fsf@ericabrahamsen.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlUYA-00012f-JZ for emacs-orgmode@gnu.org; Sat, 08 Jun 2013 21:36:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UlUY9-00006n-Il for emacs-orgmode@gnu.org; Sat, 08 Jun 2013 21:36:06 -0400 Received: from plane.gmane.org ([80.91.229.3]:36567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlUY9-00006j-C8 for emacs-orgmode@gnu.org; Sat, 08 Jun 2013 21:36:05 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UlUY8-000299-Aq for emacs-orgmode@gnu.org; Sun, 09 Jun 2013 03:36:04 +0200 Received: from 114.250.119.148 ([114.250.119.148]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 09 Jun 2013 03:36:04 +0200 Received: from eric by 114.250.119.148 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 09 Jun 2013 03:36:04 +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: emacs-orgmode@gnu.org Alexander Wingård writes: > Hi! > > I want to create special key-bindings that use the org-refile goto > interface to jump to specific headings. > > My initial attempt was: > (org-refile 4 "gtd.org" "Projects/Work/Bugs") > > But it seems specifying RFLOC is not that simple. > > Someone have any idea how to achieve this or another way to jump to a > heading? Is the `org-goto' interface close enough? It only does the current buffer, but you can set org-goto-interface to make it behave a fair bit like refile... Yours Eric From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander =?utf-8?b?V2luZ8OlcmQ=?= Subject: Re: Go to heading using LISP Date: Sun, 9 Jun 2013 14:43:55 +0000 (UTC) Message-ID: References: <874nd8awvz.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ulgrj-0007U9-7h for emacs-orgmode@gnu.org; Sun, 09 Jun 2013 10:45:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ulgrh-00026K-Un for emacs-orgmode@gnu.org; Sun, 09 Jun 2013 10:45:07 -0400 Received: from plane.gmane.org ([80.91.229.3]:55825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ulgrh-00025F-Ob for emacs-orgmode@gnu.org; Sun, 09 Jun 2013 10:45:05 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ulgrf-0007vW-Oy for emacs-orgmode@gnu.org; Sun, 09 Jun 2013 16:45:03 +0200 Received: from h135n7-g-kt-d2.ias.bredband.telia.com ([81.234.35.135]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 09 Jun 2013 16:45:03 +0200 Received: from alexander.wingard by h135n7-g-kt-d2.ias.bredband.telia.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 09 Jun 2013 16:45:03 +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: emacs-orgmode@gnu.org Eric Abrahamsen ericabrahamsen.net> writes: > > Alexander Wingård gmail.com> writes: > > > Hi! > > > > I want to create special key-bindings that use the org-refile goto > > interface to jump to specific headings. More specific example, let's say I want to bind keys in my .emacs file: "C-c b" -> find "gtd.org" and jump to "Projects/Work/Bugs" "C-c m" -> find "gtd.org" and jump to "Projects/Work/Meetings" > > > > My initial attempt was: > > (org-refile 4 "gtd.org" "Projects/Work/Bugs") > > > > But it seems specifying RFLOC is not that simple. > > > > Someone have any idea how to achieve this or another way to jump to a > > heading? > > Is the `org-goto' interface close enough? It only does the current > buffer, but you can set org-goto-interface to make it behave a fair bit > like refile... I've looked at that function aswell but it seems even harder to achieve what I want with: Call it from lisp without any user interaction. If you think that is possible I would love an example. > > Yours > Eric > > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: Go to heading using LISP Date: Mon, 10 Jun 2013 12:26:18 +0800 Message-ID: <8738sq7frp.fsf@ericabrahamsen.net> References: <874nd8awvz.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UltgW-0007Fa-LF for emacs-orgmode@gnu.org; Mon, 10 Jun 2013 00:26:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UltgV-0007Dy-F9 for emacs-orgmode@gnu.org; Mon, 10 Jun 2013 00:26:24 -0400 Received: from plane.gmane.org ([80.91.229.3]:41903) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UltgV-0007Ds-8W for emacs-orgmode@gnu.org; Mon, 10 Jun 2013 00:26:23 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UltgT-0006xt-PD for emacs-orgmode@gnu.org; Mon, 10 Jun 2013 06:26:21 +0200 Received: from 114.252.252.196 ([114.252.252.196]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Jun 2013 06:26:21 +0200 Received: from eric by 114.252.252.196 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Jun 2013 06:26:21 +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: emacs-orgmode@gnu.org Alexander Wingård writes: > Eric Abrahamsen ericabrahamsen.net> writes: > >> >> Alexander Wingård gmail.com> writes: >> >> > Hi! >> > >> > I want to create special key-bindings that use the org-refile goto >> > interface to jump to specific headings. > More specific example, let's say I want to bind keys in my .emacs file: > > "C-c b" -> find "gtd.org" and jump to "Projects/Work/Bugs" > "C-c m" -> find "gtd.org" and jump to "Projects/Work/Meetings" >> > >> > My initial attempt was: >> > (org-refile 4 "gtd.org" "Projects/Work/Bugs") >> > >> > But it seems specifying RFLOC is not that simple. >> > >> > Someone have any idea how to achieve this or another way to jump to a >> > heading? >> >> Is the `org-goto' interface close enough? It only does the current >> buffer, but you can set org-goto-interface to make it behave a fair bit >> like refile... > I've looked at that function aswell but it seems even harder to achieve > what I want with: Call it from lisp without any user interaction. If you think > that is possible I would love an example. Ah, I see. Well, if you're just looking for a lisp function to jump to a headline, you could use `org-refile-get-targets' to produce a full table of all the possible refile targets, and then choose among them. (assoc "gtd.org/Projects/Work/Bugs" (org-refile-get-targets)) will find the right heading, then I guess the value of point is in that heading somewhere -- you can visit the file and goto-point. But if you're just looking to bind a bunch of keys to "jump to specific heading" commands, I'd use custom ids. Give all the headings in question ID properties, and then just use something like this: (global-set-key (kbd "C-c b") (lambda () (org-id-open "f1d05552-1dce-4004-a914-d2b092d8470e"))) Hope that helps, Eric From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: Go to heading using LISP Date: Mon, 10 Jun 2013 11:23:46 +0530 Message-ID: <87sj0qcxzp.fsf@gmail.com> References: <874nd8awvz.fsf@ericabrahamsen.net> <8738sq7frp.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ulv2P-0002ZR-1e for emacs-orgmode@gnu.org; Mon, 10 Jun 2013 01:53:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ulv2O-0007S1-4C for emacs-orgmode@gnu.org; Mon, 10 Jun 2013 01:53:04 -0400 Received: from mail-pb0-x233.google.com ([2607:f8b0:400e:c01::233]:58439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ulv2N-0007Rp-T0 for emacs-orgmode@gnu.org; Mon, 10 Jun 2013 01:53:04 -0400 Received: by mail-pb0-f51.google.com with SMTP id um15so6815126pbc.24 for ; Sun, 09 Jun 2013 22:53:02 -0700 (PDT) Received: from debian-6.05 ([115.241.90.123]) by mx.google.com with ESMTPSA id nt6sm9169650pbb.4.2013.06.09.22.53.00 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Sun, 09 Jun 2013 22:53:02 -0700 (PDT) In-Reply-To: <8738sq7frp.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Mon, 10 Jun 2013 12:26:18 +0800") 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: emacs-orgmode@gnu.org Eric Abrahamsen writes: > if you're just looking for a lisp function to jump to a headline One can use org-ctags and use Emacs and etags interface (M-. etc) to jump to a headline. One can also choose the headline via completion. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Myles English Subject: Re: Go to heading using LISP Date: Mon, 10 Jun 2013 20:00:54 +0100 Message-ID: <87wqq1oknt.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um7IT-0002np-Ce for emacs-orgmode@gnu.org; Mon, 10 Jun 2013 14:58:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Um7IR-0006tU-Vm for emacs-orgmode@gnu.org; Mon, 10 Jun 2013 14:58:29 -0400 Received: from mail-ea0-x229.google.com ([2a00:1450:4013:c01::229]:49910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um7IR-0006q8-Pg for emacs-orgmode@gnu.org; Mon, 10 Jun 2013 14:58:27 -0400 Received: by mail-ea0-f169.google.com with SMTP id h15so5692093eak.14 for ; Mon, 10 Jun 2013 11:58:26 -0700 (PDT) In-reply-to: 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: =?utf-8?Q?Alexander_Wing=C3=A5rd?= Cc: emacs-orgmode Hi Alexander, Alexander Wingård writes: > I want to create special key-bindings that use the org-refile goto > interface to jump to specific headings. It doesn't use org-refile but this is what I use: (defun my-goto-heading(file heading-text) "Visit file `file' and goto headline `heading-text'" (find-file file) (org-element-map (org-element-parse-buffer 'headline) 'headline (lambda (x) (if (string= (org-element-property :raw-value x) heading-text) (goto-char (org-element-property :begin x)) nil)) nil t)) ;; stop at first find (defun gtd() (interactive) (my-goto-heading (concat org-directory "/gtd.org") "Daily work") (org-show-entry) ;;(org-show-subtree) (reposition-window) (org-agenda-list)) In the gtd function I also set org-agenda-files but left it out for clarity. Myles From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?Alexander_Wing=E5rd?= Subject: Re: Go to heading using LISP Date: Mon, 10 Jun 2013 23:14:19 +0200 Message-ID: <83D22E2E-B091-4BA7-8311-56F2DA9D57C4@gmail.com> References: <87wqq1oknt.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um9Q3-0005RN-6o for emacs-orgmode@gnu.org; Mon, 10 Jun 2013 17:14:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Um9Q0-0007rg-Kg for emacs-orgmode@gnu.org; Mon, 10 Jun 2013 17:14:27 -0400 Received: from mail-la0-x235.google.com ([2a00:1450:4010:c03::235]:33631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Um9Q0-0007rc-Bk for emacs-orgmode@gnu.org; Mon, 10 Jun 2013 17:14:24 -0400 Received: by mail-la0-f53.google.com with SMTP id fs12so4661608lab.26 for ; Mon, 10 Jun 2013 14:14:23 -0700 (PDT) In-Reply-To: <87wqq1oknt.fsf@gmail.com> 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: Myles English Cc: emacs-orgmode On 10 jun 2013, at 21:00, Myles English wrote: >=20 > Hi Alexander, >=20 > Alexander Wing=E5rd writes: >=20 >> I want to create special key-bindings that use the org-refile goto >> interface to jump to specific headings. >=20 > It doesn't use org-refile but this is what I use: >=20 > (defun my-goto-heading(file heading-text) > "Visit file `file' and goto headline `heading-text'" > (find-file file) > (org-element-map (org-element-parse-buffer 'headline) 'headline > (lambda (x) > (if (string=3D (org-element-property :raw-value x) = heading-text) > (goto-char (org-element-property :begin x)) > nil)) > nil t)) ;; stop at first find >=20 Thanks alot! This is exactly what I was asking for. This will suffice = for me now. Maybe some day I will learn some LISP and teach it to navigate the = hierarchical structure. Best Regards /Alexander= From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Alexander_Wing=E5rd?= Subject: Re: Go to heading using LISP Date: Wed, 19 Jun 2013 20:24:26 +0200 Message-ID: References: <87wqq1oknt.fsf@gmail.com> <83D22E2E-B091-4BA7-8311-56F2DA9D57C4@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0021cc0229c6928d0604df85f0e9 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpN3a-0008Mk-7p for emacs-orgmode@gnu.org; Wed, 19 Jun 2013 14:24:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpN3V-0000Mi-9z for emacs-orgmode@gnu.org; Wed, 19 Jun 2013 14:24:32 -0400 Received: from mail-qc0-x229.google.com ([2607:f8b0:400d:c01::229]:52951) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpN3V-0000MN-50 for emacs-orgmode@gnu.org; Wed, 19 Jun 2013 14:24:29 -0400 Received: by mail-qc0-f169.google.com with SMTP id c10so3245985qcz.0 for ; Wed, 19 Jun 2013 11:24:26 -0700 (PDT) In-Reply-To: <83D22E2E-B091-4BA7-8311-56F2DA9D57C4@gmail.com> 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: Myles English Cc: emacs-orgmode --0021cc0229c6928d0604df85f0e9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Mon, Jun 10, 2013 at 11:14 PM, Alexander Wing=E5rd < alexander.wingard@gmail.com> wrote: > > Maybe some day I will learn some LISP and teach it to navigate the > hierarchical structure. > > I actually got curious and gave this a try and here's what I came up with: test.org: * a ** b *** h ** b *** q **** h ** c *** d Elisp: (defun goto-notes () (interactive) (find-file "~/test.org") (org-goto-subtree '("a" "b" "q" "h")) (org-show-context) (org-show-entry) (show-children)) (defun org-goto-subtree (path) (let ((level 1)) (org-element-map (org-element-parse-buffer 'headline) 'headline (lambda (x) (if (< (org-element-property :level x) level) (setq level (org-element-property :level x))) (if (and (=3D level (org-element-property :level x)) (string=3D (nth (- level 1) path) (org-element-property :raw-value x))) (progn (setq level (+ level 1)) (if (> level (list-length path)) (goto-char (org-element-property :begin x)))))) nil t))) https://gist.github.com/AlexanderWingard/5814843 My very first attempt at programming Elisp so any feedback is appreciated. Best regards Alexander --0021cc0229c6928d0604df85f0e9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Mon, Jun 10, 2013 at 11:14 PM, Alexander Wing=E5rd <alexander.wingard@gmail.com> wrote:

Maybe some day I will learn some LISP and teach it to navigate the hierarch= ical structure.


I actually got curious and gave this a try and here's wha= t I came up with:
test.org:
* a
** b
*** h
** b
*** q
**** h
=
** c
*** d
=
Elisp:
(defun got= o-notes ()
=A0 (interactive)
=A0 (find-file "~/test.org")
=A0 (org-goto-subtree '("a" "b" "q" = "h"))
=A0 (org-show-context)
=A0 (org-show-en= try)
=A0 (show-children))

(defun org-got= o-subtree (path)
=A0 (let ((level 1))
=A0 =A0 (org-element-map
=A0 = =A0 =A0 =A0 (org-element-parse-buffer 'headline)
=A0 =A0 =A0 = =A0 'headline
=A0 =A0 =A0 =A0 (lambda (x)
=A0 =A0 = =A0 =A0 =A0 (if (< (org-element-property :level x) level)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 (setq level (org-element-property :level x= )))
=A0 =A0 =A0 =A0 =A0 (if (and (=3D level (org-element-property= :level x))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(string=3D (nt= h (- level 1) path) (org-element-property :raw-value x)))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 (progn (setq level (+ level 1))
= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(if (> level (list-length pat= h))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(goto-char= (org-element-property :begin x))))))
=A0 =A0 =A0 =A0 nil t)))

<= div>
My very first attempt at programming Elisp so any = feedback is appreciated.

Best regards
Alexander
--0021cc0229c6928d0604df85f0e9--