From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#62735: 30.0.50; project.el project-search errors because project-files returns directories Date: Mon, 10 Apr 2023 02:15:29 +0300 Message-ID: <8ff8a1a3-a307-39e5-00c1-0934acbef058@gutov.dev> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7593"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 To: Robert Nikander , 62735-done@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 10 01:16:17 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pleGe-0001jJ-4U for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Apr 2023 01:16:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pleGS-0002yd-Mi; Sun, 09 Apr 2023 19:16:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pleGQ-0002yN-Sf for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2023 19:16:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pleGQ-0006sW-LH for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2023 19:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pleGQ-000393-HE for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2023 19:16:02 -0400 Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Apr 2023 23:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 62735 X-GNU-PR-Package: emacs Mail-Followup-To: 62735@debbugs.gnu.org, dmitry@gutov.dev, robert.nikander@icloud.com Original-Received: via spool by 62735-done@debbugs.gnu.org id=D62735.168108215212067 (code D ref 62735); Sun, 09 Apr 2023 23:16:02 +0000 Original-Received: (at 62735-done) by debbugs.gnu.org; 9 Apr 2023 23:15:52 +0000 Original-Received: from localhost ([127.0.0.1]:33924 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pleGF-00038Z-Sh for submit@debbugs.gnu.org; Sun, 09 Apr 2023 19:15:52 -0400 Original-Received: from wnew1-smtp.messagingengine.com ([64.147.123.26]:53079) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pleG3-00038B-Tt for 62735-done@debbugs.gnu.org; Sun, 09 Apr 2023 19:15:50 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 2489E2B06868; Sun, 9 Apr 2023 19:15:32 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 09 Apr 2023 19:15:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1681082132; x=1681085732; bh=YvT754rQz9TGeMbzF9pHx/Drt9ypzmKvtDg P2WxUajM=; b=FF+cwkHbno/aR7rhrFqIYAmFPU4IpqJhTEdeLLlGiXQA0hjvmNn QpDcJ4lm1UE/o4IJaDYoJ2cIwaiI9R2dZWcBAKVIHXu/HljQWjPl7QKcICNDPIV0 GhWAVqBBytqYFm3vZiSEobrH+UJiYnwsERY6BZ7ukaMVuJfRZPj1UIs4NsrX1Mgb 2W8KhT3oUX7hR/Kwc6UDg8t9ciSGpS6xOaOyV6jIw9nA4cIZU/TfTVhLXRd8d/Ne 629McCSK7rMiAXLV9L+ytKXtc0FqykF3h3qHn+gZCtcPaDoQDOpyLKm0b3CsjX/l Gjw4KP3lZXoQ1aHnZAiYquugNqVRGQF4Fdg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1681082132; x= 1681085732; bh=YvT754rQz9TGeMbzF9pHx/Drt9ypzmKvtDgP2WxUajM=; b=V UKj9gkZubLBm3sbZKx/WHZhwu819W0WPRyG9YXxRbmek0teppbg/Jz+f5cBXHmWs DdglFjKaXJvx48ZlLJ5x4jzf20uY8YbIaoDSvhxyzmE5aBkPVFs4iqd00ZAJt6fo pE8h/2fAsXOdT0TuK91z6PxG4Ugm6jF2NiZhaF8+M82D4TjxfQiqUkAgISJkm4MO 1tjJhEc648G89/5HKl4iBTTX9Z3XWJzvjr53pBhbpq/6p+abwgoeD6pQg/LvC5VL AJ5UNsg2hVlDd3cjrngAgvEqiBuWFVweCdVaWOYCfWCMMfTn+a31iDNfD+5FISjm bwrTkOY/g8PIDTZfyIQDQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdekuddgvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeefjeekvedvfeelfedufeevgeetvdevkeelvddtueetteefudefgfduieekffei leenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 9 Apr 2023 19:15:31 -0400 (EDT) Content-Language: en-US In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:259541 Archived-At: Version: 29.1 Hi! On 09/04/2023 00:45, Robert Nikander via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Hi, > > I tried to run the command `project-search`, documented in "29.2.1 Project Commands That Operate on Files”. It threw an error because it tried to process a directory. The backtrace from debugger is below. > > The function defined right below `project-search` in project.el is `project-query-replace-regexp`. It has this comment and line: > > ;; XXX: Filter out Git submodules, which are not regular files. > ;; `project-files' can return those, which is arguably suboptimal, > ;; but removing them eagerly has performance cost. > (cl-delete-if-not #'file-regular-p (project-files (project-current t))) > > I added the same to `project-search` and it seems to have “fixed” it. I don’t know how `project-files` works, but probably it would be better to fix that. > > This directory “…/SomeDir/“ has a .git directory inside it. That appears to be why project-files picked it up, because deleting that .git subdir also avoids the error. But projects should be able to have nested .git directories, depending on how the ‘project’ is defined. Thanks for the report. Am I correct to understand that the directory is a submodule? This is the main case which triggers this problem that I know about. I've pushed a similar fix just like you suggested. 'project-search' should be okay now. Note that 'project-find-regexp' (bound to 'C-x p g' by default) is usually a more efficient command to use rather than 'project-search' -- faster, works remotely, etc. But it has a very different interface.