Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip read-only text #27

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

skip read-only text #27

jixiuf opened this issue Nov 25, 2012 · 1 comment

Comments

@jixiuf
Copy link

jixiuf commented Nov 25, 2012

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
Copy link
Author

jixiuf commented Nov 25, 2012

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

@jixiuf jixiuf closed this as completed Nov 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant