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