0

I have a simple code that displays the outline path of hierarchical headings in an org file.

(defun org-show-position-in-text () ;; display outline path of hierarchical headings
  (interactive)
  (kill-new (message (mapconcat #'identity (org-get-outline-path t) "·"))))

Wonder if it is possible to hack Occur so that the above outline path is shown before the matching line instead of the usual line number?

Eg. tweak this:

x matches in y lines for "<string>" in buffer: <filename>.org
     35: some matching text...

into this:

x matches in y lines for "<string>" in buffer: <filename>.org
     <book>·<chapter>: some matching text...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.