diff -cw info-BZR-2010-04-05.el info-patched-2010-04-06.el
*** info-BZR-2010-04-05.el	Mon Apr  5 07:48:52 2010
--- info-patched-2010-04-06.el	Tue Apr  6 09:04:46 2010
***************
*** 240,245 ****
--- 240,248 ----
  0 means do not display breadcrumbs."
    :type 'integer)
  
+ (defvar Info-breadcrumbs-depth-internal Info-breadcrumbs-depth
+   "Current breadcrumbs depth for Info.")
+ 
  (defcustom Info-search-whitespace-regexp "\\s-+"
    "If non-nil, regular expression to match a sequence of whitespace chars.
  This applies to Info search for regular expressions.
***************
*** 1053,1061 ****
  	    (Info-select-node)
  	    (goto-char (point-min))
  	    (forward-line 1)		       ; skip header line
- 	    (when (> Info-breadcrumbs-depth 0) ; skip breadcrumbs line
- 	      (forward-line 1))
- 
  	    (cond (anchorpos
                     (let ((new-history (list Info-current-file
                                              (substring-no-properties nodename))))
--- 1056,1061 ----
***************
*** 1076,1082 ****
          (let ((hist (car Info-history)))
            (setq Info-history (cdr Info-history))
            (Info-find-node (nth 0 hist) (nth 1 hist) t)
!           (goto-char (nth 2 hist))))))
  
  ;; Cache the contents of the (virtual) dir file, once we have merged
  ;; it for the first time, so we can save time subsequently.
--- 1076,1083 ----
          (let ((hist (car Info-history)))
            (setq Info-history (cdr Info-history))
            (Info-find-node (nth 0 hist) (nth 1 hist) t)
!           (goto-char (nth 2 hist)))))
!   (if Info-breadcrumbs-mode (Info-insert-breadcrumbs) (Info-set-mode-line)))
  
  ;; Cache the contents of the (virtual) dir file, once we have merged
  ;; it for the first time, so we can save time subsequently.
***************
*** 3690,3695 ****
--- 3691,3698 ----
      :help "Go to final node in this file"]
     ("Menu Item" ["You should never see this" report-emacs-bug t])
     ("Reference" ["You should never see this" report-emacs-bug t])
