1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-28 01:00:52 -07:00

(Info-get-token): Find tokens where START matches

This commit is contained in:
Richard M. Stallman 1996-12-08 07:37:55 +00:00
parent c0c0e4bd5d
commit 345d9d7376

View file

@ -1471,7 +1471,16 @@ SIG optional fourth argument, controls action on no match
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)