From: John Kitchin <jkitchin@andrew.cmu.edu>
To: emacs-orgmode@gnu.org
Subject: Re: org-custom-id-goto?
Date: Wed, 04 Dec 2019 20:36:42 -0500 [thread overview]
Message-ID: <m2immveeol.fsf@andrew.cmu.edu> (raw)
In-Reply-To: <87r21kumas.fsf@ucl.ac.uk>
If you like ivy, you might find this helpful:
(defun ivy-org-jump-to-heading ()
"Jump to heading in the current buffer."
(interactive)
(let ((headlines '()))
(save-excursion
(goto-char (point-min))
(while (re-search-forward
;; this matches org headings in elisp too.
"^\\(;; \\)?\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ ]*$" nil t)
(cl-pushnew (list
(format "%-80s"
(match-string 0))
(cons 'position (match-beginning 0)))
headlines)))
(ivy-read "Headline: "
(reverse headlines)
:action (lambda (candidate)
(org-mark-ring-push)
(goto-char (cdr (assoc 'position candidate)))
(outline-show-entry)))))
https://github.com/jkitchin/scimax/blob/master/scimax-org.el#L587
There are also helm equivalents.
Fraga, Eric <e.fraga@ucl.ac.uk> writes:
> On Wednesday, 4 Dec 2019 at 10:26, Matt Price wrote:
>> Is there a quasi-equivalent of ~org-id-goto~ or
>> ~org-babel-goto-named-src-block~ which will jump to a header in the
>> current buffer?
>
> If by header you mean headline or heading, I don't think there is
> anything exactly how you might want it but you should maybe look at
> "org-goto" and "org-occur" (or both in combination).
--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu
next prev parent reply other threads:[~2019-12-05 1:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-04 15:26 org-custom-id-goto? Matt Price
2019-12-04 15:45 ` org-custom-id-goto? Fraga, Eric
2019-12-05 1:36 ` John Kitchin [this message]
2019-12-06 16:32 ` org-custom-id-goto? Haider Rizvi
2019-12-05 1:50 ` org-custom-id-goto? Thibault Marin
2019-12-05 20:27 ` org-custom-id-goto? Samuel Wales
2019-12-05 20:32 ` org-custom-id-goto? Samuel Wales
2019-12-06 1:26 ` org-custom-id-goto? Adam Porter
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=m2immveeol.fsf@andrew.cmu.edu \
--to=jkitchin@andrew.cmu.edu \
--cc=emacs-orgmode@gnu.org \
/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).