[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: org-custom-id-goto?
From: |
John Kitchin |
Subject: |
Re: org-custom-id-goto? |
Date: |
Wed, 04 Dec 2019 20:36:42 -0500 |
User-agent: |
mu4e 1.3.4; emacs 26.1 |
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 <address@hidden> 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