From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 05 23:36:09 2010 Received: (at submit) by debbugs.gnu.org; 6 Jun 2010 03:36:09 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OL6ed-0000Zr-65 for submit@debbugs.gnu.org; Sat, 05 Jun 2010 23:36:09 -0400 Received: from mail-px0-f172.google.com ([209.85.212.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OL6ea-0000ZV-No for submit@debbugs.gnu.org; Sat, 05 Jun 2010 23:36:05 -0400 Received: by pxi19 with SMTP id 19so770322pxi.3 for ; Sat, 05 Jun 2010 20:36:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=8w9EoHqZVVJPvYg+JNX30tfS4z0yu/FycXdQnJatJKw=; b=ZBgFfxni4keKLpcMtMdj89j4vgK2UiWfZV9aCt+sVCUd69BN6CsuT2AhKkenN5rBmK WWquCnE7jPPRyHHfM/y3E80bpOLq59w8aRktstl4SQWTYA3skeTngyC69Wn7edYGS1BL AmEgR2zfNDZca0kDltvh4upNwDFyanec15l0I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=f5VvvQFL11eLoW1/ZuRiRJg/5jQNnt4/rD6cH56xwiBfprE9hOYKRcTqcy7o49pRNd BWCf/bFKET6/AwoHCHdzYia2j72fBjxHclDvncV/gvBm58Th5JqZyZ96AaN9iTe2LseP rZe0fN4x8HHkwMRy1wIzc8ozuKsAZqCQG/EOY= MIME-Version: 1.0 Received: by 10.142.67.33 with SMTP id p33mr9556829wfa.231.1275795360677; Sat, 05 Jun 2010 20:36:00 -0700 (PDT) Received: by 10.142.242.4 with HTTP; Sat, 5 Jun 2010 20:36:00 -0700 (PDT) Date: Sun, 6 Jun 2010 11:36:00 +0800 Message-ID: Subject: Emacs command `dired-isearch-filenames-regexp' cause CPU usage 100% From: Li Zhai To: "bug.gnu.submit" Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.7 (-) Package: Emacs Version: 23.2.1 I use the command `dired-isearch-filenames-regexp' to find some files in a directory. I use the the anchor `^' to match the files start with something. Emacs is suspended and the CPU usage is 100%.Here is a transcript: 1. Open a directory in dired mode. 2. Input `M-x dired-isearch-filenames-regexp RET ^ f RET' Emacs will suspend rather than match the file names start with `f'. I'm using Windows XP, Emacs version 23.2. Bye, Li Zhai From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 06 05:56:54 2010 Received: (at 6362) by debbugs.gnu.org; 6 Jun 2010 09:56:54 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLCb8-0002zb-A4 for submit@debbugs.gnu.org; Sun, 06 Jun 2010 05:56:54 -0400 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 1OLCb5-0002zU-J6 for 6362@debbugs.gnu.org; Sun, 06 Jun 2010 05:56:52 -0400 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Received: from mail.starman.ee (62.65.210.141.cable.starman.ee [62.65.210.141]) by mx1.starman.ee (Postfix) with ESMTP id C01A33F41E7; Sun, 6 Jun 2010 12:56:45 +0300 (EEST) From: Juri Linkov To: Li Zhai Subject: Re: bug#6362: Emacs command `dired-isearch-filenames-regexp' cause CPU usage 100% Organization: JURTA References: Date: Sun, 06 Jun 2010 12:54:55 +0300 In-Reply-To: (Li Zhai's message of "Sun, 6 Jun 2010 11:36:00 +0800") Message-ID: <87d3w4lc3r.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: 6362 Cc: 6362@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.8 (---) > I use the command `dired-isearch-filenames-regexp' to find some files > in a directory. I use the the anchor `^' to match the files start with > something. Emacs is suspended and the CPU usage is 100%.Here is a > transcript: > > 1. Open a directory in dired mode. > 2. Input `M-x dired-isearch-filenames-regexp RET ^ f RET' > > Emacs will suspend rather than match the file names start with `f'. Thanks for the report. I fixed looping in lazy-highlighting. Now the loop in `isearch-lazy-highlight-search' is exactly like in `isearch-search' that checks for the empty match (and `isearch-lazy-highlight-update' takes care about forwarding point to the next character in this case). As for implementing matching at the beginning of file names with `^', it seems this is not possible to do. `re-search-forward' matches only at the beginning of a line, not in the middle of a line. 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 Do you expect that query-replace will rename file names that start with `f'? -- Juri Linkov http://www.jurta.org/emacs/ From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 06 08:30:50 2010 Received: (at 6362) by debbugs.gnu.org; 6 Jun 2010 12:30:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLF05-0004hc-Sr for submit@debbugs.gnu.org; Sun, 06 Jun 2010 08:30:50 -0400 Received: from mail-px0-f172.google.com ([209.85.212.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLF03-0004hW-W1 for 6362@debbugs.gnu.org; Sun, 06 Jun 2010 08:30:48 -0400 Received: by pxi19 with SMTP id 19so844280pxi.3 for <6362@debbugs.gnu.org>; Sun, 06 Jun 2010 05:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=8HhChtOAStkuWndLBfJT8NfaVcnU93QuB74x0R1pqgQ=; b=XkfjAMmbGUZbf1nzq2v3lytxj3hm8E0MHBIidFTAuJdImyqwoMQrOPZCTfV7sC7Q2q 4Ka9X9a70Dy33K9fZFjdXIlHU+rdW1yz+rIuZ0si90t3q8ijrIIHRK+DDNB3/RUFQCX+ ZoZcttXStCc+r27oIbWauVRzuwDnUD86CQT5A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=oEUJGVhmZAuCt7TSs2h2B4Ugtwaiwru85g2CJfMygzqnUf4wc+pWoKwSK2eFjmC1tA OMxo+BBJnRiILER4MVe7kyfDh0CvcA90NxJWWh4AFU4RgjUmYEKQKf67KnlUtnDWsxCb kL+4BtIdfeG768LXiKs04WAb6mCZR8WvKccog= MIME-Version: 1.0 Received: by 10.142.56.14 with SMTP id e14mr5586403wfa.37.1275827442177; Sun, 06 Jun 2010 05:30:42 -0700 (PDT) Received: by 10.142.242.4 with HTTP; Sun, 6 Jun 2010 05:30:42 -0700 (PDT) In-Reply-To: <87d3w4lc3r.fsf@mail.jurta.org> References: <87d3w4lc3r.fsf@mail.jurta.org> Date: Sun, 6 Jun 2010 20:30:42 +0800 Message-ID: Subject: Re: bug#6362: Emacs command `dired-isearch-filenames-regexp' cause CPU usage 100% From: Li Zhai To: Juri Linkov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: 6362 Cc: 6362@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.3 (--) Yes, I expect that query-replace will rename file names start with `f'. As the search process just matched the file names, it is a simple thought that `^' means the beginning of the file name. If we could add some special syntax properties to the white-space before the file name, it is possible to match the file names start with `f'. For instance, type : dired-isearch-filenames-regexp RET \sxf RET At here, the `x' means the special syntax class. It's just my random thought. At most times, a white-space can solve my problem, like `dired-isearch-filenames-regexp RET SPC f RET'. On Sun, Jun 6, 2010 at 5:54 PM, Juri Linkov wrote: >> I use the command `dired-isearch-filenames-regexp' to find some files >> in a directory. I use the the anchor `^' to match the files start with >> something. Emacs is suspended and the CPU usage is 100%.Here is a >> transcript: >> >> 1. Open a directory in dired mode. >> 2. Input `M-x dired-isearch-filenames-regexp RET =A0^ f RET' >> >> Emacs will suspend rather than match the file names start with `f'. > > Thanks for the report. =A0I fixed looping in lazy-highlighting. > Now the loop in `isearch-lazy-highlight-search' is exactly like > in `isearch-search' that checks for the empty match (and > `isearch-lazy-highlight-update' takes care about forwarding > point to the next character in this case). > > As for implementing matching at the beginning of file names with `^', > it seems this is not possible to do. =A0`re-search-forward' matches only > at the beginning of a line, not in the middle of a line. > > 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 > > Do you expect that query-replace will rename file names > that start with `f'? > > -- > Juri Linkov > http://www.jurta.org/emacs/ > From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 07 14:52:14 2010 Received: (at 6362) by debbugs.gnu.org; 7 Jun 2010 18:52:14 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLhQj-0001yJ-I0 for submit@debbugs.gnu.org; Mon, 07 Jun 2010 14:52:13 -0400 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 1OLhQh-0001y6-8p for 6362@debbugs.gnu.org; Mon, 07 Jun 2010 14:52:12 -0400 X-Virus-Scanned: by Amavisd-New at mx1.starman.ee Received: from mail.starman.ee (82.131.35.211.cable.starman.ee [82.131.35.211]) by mx1.starman.ee (Postfix) with ESMTP id D5CCB3F4194; Mon, 7 Jun 2010 21:52:03 +0300 (EEST) From: Juri Linkov To: Li Zhai Subject: Re: bug#6362: Emacs command `dired-isearch-filenames-regexp' cause CPU usage 100% Organization: JURTA References: <87d3w4lc3r.fsf@mail.jurta.org> Date: Mon, 07 Jun 2010 21:05:09 +0300 In-Reply-To: (Li Zhai's message of "Sun, 6 Jun 2010 20:30:42 +0800") Message-ID: <87k4qb82s3.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 6362 Cc: 6362@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.6 (---) > Yes, I expect that query-replace will rename file names start with > `f'. As the search process just matched the file names, it is a simple > thought that `^' means the beginning of the file name. > > If we could add some special syntax properties to the white-space > before the file name, it is possible to match the file names start > with `f'. For instance, type : > > dired-isearch-filenames-regexp RET \sxf RET > > At here, the `x' means the special syntax class. `\sx' matches a character, but it would be better to match the empty string like `^' does. One variant is to narrow the dired buffer so the beginning of a line will be the beginning of a file name. Unfortunately, it's impossible to narrow to columns, only to lines. Another variant is to add a new predicate function in regex.c that will specify where ^ should match, so dired will set it to a function that returns non-nil at the beginning of a file name. -- Juri Linkov http://www.jurta.org/emacs/ From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 07 14:52:14 2010 Received: (at 6362) by debbugs.gnu.org; 7 Jun 2010 18:52:14 +0000 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 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 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) From: Juri Linkov To: 6362@debbugs.gnu.org Subject: Re: bug#6362: Emacs command `dired-isearch-filenames-regexp' cause CPU usage 100% Organization: JURTA References: <87d3w4lc3r.fsf@mail.jurta.org> Date: Mon, 07 Jun 2010 21:09:42 +0300 In-Reply-To: <87d3w4lc3r.fsf@mail.jurta.org> (Juri Linkov's message of "Sun, 06 Jun 2010 12:54:55 +0300") Message-ID: <87aar782nt.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 6362 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.6 (---) > 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/ From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 09 11:54:25 2011 Received: (at 6362-done) by debbugs.gnu.org; 9 Sep 2011 15:54:25 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R23PL-0000VL-H8 for submit@debbugs.gnu.org; Fri, 09 Sep 2011 11:54:25 -0400 Received: from smarty.dreamhost.com ([208.113.175.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R23P4-0000Uv-Ht for 6362-done@debbugs.gnu.org; Fri, 09 Sep 2011 11:54:21 -0400 Received: from ps18281.dreamhostps.com (ps18281.dreamhost.com [69.163.218.105]) by smarty.dreamhost.com (Postfix) with ESMTP id DC7B56E8058 for <6362-done@debbugs.gnu.org>; Fri, 9 Sep 2011 08:50:00 -0700 (PDT) Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 234BA451C3C5 for <6362-done@debbugs.gnu.org>; Fri, 9 Sep 2011 08:49:59 -0700 (PDT) From: Juri Linkov To: 6362-done@debbugs.gnu.org Subject: Re: bug#6362: Emacs command `dired-isearch-filenames-regexp' cause CPU usage 100% Organization: JURTA References: <87d3w4lc3r.fsf@mail.jurta.org> <87aar782nt.fsf@mail.jurta.org> Date: Fri, 09 Sep 2011 18:49:19 +0300 In-Reply-To: <87aar782nt.fsf@mail.jurta.org> (Juri Linkov's message of "Mon, 07 Jun 2010 21:09:42 +0300") Message-ID: <8739g54sxs.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 6362-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) > 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: > [...] > +(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)))) I installed this old patch and closed this bug. From unknown Mon Aug 18 14:26:32 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 08 Oct 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator