From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#6362: Emacs command `dired-isearch-filenames-regexp' cause CPU usage 100% Date: Mon, 07 Jun 2010 21:09:42 +0300 Organization: JURTA Message-ID: <87aar782nt.fsf@mail.jurta.org> References: <87d3w4lc3r.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1275937109 8160 80.91.229.12 (7 Jun 2010 18:58:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 Jun 2010 18:58:29 +0000 (UTC) To: 6362@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 07 20:58:27 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OLhWg-0000Hn-M7 for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Jun 2010 20:58:22 +0200 Original-Received: from localhost ([127.0.0.1]:52971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLhWg-0001XL-5s for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 Jun 2010 14:58:22 -0400 Original-Received: from [140.186.70.92] (port=42061 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLhWV-0001UN-HV for bug-gnu-emacs@gnu.org; Mon, 07 Jun 2010 14:58:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OLhWP-0004JL-Nt for bug-gnu-emacs@gnu.org; Mon, 07 Jun 2010 14:58:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44639) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLhWP-0004JH-MY for bug-gnu-emacs@gnu.org; Mon, 07 Jun 2010 14:58:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OLhRW-0001yv-L9; Mon, 07 Jun 2010 14:53:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Jun 2010 18:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6362 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6362-submit@debbugs.gnu.org id=B6362.12759367347595 (code B ref 6362); Mon, 07 Jun 2010 18:53:02 +0000 Original-Received: (at 6362) by debbugs.gnu.org; 7 Jun 2010 18:52:14 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLhQj-0001yO-RZ for submit@debbugs.gnu.org; Mon, 07 Jun 2010 14:52:14 -0400 Original-Received: from smtp-out1.starman.ee ([85.253.0.3] helo=mx1.starman.ee) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLhQi-0001y8-6r for 6362@debbugs.gnu.org; Mon, 07 Jun 2010 14:52:12 -0400 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Original-Received: from mail.starman.ee (82.131.35.211.cable.starman.ee [82.131.35.211]) by mx1.starman.ee (Postfix) with ESMTP id 507C93F418D for <6362@debbugs.gnu.org>; Mon, 7 Jun 2010 21:52:04 +0300 (EEST) In-Reply-To: <87d3w4lc3r.fsf@mail.jurta.org> (Juri Linkov's message of "Sun, 06 Jun 2010 12:54:55 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 07 Jun 2010 14:53:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:37584 Archived-At: > You can observe the same problem with query-replace in wdired. > For instance, type: > > 1. M-x wdired-change-to-wdired-mode RET > 2. M-x query-replace-regexp RET ^f RET replacement RET BTW, there is another bug in query-replace lazy-highlighting in dired. Wdired sets `query-replace-skip-read-only' to replace only in file names, but during replacement all read-only matches are lazy-highlighted too. This can be fixed with this patch: === modified file 'lisp/wdired.el' --- lisp/wdired.el 2010-01-13 08:35:10 +0000 +++ lisp/wdired.el 2010-06-06 18:09:04 +0000 @@ -243,6 +243,8 @@ (defun wdired-change-to-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) @@ -268,6 +270,11 @@ (defun wdired-change-to-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. -- Juri Linkov http://www.jurta.org/emacs/