(save-excursion
(goto-char (point-min))
(while (re-search-forward regexp nil t)
- (if (or (not predicate) (apply predicate args))
+ (if (or (not predicate) (save-excursion (goto-char (match-beginning 0))
+ (apply predicate args)))
(let ((line (count-lines (point-min) (point)))
(column (current-column))
(text (buffer-substring (save-excursion (beginning-of-line) (point))