comparison lisp/info.el @ 34468:7ae9e37868e6

(Info-last-preorder): Don't barf on nodes without a prev. (Info-scroll-down): Respect `Info-scroll-prefer-subnodes'.
author Miles Bader <miles@gnu.org>
date Tue, 12 Dec 2000 07:14:36 +0000
parents 3f2ee9f3d8bf
children 00d3d092888c
comparison
equal deleted inserted replaced
34467:95887061f1e4 34468:7ae9e37868e6
1610 (Info-last-menu-item) 1610 (Info-last-menu-item)
1611 ;; If we go down a menu item, go to the end of the node 1611 ;; If we go down a menu item, go to the end of the node
1612 ;; so we can scroll back through it. 1612 ;; so we can scroll back through it.
1613 (goto-char (point-max)))) 1613 (goto-char (point-max))))
1614 (recenter -1)) 1614 (recenter -1))
1615 ((and (not (equal (Info-extract-pointer "up") 1615 ((and (Info-no-error (Info-extract-pointer "prev"))
1616 (not (equal (Info-extract-pointer "up")
1616 (Info-extract-pointer "prev")))) 1617 (Info-extract-pointer "prev"))))
1617 (Info-no-error (Info-prev)) 1618 (Info-no-error (Info-prev))
1618 (goto-char (point-max)) 1619 (goto-char (point-max))
1619 (while (Info-no-error 1620 (while (Info-no-error
1620 (Info-last-menu-item) 1621 (Info-last-menu-item)
1662 (t (Info-next-preorder))) 1663 (t (Info-next-preorder)))
1663 (scroll-up)))) 1664 (scroll-up))))
1664 1665
1665 (defun Info-scroll-down () 1666 (defun Info-scroll-down ()
1666 "Scroll one screenful back in Info, considering all nodes as one sequence. 1667 "Scroll one screenful back in Info, considering all nodes as one sequence.
1667 Within the menu of a node, this goes to its last subnode. 1668 If point is within the menu of a node, and `Info-scroll-prefer-subnodes'
1668 When you scroll past the beginning of a node, that goes to the 1669 is non-nil, this goes to its last subnode. When you scroll past the
1669 previous node or back up to the parent node." 1670 beginning of a node, that goes to the previous node or back up to the
1671 parent node."
1670 (interactive) 1672 (interactive)
1671 (if (or (< (window-start) (point-min)) 1673 (if (or (< (window-start) (point-min))
1672 (> (window-start) (point-max))) 1674 (> (window-start) (point-max)))
1673 (set-window-start (selected-window) (point))) 1675 (set-window-start (selected-window) (point)))
1674 (let* ((case-fold-search t) 1676 (let* ((case-fold-search t)
1675 (current-point (point)) 1677 (current-point (point))
1676 (virtual-end (save-excursion 1678 (virtual-end
1677 (beginning-of-line) 1679 (and Info-scroll-prefer-subnodes
1678 (setq current-point (point)) 1680 (save-excursion
1679 (goto-char (point-min)) 1681 (beginning-of-line)
1680 (search-forward "\n* Menu:" 1682 (setq current-point (point))
1681 current-point 1683 (goto-char (point-min))
1682 t)))) 1684 (search-forward "\n* Menu:"
1685 current-point
1686 t)))))
1683 (if (or virtual-end (pos-visible-in-window-p (point-min))) 1687 (if (or virtual-end (pos-visible-in-window-p (point-min)))
1684 (Info-last-preorder) 1688 (Info-last-preorder)
1685 (scroll-down)))) 1689 (scroll-down))))
1686 1690
1687 (defun Info-next-reference (&optional recur) 1691 (defun Info-next-reference (&optional recur)