- ;; Optionally ignore matches that have a read-only property.
- (when (and (or (not query-replace-skip-read-only)
- (not (text-property-not-all
- (nth 0 real-match-data) (nth 1 real-match-data)
- 'read-only nil)))
- ;; Optionally filter out matches.
- (run-hook-with-args-until-failure
- 'isearch-filter-predicates
- (nth 0 real-match-data) (nth 1 real-match-data))
- ;; Optionally ignore invisible matches.
- (or (eq search-invisible t)
- (not (isearch-range-invisible
- (nth 0 real-match-data) (nth 1 real-match-data)))))
-
+ (cond
+ ;; Optionally ignore matches that have a read-only property.
+ ((not (or (not query-replace-skip-read-only)
+ (not (text-property-not-all
+ (nth 0 real-match-data) (nth 1 real-match-data)
+ 'read-only nil))))
+ (setq skip-read-only-count (1+ skip-read-only-count)))
+ ;; Optionally filter out matches.
+ ((not (funcall isearch-filter-predicate
+ (nth 0 real-match-data) (nth 1 real-match-data)))
+ (setq skip-filtered-count (1+ skip-filtered-count)))
+ ;; Optionally ignore invisible matches.
+ ((not (or (eq search-invisible t)
+ ;; Don't open overlays for automatic replacements.
+ (and (not query-flag) search-invisible)
+ ;; Open hidden overlays for interactive replacements.
+ (not (isearch-range-invisible
+ (nth 0 real-match-data) (nth 1 real-match-data)))))
+ (setq skip-invisible-count (1+ skip-invisible-count)))
+ (t