From: Juri Linkov Date: Fri, 9 Sep 2011 15:49:00 +0000 (+0300) Subject: Add `wdired-isearch-filter-read-only' to lisp/wdired.el. X-Git-Tag: emacs-pretest-24.0.90~104^2~121 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5e68ce4ab9bb6cdc8dc7aa3bbac014c93297369a;p=emacs.git 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 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2cd03d9e898..7b0b4890724 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2011-09-09 Juri Linkov + + * 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. (Bug#6362) + 2011-09-09 Alan Mackenzie * 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'." (buffer-substring (point-min) (point-max))) (set (make-local-variable 'wdired-old-point) (point)) (set (make-local-variable 'query-replace-skip-read-only) t) + (set (make-local-variable 'isearch-filter-predicate) + 'wdired-isearch-filter-read-only) (use-local-map wdired-mode-map) (force-mode-line-update) (setq buffer-read-only nil) @@ -241,6 +243,11 @@ See `wdired-mode'." "Press \\[wdired-finish-edit] when finished \ or \\[wdired-abort-changes] to abort changes"))) +(defun wdired-isearch-filter-read-only (beg end) + "Skip matches that have a read-only property." + (and (isearch-filter-visible beg end) + (not (text-property-not-all (min beg end) (max beg end) + 'read-only nil)))) ;; Protect the buffer so only the filenames can be changed, and put ;; properties so filenames (old and new) can be easily found.