changeset 16638:ee85ec2c4203

(Info-get-token): Find tokens where START matches
author Richard M. Stallman <rms@gnu.org>
date Sun, 08 Dec 1996 07:37:55 +0000
parents 960c425726cb
children b6ba5d371c1c
files lisp/info.el
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/info.el	Sat Dec 07 22:47:59 1996 +0000
+++ b/lisp/info.el	Sun Dec 08 07:37:55 1996 +0000
@@ -1471,7 +1471,16 @@
     a string: signal an error, using that string."
   (save-excursion
     (goto-char pos)
-    (re-search-backward start (max (point-min) (- pos 200)) 'yes)
+    ;; First look for a match for START that goes across POS.
+    (while (and (not (bobp)) (> (point) (- pos (length start)))
+		(not (looking-at start)))
+      (forward-char -1))
+    ;; If we did not find one, search back for START
+    ;; (this finds only matches that end at or before POS).
+    (or (looking-at start)
+	(progn
+	  (goto-char pos)
+	  (re-search-backward start (max (point-min) (- pos 200)) 'yes)))
     (let (found)
       (while (and (re-search-forward all (min (point-max) (+ pos 200)) 'yes)
 		  (not (setq found (and (<= (match-beginning 0) pos)