From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: Question about dired-do-find-regexp and xref-collect-matches Date: Tue, 9 Jul 2019 16:33:35 -0700 (PDT) Message-ID: References: <87a7dm6blt.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="253132"; mail-complaints-to="usenet@blaine.gmane.org" To: Eric Abrahamsen , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 10 01:58:05 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hkzzp-0013lM-12 for ged-emacs-devel@m.gmane.org; Wed, 10 Jul 2019 01:58:05 +0200 Original-Received: from localhost ([::1]:56958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkzzo-0000G3-1W for ged-emacs-devel@m.gmane.org; Tue, 09 Jul 2019 19:58:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57086) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkzfH-0005Vh-Dz for emacs-devel@gnu.org; Tue, 09 Jul 2019 19:36:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkzfF-0004Z7-KI for emacs-devel@gnu.org; Tue, 09 Jul 2019 19:36:51 -0400 Original-Received: from userp2120.oracle.com ([156.151.31.85]:60188) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hkzfB-0003x4-Db for emacs-devel@gnu.org; Tue, 09 Jul 2019 19:36:46 -0400 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x69NY2Up188383; Tue, 9 Jul 2019 23:35:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=ALgiX4GJQJSx+kgz+yDr0eyfGAwsOtsh89qTKLF8L2A=; b=nBaSx69thh+M1m4KCwnjGKml25LrUkr2XjpBGpC+1v49EzcFO8ret6kveSx/f61VDTBc ta4dzTT+zIVSHysq3E+LjxFRGP3Z6+3xpLjGiLYfpkl0JzJhgW62wM1h/YJLHSQY+Y2e HP828/znRkDdz/W9AgnEWwsS4WSklPABJXzhnVE9F3TTreZM0Qy07cgaFrREMFREuqVq 8H2n/KrR8IEmuAOI4k10wiWWJOGsaJjLzcNLqFwA8SctaqukbkGtdTSnZa2B3Xw0fjlH FD97vEtdA9iEFFwssXI9YEaqZNA1duGmkpFL9COK//O17JZpMgtL0v9YyrtKika8q8ND Ow== Original-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 2tjm9qq0ey-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 09 Jul 2019 23:35:39 +0000 Original-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x69NWUMQ116309; Tue, 9 Jul 2019 23:33:39 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3030.oracle.com with ESMTP id 2tn1j0ja77-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 09 Jul 2019 23:33:38 +0000 Original-Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x69NXanf028207; Tue, 9 Jul 2019 23:33:37 GMT In-Reply-To: <87a7dm6blt.fsf@ericabrahamsen.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4861.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9313 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907090282 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9313 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907090282 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.85 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:238490 Archived-At: > I noticed that marking files in Dired and using "A" > (dired-do-find-regexp) to search them was extraordinarily slow. Going up > a level to the parent directory and only marking the child directory, > the search was nearly instantaneous. But that meant I had to search all > the files in the child directory. >=20 > I suspected it was something to do with fish, and indeed setting > shell-file-name to "/usr/bin/bash" sped it up a little -- but that's a > bug report for another day. >=20 > While poking around I also noticed that dired-do-find-regexp calls > xref-collect-matches once per marked file. That means a full find+grep > call for each file, when a single find+grep call (or even just a single > grep call!) would do the trick. >=20 > The search hits are collected as: >=20 > (mapcan > (lambda (file) > (xref-collect-matches regexp "*" file > (and (file-directory-p file) > ignores))) > files) >=20 > But the second argument to `xref-collect-matches' can be a > space-separated string of file names -- wouldn't it be easier just to > call `xref-collect-matches' once? Meanwhile (fortunately), you can still use `dired-do-search' (which used to be bound to `A'). If that wasn't "extraordinarily slow" for you before, it still might not be. Maybe try it.