changeset 25701:b6b86ee38391

(Info-find-node): Cope better if guesspos is too large.
author Richard M. Stallman <rms@gnu.org>
date Tue, 14 Sep 1999 06:44:55 +0000
parents fed6ebbe8644
children 2b96c6e05f23
files lisp/info.el
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/info.el	Tue Sep 14 01:50:00 1999 +0000
+++ b/lisp/info.el	Tue Sep 14 06:44:55 1999 +0000
@@ -527,8 +527,13 @@
 		      (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.