- (depth Info-breadcrumbs-depth)
- (Info-fontify-maximum-menu-size nil)) ; Prevent infinite recursion.
- (unwind-protect
- (while (and (not (equal "Top" Info-current-node)) (> depth 0))
- (let ((up (Info-extract-pointer "up")))
- (if (string-match "\\`(.*)" up)
- ;; Crossing over to another manual. This is typically (dir).
- (setq depth 0)
- (push up crumbs)
- (setq depth (1- depth))
- (Info-find-node Info-current-file up 'no-going-back))))
- (if crumbs ;Do bother going back if we haven't moved.
- (Info-find-node Info-current-file onode 'no-going-back))
- ;; Add bottom node.
- (when Info-use-header-line
- ;; Let it disappear if crumbs is nil.
- (nconc crumbs (list Info-current-node)))
- (when (or Info-use-header-line crumbs)
- ;; Add top node (and continuation if needed).
- (setq crumbs
- (cons "Top" (if (member (pop crumbs) '(nil "Top"))
- crumbs (cons nil crumbs))))
- ;; Eliminate duplicate.
- (forward-line 1)
- (dolist (node crumbs)
- (let ((text
- (if (not (equal node "Top")) node
- (format "(%s)Top"
- (if (stringp Info-current-file)
- (file-name-nondirectory Info-current-file)
- ;; Can be `toc', `apropos', or even `history'.
- Info-current-file)))))
- (insert (if (bolp) "> " " > ")
- (cond
- ((null node) "...")
- ((equal node Info-current-node)
- ;; No point linking to ourselves.
- (propertize text 'font-lock-face 'info-header-node))
- (t
- (concat "*Note " text "::"))))))
- (insert "\n")))))
+ (depth Info-breadcrumbs-depth))
+
+ ;; Get ancestors from the cached parent-children node info
+ (while (and (not (equal "Top" node)) (> depth 0))
+ (setq node (nth 1 (assoc node nodes)))
+ (if node (push node crumbs))
+ (setq depth (1- depth)))
+
+ ;; Add bottom node.
+ (when Info-use-header-line
+ ;; Let it disappear if crumbs is nil.
+ (nconc crumbs (list Info-current-node)))
+ (when (or Info-use-header-line crumbs)
+ ;; Add top node (and continuation if needed).
+ (setq crumbs
+ (cons "Top" (if (member (pop crumbs) '(nil "Top"))
+ crumbs (cons nil crumbs))))
+ ;; Eliminate duplicate.
+ (forward-line 1)
+ (dolist (node crumbs)
+ (let ((text
+ (if (not (equal node "Top")) node
+ (format "(%s)Top"
+ (if (stringp Info-current-file)
+ (file-name-nondirectory Info-current-file)
+ ;; Can be `toc', `apropos', or even `history'.
+ Info-current-file)))))
+ (insert (if (bolp) "" " > ")
+ (cond
+ ((null node) "...")
+ ((equal node Info-current-node)
+ ;; No point linking to ourselves.
+ (propertize text 'font-lock-face 'info-header-node))
+ (t
+ (concat "*Note " text "::"))))))
+ (insert "\n"))))