+    ["Toggle Breadcrumbs" Info-breadcrumbs-mode
+     :help "Toggle showing breadcrumbs in the mode line"]
     ["Search..." Info-search
      :help "Search for regular expression in this Info file"]
     ["Search Next" Info-search-next
***************
*** 4196,4237 ****
    (let ((nodes (Info-toc-nodes Info-current-file))
  	(node Info-current-node)
          (crumbs ())
!         (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)
  			   ;; Some legacy code can still use a symbol.
! 			   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"))))
  
  (defun Info-fontify-node ()
    "Fontify the node."
--- 4199,4286 ----
    (let ((nodes   (Info-toc-nodes Info-current-file))
  	(node    Info-current-node)
          (crumbs  ())
!         (depth   Info-breadcrumbs-depth-internal)
!         (text    ""))
      ;; Get ancestors from the cached parent-children node info
      (while (and (not (equal "Top" node)) (> depth 0))
        (setq node  (nth 1 (assoc node nodes)))
!       (when node (push node crumbs))
        (setq depth  (1- depth)))
      ;; Add bottom node.
!     (setq crumbs  (nconc crumbs (list Info-current-node)))
!     (when crumbs
        ;; Add top node (and continuation if needed).
!       (setq crumbs  (cons "Top" (if (member (pop crumbs) '(nil "Top"))
!                                     crumbs
!                                   (cons nil crumbs))))
        (dolist (node  crumbs)
!         (let ((crumbs-map  (make-sparse-keymap))
!               (menu-map    (make-sparse-keymap "Breadcrumbs")))
!           (define-key crumbs-map [mode-line mouse-2] menu-map)
!           (when node
!             (define-key menu-map [Info-prev]
!               `(menu-item "Previous Node" Info-prev
!                           :visible ,(Info-check-pointer "prev[ious]*")
!                           :help "Go to the previous node"))
!             (define-key menu-map [Info-next]
!               `(menu-item "Next Node" Info-next
!                           :visible ,(Info-check-pointer "next")
!                           :help "Go to the next node"))
!             (define-key menu-map [separator] '("--"))
!             (define-key menu-map [Info-breadcrumbs-mode]
!               `(menu-item "Toggle Breadcrumbs" Info-breadcrumbs-mode
!                           :help "Toggle displaying breadcrumbs in the Info mode-line"
!                           :button (:toggle . Info-breadcrumbs-mode)))
!             (define-key menu-map [Info-set-breadcrumbs-depth]
!               `(menu-item "Set Breadcrumbs Depth" Info-set-breadcrumbs-depth
!                           :help "Set depth of breadcrumbs to show in the mode-line"))
!             (setq node  (if (equal node Info-current-node)
!                             (propertize (replace-regexp-in-string "%" "%%" Info-current-node)
!                                         'face 'mode-line-buffer-id
!                                         'help-echo "mouse-1: scroll forward, mouse-2: menu, mouse-3: scroll back"
!                                         'mouse-face 'mode-line-highlight
!                                         'local-map
!                                         (progn
!                                           (define-key crumbs-map [mode-line mouse-1] 'Info-mouse-scroll-up)
!                                           (define-key crumbs-map [mode-line mouse-3] 'Info-mouse-scroll-down)
!                                           crumbs-map))
!                           (propertize node
!                                       'local-map (progn
!                                                    (define-key crumbs-map [mode-line mouse-1]
!                                                      `(lambda () (interactive) (Info-goto-node ,node)))
!                                                    (define-key crumbs-map [mode-line mouse-3]
!                                                      `(lambda () (interactive) (Info-goto-node ,node)))
!                                                    crumbs-map)
!                                       'mouse-face 'mode-line-highlight
!                                       'help-echo "mouse-1, mouse-3: Go to this node; mouse-2: Menu")))))
! 	(let ((nodetext  (if (not (equal node "Top"))
!                              node
!                            (concat (format "(%s)"
                                             (if (stringp Info-current-file)
                                                 (file-name-nondirectory Info-current-file)
                                               ;; Some legacy code can still use a symbol.
!                                              Info-current-file))
!                                    node))))
!           (setq text  (concat text (if (equal node "Top") "" " > ") (if node nodetext "...")))))
!       (make-local-variable 'mode-line-format) ; Needed for Emacs 21+.
!       (setq mode-line-format  text))))
! 
! (define-minor-mode Info-breadcrumbs-mode
!     "Toggle the use of breadcrumbs in Info mode line.
! With arg, show breadcrumbs iff arg is positive."
!   :group 'mode-line :group 'info
!   (if (not Info-breadcrumbs-mode)
!       (setq Info-breadcrumbs-depth-internal  0
!             mode-line-format                 default-mode-line-format)
!     (setq Info-breadcrumbs-depth-internal  Info-breadcrumbs-depth)
!     (Info-insert-breadcrumbs)))
! 
! (defun Info-set-breadcrumbs-depth ()
!   "Set current breadcrumbs depth to a value read from user."
!   (interactive)
!   (setq Info-breadcrumbs-depth-internal  (read-number "New breadcrumbs depth: "
!                                                       Info-breadcrumbs-depth-internal))
!   (Info-insert-breadcrumbs))
  
  (defun Info-fontify-node ()
    "Fontify the node."
***************
*** 4278,4286 ****
  		((string-equal (downcase tag) "next") Info-next-link-keymap)
  		((string-equal (downcase tag) "up"  ) Info-up-link-keymap))))))
  
-         (when (> Info-breadcrumbs-depth 0)
-           (Info-insert-breadcrumbs))
- 
          ;; Treat header line.
          (when Info-use-header-line
            (goto-char (point-min))
--- 4327,4332 ----
***************
*** 4307,4321 ****
  				"%"
  				;; Preserve text properties on duplicated `%'.
  				(lambda (s) (concat s s)) header))
!             ;; Hide the part of the first line
!             ;; that is in the header, if it is just part.
!             (cond
!              ((> Info-breadcrumbs-depth 0)
!               (put-text-property (point-min) (1+ header-end) 'invisible t))
!              ((not (bobp))
                ;; Hide the punctuation at the end, too.
                (skip-chars-backward " \t,")
!               (put-text-property (point) header-end 'invisible t))))))
  
        ;; Fontify titles
        (goto-char (point-min))
--- 4353,4363 ----
  				"%"
  				;; Preserve text properties on duplicated `%'.
  				(lambda (s) (concat s s)) header))
!             ;; Hide the part of the first line that is in the header, if it is just part.
              ;; Hide the punctuation at the end, too.
+             (unless (bobp)
                (skip-chars-backward " \t,")
!               (put-text-property (point) header-end 'invisible t)))))
  
        ;; Fontify titles
        (goto-char (point-min))

Diff finished.  Tue Apr 06 09:10:17 2010
