diff options
| author | Juanma Barranquero | 2003-02-10 11:41:09 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2003-02-10 11:41:09 +0000 |
| commit | d0b560c61fe2a7b4bfb4f761f6f83529b53d6a59 (patch) | |
| tree | 94af0080872838115de22214f9bad1ae437660f7 /lisp | |
| parent | 9e3561d20201278befd302b94d8301286919f1b6 (diff) | |
| download | emacs-d0b560c61fe2a7b4bfb4f761f6f83529b53d6a59.tar.gz emacs-d0b560c61fe2a7b4bfb4f761f6f83529b53d6a59.zip | |
(Info-follow-nearest-node): Implement new behavior.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/info.el | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lisp/info.el b/lisp/info.el index cf3b8e2ab78..5af0787d505 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -2113,12 +2113,22 @@ At end of the node's text, moves to the next node, or up if none." | |||
| 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 () |