From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Ufimtsev Subject: Re: Function that jumps to an entry with a certain CUSTOM_ID Date: Mon, 6 Apr 2015 14:16:49 -0400 (EDT) Message-ID: <1318130309.8160498.1428344209549.JavaMail.zimbra@redhat.com> References: <551ACD1D.6020501@gmail.com> 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]:38167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfBZv-0000gE-Sb for emacs-orgmode@gnu.org; Mon, 06 Apr 2015 14:16:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YfBZs-00006c-Ln for emacs-orgmode@gnu.org; Mon, 06 Apr 2015 14:16:55 -0400 Received: from mx3-phx2.redhat.com ([209.132.183.24]:37758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YfBZs-00005n-ED for emacs-orgmode@gnu.org; Mon, 06 Apr 2015 14:16:52 -0400 In-Reply-To: <551ACD1D.6020501@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: Christoph LANGE Cc: emacs-orgmode@gnu.org +1 * Non-technical feedback :: - Thank you so much for sharing. I've been looking for something like this= for a while. - I hope it'll make it into org-mode some way or another, it seems like a = valuable addition.=20 - imho the HELM integration is essential. Leo Ufimtsev | Software Engineer @ Eclipse Team ----- Original Message ----- From: "Christoph LANGE" To: emacs-orgmode@gnu.org Sent: Tuesday, March 31, 2015 12:36:45 PM Subject: [O] Function that jumps to an entry with a certain CUSTOM_ID Hi all, the following function has served me well for a few years, so I thought=20 I'd share it. I would even be happy to contribute it to the codebase of=20 org-mode (core or contrib); however in this case someone would have to=20 point me to a fool-proof guide for how to do this. I know that for=20 contributing code I will have to sign some FSF copyright forms, and I=20 know how to use git, but I don't know the exact org-mode specific steps=20 of doing so. --- %< --- %< --- %< --- %< --- %< --- %< --- %< --- %< --- %< --- %< --- (defun org-jump-to-id () "Asks for an identifier and searches for the first entry in the=20 current file that has this identifier as a CUSTOM_ID property." (interactive) (let* ((property "CUSTOM_ID") (custom-id (org-icompleting-read "CUSTOM_ID of entry: " (mapcar 'list=20 (org-property-values property))))) (org-link-search (concat "#" custom-id)))) (define-key org-mode-map (kbd "\C-cj") 'org-jump-to-id) --- %< --- %< --- %< --- %< --- %< --- %< --- %< --- %< --- %< --- %< --- This implementation works efficiently in a 4 MB org file with 100 IDs.=20 Together with ido or helm I find it a very user-friendly way of jumping=20 to frequently used headlines. I noticed that org-babel-ref-goto-headline-id does something similar, so=20 maybe some code could be shared among the two functions. Cheers, Christoph --=20 Dr. Christoph Lange, Enterprise Information Systems Department Applied Computer Science @ University of Bonn; Fraunhofer IAIS http://langec.wordpress.com/about, Skype duke4701 =E2=86=92 Semantic Publishing Challenge: Assessing the Quality of Scientifi= c Output ESWC, 31 May=E2=80=934 June 2014, Portoro=C5=BE, Slovenia.=20 https://tinyurl.com/SPChallenge15 Submission deadline 27 March (abstracts: 20 March)