emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Go to heading using LISP


From: Myles English
Subject: Re: [O] Go to heading using LISP
Date: Mon, 10 Jun 2013 20:00:54 +0100
User-agent: mu4e 0.9.9.5-dev6; emacs 24.3.1

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



reply via email to

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