]> git.eshelyaron.com Git - emacs.git/commitdiff
(Info-find-node): Cope better if guesspos is too large.
authorRichard M. Stallman <rms@gnu.org>
Tue, 14 Sep 1999 06:44:55 +0000 (06:44 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 14 Sep 1999 06:44:55 +0000 (06:44 +0000)
lisp/info.el

index 4a7eea2bca1d0020f8d0c10b8ec4dd221559df93..94c71c2f841f067e10d95073eb02e58e22677dcf 100644 (file)
@@ -527,8 +527,13 @@ In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
                      (goto-char (setq anchorpos guesspos))
 
                     ;; Else we may have a node, which we search for:
-                   (goto-char (max (point-min)
-                                   (- (byte-to-position guesspos) 1000)))
+                   (let ((guesschar
+                          (or (byte-to-position guesspos)
+                              (if (< (position-bytes (point-max)) guesspos)
+                                  (point-max)
+                                (point-min)))))
+                     (goto-char (max (point-min)
+                                     (- guesschar 1000))))
                     ;; Now search from our advised position
                     ;; (or from beg of buffer)
                     ;; to find the actual node.