# HG changeset patch # User Richard M. Stallman # Date 738870974 0 # Node ID 1795290d0fc8c35b68eafc7bbb10451f35102fdf # Parent c9689f8d057497f19845e10f8eba0c3a07e8d91a (Info-get-token): Check that thesecond search succeeded. diff -r c9689f8d0574 -r 1795290d0fc8 lisp/info.el --- a/lisp/info.el Mon May 31 17:28:56 1993 +0000 +++ b/lisp/info.el Mon May 31 17:56:14 1993 +0000 @@ -1052,19 +1052,20 @@ (save-excursion (goto-char pos) (re-search-backward start (max (point-min) (- pos 200)) 'yes) - (while (and (re-search-forward all (min (point-max) (+ pos 200)) 'yes) - (not (and (<= (match-beginning 0) pos) - (> (match-end 0) pos))))) - (if (and (<= (match-beginning 0) pos) - (> (match-end 0) pos)) - (buffer-substring (match-beginning 1) (match-end 1)) - (cond ((null errorstring) - nil) - ((eq errorstring t) - (beep) - nil) - (t - (error "No %s around position %d" errorstring pos)))))) + (let (found) + (while (and (re-search-forward all (min (point-max) (+ pos 200)) 'yes) + (not (setq found (and (<= (match-beginning 0) pos) + (> (match-end 0) pos)))))) + (if (and found (<= (match-beginning 0) pos) + (> (match-end 0) pos)) + (buffer-substring (match-beginning 1) (match-end 1)) + (cond ((null errorstring) + nil) + ((eq errorstring t) + (beep) + nil) + (t + (error "No %s around position %d" errorstring pos))))))) (defun Info-follow-nearest-node (click) "\\Follow a node reference near point.