unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: 6362@debbugs.gnu.org
Subject: bug#6362: Emacs command `dired-isearch-filenames-regexp' cause CPU usage 100%
Date: Mon, 07 Jun 2010 21:09:42 +0300	[thread overview]
Message-ID: <87aar782nt.fsf@mail.jurta.org> (raw)
In-Reply-To: <87d3w4lc3r.fsf@mail.jurta.org> (Juri Linkov's message of "Sun, 06 Jun 2010 12:54:55 +0300")

> 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/





  parent reply	other threads:[~2010-06-07 18:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-06  3:36 bug#6362: Emacs command `dired-isearch-filenames-regexp' cause CPU usage 100% Li Zhai
2010-06-06  9:54 ` Juri Linkov
2010-06-06 12:30   ` Li Zhai
2010-06-07 18:05     ` Juri Linkov
2010-06-07 18:09   ` Juri Linkov [this message]
2011-09-09 15:49     ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87aar782nt.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=6362@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).