Mercurial > emacs
comparison lisp/info.el @ 49678:0ae2b48491f7
(Info-follow-nearest-node): Implement new behavior.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Mon, 10 Feb 2003 11:41:09 +0000 |
parents | 692aaddf484f |
children | c0ebd202a62f d7ddb3e565de |
comparison
equal
deleted
inserted
replaced
49677:5c2d8e3b81b4 | 49678:0ae2b48491f7 |
---|---|
2111 (and (not (Info-try-follow-nearest-node)) | 2111 (and (not (Info-try-follow-nearest-node)) |
2112 (save-excursion (forward-line 1) (eobp)) | 2112 (save-excursion (forward-line 1) (eobp)) |
2113 (Info-next-preorder))) | 2113 (Info-next-preorder))) |
2114 | 2114 |
2115 (defun Info-follow-nearest-node () | 2115 (defun Info-follow-nearest-node () |
2116 "\\<Info-mode-map>Follow a node reference near point. | 2116 "Follow a node reference near point. |
2117 Like \\[Info-menu], \\[Info-follow-reference], \\[Info-next], \\[Info-prev] or \\[Info-up] command, depending on where point is. | 2117 If point is on a reference, follow that reference. Otherwise, |
2118 If no reference to follow, moves to the next node, or up if none." | 2118 if point is in a menu item description, follow that menu item." |
2119 (interactive) | 2119 (interactive) |
2120 (or (Info-try-follow-nearest-node) | 2120 (or (Info-try-follow-nearest-node) |
2121 (Info-next-preorder))) | 2121 (when (save-excursion |
2122 (search-backward "\n* menu:" nil t)) | |
2123 (save-excursion | |
2124 (beginning-of-line) | |
2125 (while (not (or (bobp) (looking-at "[^ \t]\\|[ \t]*$"))) | |
2126 (beginning-of-line 0)) | |
2127 (when (looking-at "\\* +\\([^\t\n]*\\):") | |
2128 (Info-goto-node | |
2129 (Info-extract-menu-item (match-string-no-properties 1))) | |
2130 t))) | |
2131 (error "Point neither on reference nor in menu item description"))) | |
2122 | 2132 |
2123 ;; Common subroutine. | 2133 ;; Common subroutine. |
2124 (defun Info-try-follow-nearest-node () | 2134 (defun Info-try-follow-nearest-node () |
2125 "Follow a node reference near point. Return non-nil if successful." | 2135 "Follow a node reference near point. Return non-nil if successful." |
2126 (let (node) | 2136 (let (node) |