From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Question about dired-do-find-regexp and xref-collect-matches Date: Tue, 30 Jul 2019 17:50:49 +0300 Message-ID: <0cf896c0-011a-ad4c-e661-b7763c7943c8@yandex.ru> References: <87a7dm6blt.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="226171"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 To: Eric Abrahamsen , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 30 16:51:02 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 1hsTSt-000wdB-CG for ged-emacs-devel@m.gmane.org; Tue, 30 Jul 2019 16:50:59 +0200 Original-Received: from localhost ([::1]:33646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsTSs-0001iX-AE for ged-emacs-devel@m.gmane.org; Tue, 30 Jul 2019 10:50:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38040) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsTSn-0001hX-Hm for emacs-devel@gnu.org; Tue, 30 Jul 2019 10:50:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsTSm-0001vY-J3 for emacs-devel@gnu.org; Tue, 30 Jul 2019 10:50:53 -0400 Original-Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:37602) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hsTSm-0001um-AK for emacs-devel@gnu.org; Tue, 30 Jul 2019 10:50:52 -0400 Original-Received: by mail-wm1-x32f.google.com with SMTP id f17so56903861wme.2 for ; Tue, 30 Jul 2019 07:50:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=613L/MvRq3wU3XwI87Hhp1wyoUvj4ITV3YdavQqjXbI=; b=aEkEsgFO5KkGxuY1f90kQ/YyHsnE/n1aPQLIH5HYqJCaKsefkDKpYUmVwWecZuOjTd JjECOexQUib22MwAx+Ol/rC4YGXrS/DTmvoG8fllaWNdgCB08oxKXTstaGkCB80HEQsl 0vhnrM7tmE8hsJsjy0MbbPV/r9ttr4R4E8O+0goEHOdaf+Ffz5gI7e5QT01jB5V2yke2 Xslo2WGbZK10GF2qU8SS8KQPH+4vTITYUzp9cFFu69Wwx554WmcE6/mF/gVKLhiV4NPO maqmJqx5uFPJawA+ne0DENHtfQGkKZeCLRj3fwSE0DQBl/cU/JmXhKZLIyWy/7FDDoCg 3oag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=613L/MvRq3wU3XwI87Hhp1wyoUvj4ITV3YdavQqjXbI=; b=AgPDhn9wipJ0XuS3xXGmocCr4oUxmFQ+WLmve49GTXZXvpiP3srOw2q2WDmfMuW5po LiB2Yu3TDwUeyr/RM27C0reSIkwr8+uzggFyZeIaRVMz4lY+g6EK7v/l3Hc4rk68ywTQ 6lwmcdRCYcqL+a+jJfq30k00PhAVAHYGTsl5nz4sO1DtLU7x2v7MHVK/xpWG4Fb/gPPI jFqQ7aQ9Cduwc0yNv15kmVKdHx5VctyYgkGEcFsME5IHbNmq/9b5Y05eCJgwivXJC+jB ApcguBAchIVyt6nzb0CwnljhWvMzGqPybokfIWmY8d4VlRAA3K7wu1h3PAgSpTysQhuL 1H8g== X-Gm-Message-State: APjAAAUj7LkAv9Z4pykdXtt7RBTLYPGC3M7PHQgDD+b/eE5Y6NwRBR85 M/WkCP02qRVG2iuh6SdBO7IX0Muu3ek= X-Google-Smtp-Source: APXvYqyMsUYtGUhVietw/zZQDFIC+7sroPILlA50e8KQ0ucWtorvBISFedZF1DXcKeKdiPiObJm1+w== X-Received: by 2002:a1c:cfc7:: with SMTP id f190mr100286064wmg.85.1564498250617; Tue, 30 Jul 2019 07:50:50 -0700 (PDT) Original-Received: from [192.168.0.195] ([109.110.245.170]) by smtp.googlemail.com with ESMTPSA id b15sm80900640wrt.77.2019.07.30.07.50.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jul 2019 07:50:50 -0700 (PDT) In-Reply-To: <87a7dm6blt.fsf@ericabrahamsen.net> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32f 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:239034 Archived-At: Hi Eric, On 10.07.2019 2:18, Eric Abrahamsen wrote: > A while ago I switched to the fish shell, which I generally like better > than bash. I also like fish, a lot. I don't use it inside Emacs, though. > 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. That sounds like a bug report material. Up until now I figured a few extra shell process calls wouldn't matter, but maybe they can. Just how many files are you marking in the given example? > The search hits are collected as: > > (mapcan > (lambda (file) > (xref-collect-matches regexp "*" file > (and (file-directory-p file) > ignores))) > files) > > 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? Not exactly. That FILES argument is something different (a list of globs). Overall, this shouldn't be too hard to fix. Could you send your response to the bug tracker as a new report?