From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#26710: Fwd: 25.2; project-find-regexp makes emacs use 100% cpu Date: Tue, 02 May 2017 20:26:19 +0300 Message-ID: <838tmfi30k.fsf@gnu.org> References: <87a86zu3gf.fsf@hari-laptop.i-did-not-set--mail-host-address--so-tickle-me> <83vapnktcn.fsf@gnu.org> <3d76a3ac-32ad-412d-349d-5904fc964a2b@yandex.ru> <83ziexka0s.fsf@gnu.org> <77b3a404-adac-fd1c-bd99-ad10e2450338@yandex.ru> <83inlljb5r.fsf@gnu.org> <83lgqfivb0.fsf@gnu.org> <9474c678-b092-81f0-f5b3-f26d4467ac86@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1493746090 12602 195.159.176.226 (2 May 2017 17:28:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 2 May 2017 17:28:10 +0000 (UTC) Cc: hariharanrangasamy@gmail.com, 26710@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 02 19:28:06 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5bao-00039z-0m for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 May 2017 19:28:06 +0200 Original-Received: from localhost ([::1]:60362 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5bat-0000Gl-MF for geb-bug-gnu-emacs@m.gmane.org; Tue, 02 May 2017 13:28:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5ban-0000Gf-F1 for bug-gnu-emacs@gnu.org; Tue, 02 May 2017 13:28:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5bak-00046Y-9z for bug-gnu-emacs@gnu.org; Tue, 02 May 2017 13:28:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53209) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d5bak-00046R-6n for bug-gnu-emacs@gnu.org; Tue, 02 May 2017 13:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d5bak-00068f-0F for bug-gnu-emacs@gnu.org; Tue, 02 May 2017 13:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 May 2017 17:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26710 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26710-submit@debbugs.gnu.org id=B26710.149374602923540 (code B ref 26710); Tue, 02 May 2017 17:28:01 +0000 Original-Received: (at 26710) by debbugs.gnu.org; 2 May 2017 17:27:09 +0000 Original-Received: from localhost ([127.0.0.1]:51408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5bZs-00067c-ME for submit@debbugs.gnu.org; Tue, 02 May 2017 13:27:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57094) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5bZr-00067P-Ax for 26710@debbugs.gnu.org; Tue, 02 May 2017 13:27:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5bZj-0003EI-2i for 26710@debbugs.gnu.org; Tue, 02 May 2017 13:27:02 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33591) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5bZi-0003E8-VH; Tue, 02 May 2017 13:26:58 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3121 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d5bZg-0003bz-6k; Tue, 02 May 2017 13:26:58 -0400 In-reply-to: <9474c678-b092-81f0-f5b3-f26d4467ac86@yandex.ru> (message from Dmitry Gutov on Tue, 2 May 2017 13:00:06 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:132192 Archived-At: > Cc: hariharanrangasamy@gmail.com, 26710@debbugs.gnu.org > From: Dmitry Gutov > Date: Tue, 2 May 2017 13:00:06 +0300 > > On 02.05.2017 10:15, Eli Zaretskii wrote: > > > Can you explain the significance of xref--regexp-syntax-dependent-p's > > tests? I don't know enough about xref to grasp that just by looking > > at the changes. > > When it returns nil (the regexp is not affected by syntax-table): > > If the file containing the hit is not open, we now skip inserting the > first few lines of that file into the temporary buffer, and calling > set-auto-mode. > > And, whether it's open or not, we skip the syntax-propertize call. OK, I will look at that function with this in mind. > Still, if the filter function and sentinel functions take a lot of time > (and/or get called a lot), like it will be in this example, the UI can't > as responsive as usual, can it? The sentinel/filter won't be called at all if keyboard/mouse input is available. Once they are called, if each call takes a long processing time, the UI could feel sluggish, yes. But I don't quite see how using threads will avoid the same problem, since the mechanism for thread switch is basically the same as for multiplexing UI with subprocess output. > I'd like a more general advice first. E.g. do we want to go this road? IMO, we should first explore the async subprocess road. > It seems a bit brittle, though: if the process filter is supposed to be > calling the callback for each item, the callback has to be in place > right away. And the process will be started before that happens. You can countermand that by using make-process with the :stop attribute, then use 'continue-process' when everything is set up. > We'll probably be saved by filters having to wait until the current > command finishes executing, though. Not sure I follow you: a filter function is called whenever some output arrives from the subprocess. So they don't need to wait for the subprocess to finish.