diff options
| author | Richard M. Stallman | 1996-12-08 07:37:55 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-12-08 07:37:55 +0000 |
| commit | 345d9d7376c5f09febec087e3e60fadedb284b71 (patch) | |
| tree | 3980c212715531727bf37ad7331fa32c0fd3744f | |
| parent | c0c0e4bd5d67ccc753e9d03ae9cbd03e29ade78f (diff) | |
| download | emacs-345d9d7376c5f09febec087e3e60fadedb284b71.tar.gz emacs-345d9d7376c5f09febec087e3e60fadedb284b71.zip | |
(Info-get-token): Find tokens where START matches
| -rw-r--r-- | lisp/info.el | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/info.el b/lisp/info.el index c3df1a843be..ba24cec25d3 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -1471,7 +1471,16 @@ SIG optional fourth argument, controls action on no match | |||
| 1471 | a string: signal an error, using that string." | 1471 | a string: signal an error, using that string." |
| 1472 | (save-excursion | 1472 | (save-excursion |
| 1473 | (goto-char pos) | 1473 | (goto-char pos) |
| 1474 | (re-search-backward start (max (point-min) (- pos 200)) 'yes) | 1474 | ;; First look for a match for START that goes across POS. |
| 1475 | (while (and (not (bobp)) (> (point) (- pos (length start))) | ||
| 1476 | (not (looking-at start))) | ||
| 1477 | (forward-char -1)) | ||
| 1478 | ;; If we did not find one, search back for START | ||
| 1479 | ;; (this finds only matches that end at or before POS). | ||
| 1480 | (or (looking-at start) | ||
| 1481 | (progn | ||
| 1482 | (goto-char pos) | ||
| 1483 | (re-search-backward start (max (point-min) (- pos 200)) 'yes))) | ||
| 1475 | (let (found) | 1484 | (let (found) |
| 1476 | (while (and (re-search-forward all (min (point-max) (+ pos 200)) 'yes) | 1485 | (while (and (re-search-forward all (min (point-max) (+ pos 200)) 'yes) |
| 1477 | (not (setq found (and (<= (match-beginning 0) pos) | 1486 | (not (setq found (and (<= (match-beginning 0) pos) |