skip read-only text #27

Closed
jixiuf opened this Issue Nov 25, 2012 · 1 comment

1 participant

@jixiuf
diff --git a/iedit-lib.el b/iedit-lib.el
index 636c0bb..a7d92b0 100644
--- a/iedit-lib.el
+++ b/iedit-lib.el
@@ -194,9 +194,10 @@ Return the number of occurrences."
     (save-excursion
       (goto-char beg)
       (while (re-search-forward occurrence-regexp end t)
-        (push (iedit-make-occurrence-overlay (match-beginning 0) (match-end 0))
-              iedit-occurrences-overlays)
-        (setq counter (1+ counter)))
+        (unless (text-property-not-all (match-beginning 0) (match-end 0) 'read-only nil)
+          (push (iedit-make-occurrence-overlay (match-beginning 0) (match-end 0))
+                iedit-occurrences-overlays)
+          (setq counter (1+ counter))))
       (message "%d matches for \"%s\"" counter (iedit-printable occurrence-regexp))
       (when (/= 0 counter)
         (setq iedit-occurrences-overlays (nreverse iedit-occurrences-overlays))

you can check out
(wdired-isearch-filter-read-only) in wdired.el or
query-replace-skip-read-only in replace.el

@jixiuf

I open another pull request with code attached , so I close this one .

@jixiuf jixiuf closed this Nov 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment