diff options
| author | Juri Linkov | 2011-09-09 18:49:00 +0300 |
|---|---|---|
| committer | Juri Linkov | 2011-09-09 18:49:00 +0300 |
| commit | 5e68ce4ab9bb6cdc8dc7aa3bbac014c93297369a (patch) | |
| tree | 23953c3cb17f1f31acb0b1ae20cfc8e3a7db2017 | |
| parent | 0861eb2e39d33c25cf8829af0e6a61557a7b8544 (diff) | |
| download | emacs-5e68ce4ab9bb6cdc8dc7aa3bbac014c93297369a.tar.gz emacs-5e68ce4ab9bb6cdc8dc7aa3bbac014c93297369a.zip | |
Add `wdired-isearch-filter-read-only' to lisp/wdired.el.
* lisp/wdired.el (wdired-change-to-wdired-mode): Set buffer-local
`isearch-filter-predicate' to `wdired-isearch-filter-read-only'.
(wdired-isearch-filter-read-only): New function.
Fixes: debbugs:6362
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/wdired.el | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2cd03d9e898..7b0b4890724 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-09-09 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * wdired.el (wdired-change-to-wdired-mode): Set buffer-local | ||
| 4 | `isearch-filter-predicate' to `wdired-isearch-filter-read-only'. | ||
| 5 | (wdired-isearch-filter-read-only): New function. (Bug#6362) | ||
| 6 | |||
| 1 | 2011-09-09 Alan Mackenzie <acm@muc.de> | 7 | 2011-09-09 Alan Mackenzie <acm@muc.de> |
| 2 | 8 | ||
| 3 | * progmodes/cc-mode.el (awk-mode): Prevent `define-derived-mode' | 9 | * progmodes/cc-mode.el (awk-mode): Prevent `define-derived-mode' |
diff --git a/lisp/wdired.el b/lisp/wdired.el index f71979e2727..cc99bd40628 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el | |||
| @@ -216,6 +216,8 @@ See `wdired-mode'." | |||
| 216 | (buffer-substring (point-min) (point-max))) | 216 | (buffer-substring (point-min) (point-max))) |
| 217 | (set (make-local-variable 'wdired-old-point) (point)) | 217 | (set (make-local-variable 'wdired-old-point) (point)) |
| 218 | (set (make-local-variable 'query-replace-skip-read-only) t) | 218 | (set (make-local-variable 'query-replace-skip-read-only) t) |
| 219 | (set (make-local-variable 'isearch-filter-predicate) | ||
| 220 | 'wdired-isearch-filter-read-only) | ||
| 219 | (use-local-map wdired-mode-map) | 221 | (use-local-map wdired-mode-map) |
| 220 | (force-mode-line-update) | 222 | (force-mode-line-update) |
| 221 | (setq buffer-read-only nil) | 223 | (setq buffer-read-only nil) |
| @@ -241,6 +243,11 @@ See `wdired-mode'." | |||
| 241 | "Press \\[wdired-finish-edit] when finished \ | 243 | "Press \\[wdired-finish-edit] when finished \ |
| 242 | or \\[wdired-abort-changes] to abort changes"))) | 244 | or \\[wdired-abort-changes] to abort changes"))) |
| 243 | 245 | ||
| 246 | (defun wdired-isearch-filter-read-only (beg end) | ||
| 247 | "Skip matches that have a read-only property." | ||
| 248 | (and (isearch-filter-visible beg end) | ||
| 249 | (not (text-property-not-all (min beg end) (max beg end) | ||
| 250 | 'read-only nil)))) | ||
| 244 | 251 | ||
| 245 | ;; Protect the buffer so only the filenames can be changed, and put | 252 | ;; Protect the buffer so only the filenames can be changed, and put |
| 246 | ;; properties so filenames (old and new) can be easily found. | 253 | ;; properties so filenames (old and new) can be easily found. |