emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Alexander Wingård" <alexander.wingard@gmail.com>
To: Myles English <mylesenglish@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Go to heading using LISP
Date: Mon, 10 Jun 2013 23:14:19 +0200	[thread overview]
Message-ID: <83D22E2E-B091-4BA7-8311-56F2DA9D57C4@gmail.com> (raw)
In-Reply-To: <87wqq1oknt.fsf@gmail.com>


On 10 jun 2013, at 21:00, Myles English <mylesenglish@gmail.com> wrote:

> 
> 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
> 

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

  reply	other threads:[~2013-06-10 21:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-08 13:52 Go to heading using LISP Alexander Wingård
2013-06-09  1:36 ` Eric Abrahamsen
2013-06-09 14:43   ` Alexander Wingård
2013-06-10  4:26     ` Eric Abrahamsen
2013-06-10  5:53       ` Jambunathan K
2013-06-10 19:00 ` Myles English
2013-06-10 21:14   ` Alexander Wingård [this message]
2013-06-19 18:24     ` Alexander Wingård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83D22E2E-B091-4BA7-8311-56F2DA9D57C4@gmail.com \
    --to=alexander.wingard@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mylesenglish@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).