Hi Ken,

On 12-Sep-24, at 5:36 PM, Ken Williams wrote:

Has anyone ever tried implementing a “breadcrumbs”-type feature in org-mode?  By that I mean something that would quickly tell you the headings up the whole path to the root, to quickly orient yourself when you’re deep within a document.  I was originally thinking of something always-present shown at the top of the frame, but maybe it would be better as something shown on demand in the minibuffer, possibly making it taller while shown.

You can bind this to a speed command. It will show you the path to the current headline (less the first heading) in the echo area, and will also copy it to the kill ring. This is the functionality I need, but it would be easy to modify to do what you want.

(defun org-copy-outline-path-less-root-to-kill-ring (&optional a b)
  "Copy the current outline path, less the first node, to the
kill ring, and echo to the echo area."
  (interactive "P")
  (let* ((bfn (buffer-file-name (buffer-base-buffer)))
     (case-fold-search nil)
         (path (rest (org-get-outline-path))))
    (setq path (append path
                       (save-excursion
                         (org-back-to-heading t)
                         (if (looking-at org-complex-heading-regexp)
                             (list (match-string 4))))))
    (let ((formatted-path (org-format-outline-path
                           path
                           (1- (frame-width)))))
      (kill-new formatted-path)
      (message "%s" formatted-path))))

Hope this helps,

 -Anthony