GNU bug report logs - #78209
30.1; project-query-replace-regexp fails on a symlink to a directory

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Łukasz Wojniłowicz <lukasz.wojnilowicz@HIDDEN>; dated Fri, 2 May 2025 11:46:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 78209 <at> debbugs.gnu.org:


Received: (at 78209) by debbugs.gnu.org; 25 Nov 2025 20:31:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 15:31:54 2025
Received: from localhost ([127.0.0.1]:42325 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vNzhZ-0004sQ-QC
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2025 15:31:54 -0500
Received: from fhigh-a2-smtp.messagingengine.com ([103.168.172.153]:60565)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1vNHov-0006OR-0f
 for 78209 <at> debbugs.gnu.org; Sun, 23 Nov 2025 16:40:33 -0500
Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46])
 by mailfhigh.phl.internal (Postfix) with ESMTP id DCFA11400155;
 Sun, 23 Nov 2025 16:40:27 -0500 (EST)
Received: from phl-mailfrontend-02 ([10.202.2.163])
 by phl-compute-06.internal (MEProxy); Sun, 23 Nov 2025 16:40:27 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :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:subject:subject:to:to; s=fm2; t=1763934027;
 x=1764020427; bh=j2NmykhfJh7YF1aWRTDEGqjX5PeHGe+pTnaCPdcXNZA=; b=
 SCh3mf8JnhWdttYlEDngYdeotWSGNLK+vEBf97S9kgUbOSH5OZ+z/dWEVcbajCGl
 WbKkMgDfR2vMMWldt41+gVG7I4sp0UgC2TLxD9t51ueJVLrqH0I/CsdvGoj9WlR3
 P6wzCWMVZ2E7poALOJzdQb2712gFLziSIzg5gE5Yv3VTP3BVocKEYKSOHzxMNof5
 2ebY7qJHdOvbzL9Ww+nKTjaVYovQ+8PTfC5kLVpj/A4F12Pm8cVAne4fagbrlTDC
 SAZJjLvgvKAFDAwh+hWRlaJocdJ88piWHWU1Y4+0Gm+OJvzLkJss6shepO4PZwEb
 dvkcPR/MCwJdYCjlZ/dijg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc: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:subject:subject:to:to:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1763934027; x=
 1764020427; bh=j2NmykhfJh7YF1aWRTDEGqjX5PeHGe+pTnaCPdcXNZA=; b=B
 gxiDmazt3JSScUY+RDguaKWyMzxF3CuYE/dKzbOYypCC1GZnjKcqNxgt62IxxMUt
 JcJu/6DeJLnR9l5d0dH0M5n006hjN1CLkkz9Ep63SFg63c0s9y2SytmGeAoS24lz
 pEt94ywEUSWNMKelDCc9qGzIxwOpQG+dr3zQdDHBMJL96yB4Ggw6tR0vzLIZqrDi
 Dd34GlpqnuWAJbPggU3URVDXDyg5lN6NsSnLMvskLFG5Xor4xG1eV1O4+MKXdvyh
 +j6t/QJAqPZB3Y31bQlAMOwF2ovgjdSZ9VwHLjVU7QWoI/SKHimqBx76AL1nF2CD
 2Yw82lupDD/sHESQ0i95g==
X-ME-Sender: <xms:S38jaTtL25yBSfHNbBs57YpZAyC84iHw1NFKxHBCOcGKbrgUMJmFfA>
 <xme:S38jaSQYeiw7Vmty49BmjHMTzTINWlq78FOIytZujjy3H13MH_Vk4ukMVXUDQ35Qa
 oY8y8nP-l1dmowuZOcQ7OR49h7rEbIVjjH4cj5WeY2bhc5Sc3x5FBw>
X-ME-Received: <xmr:S38jaRPVHcgiQU5Hd3hiyxSurRt-5-0BrusKx4jIzAbuDhuJde_mpvFwjM_kG3Zl11Ps>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvfeeikedvucetufdoteggodetrf
 dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu
 rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf
 gurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhithhr
 hicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrthhtvg
 hrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedujeeh
 necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmih
 htrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhp
 ohhuthdprhgtphhtthhopehmohhnnhhivghrsehirhhordhumhhonhhtrhgvrghlrdgtrg
 dprhgtphhtthhopehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgdprhgt
 phhtthhopeguohhmihhnihhkrdhstghhrhgvmhhpfhesghhmrghilhdrtghomhdprhgtph
 htthhopeejkedvtdelseguvggssghughhsrdhgnhhurdhorhhg
X-ME-Proxy: <xmx:S38jafYYPTiwm2q4MeodqTNI2jyhvKlvdQ-UusCMyHFCziie-ON-pw>
 <xmx:S38jaTy4I7WhTP230gkXkh92aOi7W9wHlmHd1VRcltm7g1O3NnYtZg>
 <xmx:S38jaSJAODIj3_OAyKpow9w5TNq4GrZUXC5I_OE6Z3kXftZD6aGf2w>
 <xmx:S38jaVpt_CnoYKStx5MGy8xJBin1q2NO4gFXrlJlfP_I7dm5L8k6-g>
 <xmx:S38jad_LUAN19uRZECjcw3KDVV62lLUp63_qq2GJFi_ds2Dimm5R_3a4>
Feedback-ID: i07de48aa:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun,
 23 Nov 2025 16:40:25 -0500 (EST)
Message-ID: <f4bd9b8f-0ad7-46b9-9fe3-3aa9487b7930@HIDDEN>
Date: Sun, 23 Nov 2025 23:40:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#78209: 30.1; project-query-replace-regexp fails on a symlink
 to a directory
To: Stefan Monnier <monnier@HIDDEN>
References: <aBSRykbzvZhPnNxv@HIDDEN> <87jyzvqawv.fsf@HIDDEN>
 <87bjkz8jep.fsf@HIDDEN>
 <jwv5xb7pd80.fsf-monnier+emacs@HIDDEN>
 <77b38a17-ff61-4e75-8ac8-f65bb7f6fa1b@HIDDEN>
 <jwvpl9em9mp.fsf-monnier+emacs@HIDDEN>
 <3d1e9168-6879-4d9b-8785-81945b006d0e@HIDDEN>
 <jwv5xb3im1k.fsf-monnier+emacs@HIDDEN>
Content-Language: en-US
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <jwv5xb3im1k.fsf-monnier+emacs@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 78209
Cc: Dominik Schrempf <dominik.schrempf@HIDDEN>, 78209 <at> debbugs.gnu.org,
 Sean Whitton <spwhitton@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 21/11/2025 14:56, Stefan Monnier wrote:
> but that's not the case because
> `fileloop-initialize` accepts an iterator as argument (in place of
> a list)

Oh right, that would work, thanks.

So we can certainly go this way, as soon as we decide that there exist 
non-ignored symlinks inside projects which we want to support.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78209; Package emacs. Full text available.

Message received at 78209 <at> debbugs.gnu.org:


Received: (at 78209) by debbugs.gnu.org; 25 Nov 2025 20:31:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 15:31:52 2025
Received: from localhost ([127.0.0.1]:42320 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vNzhY-0004rm-0b
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2025 15:31:52 -0500
Received: from fhigh-a2-smtp.messagingengine.com ([103.168.172.153]:32823)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1vNHjX-00062Z-Dg
 for 78209 <at> debbugs.gnu.org; Sun, 23 Nov 2025 16:35:02 -0500
Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51])
 by mailfhigh.phl.internal (Postfix) with ESMTP id C1F5D140009E;
 Sun, 23 Nov 2025 16:34:53 -0500 (EST)
Received: from phl-mailfrontend-02 ([10.202.2.163])
 by phl-compute-11.internal (MEProxy); Sun, 23 Nov 2025 16:34:53 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :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:subject:subject:to:to; s=fm2; t=1763933693;
 x=1764020093; bh=8R1CZAunShBG22yr/88XkvwIn9ZXW1RD6i78JY69cgA=; b=
 K7Rf2FPdSfwqb7aoBMlMjvReA5j8QdNJozi2dESzCmjqRPjnSsQWzJku4d02hgTG
 s9YYL3QKvMiaCiYRelnC+ktYNuQdzTviVpjk3wOL+/wRvO3FoppC5EtDlkPP3NBT
 YG+jP6RddtBQ81d5UeNCKdrXMiSlMuGHSnLcozxChSm3Hb280q6YVReSLmIhoKv+
 W6bK1zMUFq/vzqhWGuYVP83pEVx/hGhsTlWCHuY8dqt/R0d7IeNmJy+iI2RlloFL
 ISMHsm84gVP75Sl7KZNQWhmx3mEx5oMRSM9zMX+/UxLcuan6a522/m6IL6GQDeiT
 dp0v3KCo8sT3OM5bo9QPzQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc: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:subject:subject:to:to:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1763933693; x=
 1764020093; bh=8R1CZAunShBG22yr/88XkvwIn9ZXW1RD6i78JY69cgA=; b=O
 a2wINYchhfHGFblFXWhoSXFEGwOCD2++fyqXXdGZ4/nygyXpenTo+WicFJS4Ysd2
 MxP1TIQRwL0Xysn6MXyl5vyOOOf+a29vKgi7SaCH3uNU6dPr5aOBOtzz8cw3Qm3X
 vzFkBwz+z7ppK3qSK2lcGmJJTM21BbZvlX6nDX7ADZHbR9nL9QkNqL2DEmTSpAtK
 ARK3NaKiykyrt6as94geHnJVgLlwPoeTRVCAHsX6MD8BFJb04MTAxpqfXVPp0qPj
 4mA1GPVfO3VArowhfday9w8vmDwMT/A/xm9ISE8ddTRSv7bwLt76IqqctYLFg6BA
 gkiy7rJy4BAfIZasqrAZw==
X-ME-Sender: <xms:_X0jaYYoP10CGw2Cpz0sfJwngA_tKThZ8V_q6aZ2br6-gQetYcj24Q>
 <xme:_X0jaZZEaNo0ZG7xCoxlp-msprjkpBgwirtI9cRZe2YAYMs6eYisD3i_Gd5npy3Mm
 Nh4BZnY2GOELJkyJDxI-fcNbwqorcDo3YAKVb4F0vdWh-oHmWRGjQ>
X-ME-Received: <xmr:_X0jaQnulC6633tTiaLQFCr3sD69e4J_uKNiAh8MJ9_p3P51qHYW9xdxFbjPQXn0l4iD>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvfeeikedvucetufdoteggodetrf
 dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu
 rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf
 gurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhithhr
 hicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrthhtvg
 hrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedujeeh
 necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmih
 htrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhp
 ohhuthdprhgtphhtthhopeguohhmihhnihhkrdhstghhrhgvmhhpfhesghhmrghilhdrtg
 homhdprhgtphhtthhopeejkedvtdelseguvggssghughhsrdhgnhhurdhorhhg
X-ME-Proxy: <xmx:_X0jady4awlvFQOmhI1BnjBRefyeaO6rY4HbWYS7VMwzFMzg4PmcJQ>
 <xmx:_X0jaWPbiecXgn3mc8n7xB02EVdaOxgVGQPnpESnGfj80ixPeGa6TQ>
 <xmx:_X0jaZRGqSfCqfN8800E8fIMcObhWMSkpcvOfrLTTgUPY8krQ0bv4g>
 <xmx:_X0jaca3gDyP_V4xVI4VXsV7srXcyS_cbuA1J19Bq3xAXlJg5fqYPQ>
 <xmx:_X0jaR2G1wZaaBbVUbP4RWNeSAMIVH0PtvfNgbn2Wx0frCkkESeSH-i0>
Feedback-ID: i07de48aa:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun,
 23 Nov 2025 16:34:52 -0500 (EST)
Message-ID: <d1e7989b-ad5b-499a-a7e6-cf297426e298@HIDDEN>
Date: Sun, 23 Nov 2025 23:34:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#78209: 30.1; project-query-replace-regexp fails on a symlink
 to a directory
To: Dominik Schrempf <dominik.schrempf@HIDDEN>
References: <aBSRykbzvZhPnNxv@HIDDEN> <87jyzvqawv.fsf@HIDDEN>
 <99e4a9b8-c9b9-414d-889b-66ac91aea08a@HIDDEN> <87h5uoeksd.fsf@HIDDEN>
 <5bc4ddbd-0964-48da-9d09-e5dfed1303ee@HIDDEN> <87ms4flua6.fsf@HIDDEN>
Content-Language: en-US
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <87ms4flua6.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 78209
Cc: 78209 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 21/11/2025 09:27, Dominik Schrempf wrote:

> I managed to reproduce the error in the original repository (and I can
> do so reliably by using a unique string, see backtrace below),

Very good.

> but I can
> not create a minimal example.

If other approaches fail, you could try removing stuff from the 
directory while checking that the error still reproduces. Removing other 
directories, submodules, etc.

Then if the error is still there, you could just keep the files, copy it 
into another directory with bare Git history, and check them all in. And 
check in the submodule settings as well (maybe copying the contents of 
.gitmodules, or creating the submodule using 'git submodule add') - that 
would be a git repo one could share.

> The backtrace is
> 
> Debugger entered--Lisp error: (file-error "Read error" "Is a directory" "/path/to/proj/examples/botan/botan/")
>    insert-file-contents("/path/to/proj/examples/botan/botan/./" nil)
>    fileloop-next-file(t)
>    fileloop-continue()
>    project-query-replace-regexp("alskdjflasjdlfkjasdf" "")
>    funcall-interactively(project-query-replace-regexp "alskdjflasjdlfkjasdf" "")
>    command-execute(project-query-replace-regexp)
> 
> 'examples/botan/botan' is a git submodule (and it is empty in my case, I
> haven't checked it out)! (But in a minimal example I tried to come up
> with, that git-submodule fact alone didn't trigger the error). What is
> also a bit surprising is this './' at the end of the argument to
> `insert-file-contents'.

Is there a chance that the .gitmodules entry is a bit unusual? Using 
some special chars or etc?

Please evaluate (project--git-submodules) in the root of the project 
which has the problem. Does the return value - the list of strings - 
look as expected?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78209; Package emacs. Full text available.

Message received at 78209 <at> debbugs.gnu.org:


Received: (at 78209) by debbugs.gnu.org; 25 Nov 2025 20:29:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 15:29:46 2025
Received: from localhost ([127.0.0.1]:42204 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vNzfW-0002AF-4y
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2025 15:29:46 -0500
Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]:61862)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <dominik.schrempf@HIDDEN>)
 id 1vNwb9-0005aW-Py
 for 78209 <at> debbugs.gnu.org; Tue, 25 Nov 2025 12:13:04 -0500
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-b739b3fc2a0so185660666b.3
 for <78209 <at> debbugs.gnu.org>; Tue, 25 Nov 2025 09:13:03 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1764090777; x=1764695577; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:user-agent
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=UyQ6Mmt8IOhfWPueKQcs8wwRPG+/f5lT+kPDV4z4EEU=;
 b=QHnpRuckw6R0zMm3U3na/puDWzTh5RzJCA6vInisDdFO6x2eXoi5I7Ib8k84wpVzG4
 2beoEocgkdex1pNxQGtBB2QOaI/LD6LKMiXNYs87reNyUoz2F0P+ryxz7yyvPlkPur0M
 PVcGCx6jEDIdijJUcW3KIyYYok34N8nNecMNKZfHTFZwvCApaKsdUPzPSlj+o6rW9DWs
 76/XhbzEXmHk27Nqo2NrZuh+obXDETr8ks8ujJuFfgQyLLPPeC4skgiISstnPfCJ73gm
 qb4ZwkZueJHukYjSC7s+ja3cJiWT8Vzn4RrVEFEPA5v4iEx9XYXZasjgTMHXX2C0QHEw
 pxAA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1764090777; x=1764695577;
 h=content-transfer-encoding:mime-version:message-id:date:user-agent
 :references:in-reply-to:subject:cc:to:from:x-gm-gg
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=UyQ6Mmt8IOhfWPueKQcs8wwRPG+/f5lT+kPDV4z4EEU=;
 b=HFeGidDNhmy0swWoDXdA0tA0hm7+bbEQgooayaFINhwV90h2OAjW2li90HT2KQhn15
 iCzIVeQu+rX+93S4yQCzKYg4uFFAkAyiF9IdYPR74NwKgC9RfWmFhxDya89h7vjpwPQE
 mFIIue6V5YLqhI8zGCYa9YQ28YWtE6/FiCyxIp9jGIBTwZ9lZvnZ74YnDNbpoOoB2m6X
 sFNkKHIoHyG04SyH93TZHTAeghsaIIuzHkuOUUpheqn5nchC5Y9GySQ1VxH7i3HIi4kt
 Y4TNCoQtIhFzKVwcIrTd17iOFWKkE9p5ycVE9/brg0D3ey4N6gZvpzSldQDSYPGpq9fU
 NK3A==
X-Gm-Message-State: AOJu0Yx4aZozfhV7Oiw5gmRamRS2Mmr98/yX6bdEZtcy3wyK1h+5om0d
 Y768ZgnDoxn+L1Xnt1U27+cEdnTsX6LQRTa0wpU2vGa173/YNzfhmQo=
X-Gm-Gg: ASbGnct91BpVsJTpw+pt49rTP3OBLPYSpRKv4UdPD0/f1/Eo1tl2KV6AgbzsfvX0pFg
 73h/CQz2NUq0NFjA6lGnxwhxB6qCh1X0B2JXJdiPq4ZNYUiRC6x+Wap6C4nNQ7dKv08n9XAbWcX
 JJxw9nVc/uPP/oQZuLdhH5DUvktgvV/9Hv+Pr0A5Ad475CVhZuMmqO+pLINwyIvT+c5ZHMTGad+
 r7JYtMo/bVxz7Jvjqu1sS6MI6k4MgcSpyL40bZiQp+CRE2Q4Ikp/Clmr0n7CDnuJnCHRB7dcFhV
 YIB15SMoPrM/vl7p/nYjwbdVeYeEQ4MoAdQ10w6utsqdPW+gFBlN++cXIYIMHr2TOvXin01KmDx
 mFeAyQiygJJwm6uAqIqK0fSLWJzGUY72pNJMPh8hAyqPpAaQn60w4OSSHf2S6d4iISV19luFMP+
 j/MmqES6G0H9gbWzGg6g==
X-Google-Smtp-Source: AGHT+IH408/4JFTpKPrAZFxgKkr4iz/RkVm0S/+0q3X3ELFUmDk72iZzRgxAeKqYToV3EGe/vBTgUg==
X-Received: by 2002:a17:907:3d86:b0:b73:8757:68ad with SMTP id
 a640c23a62f3a-b76c555e474mr393091166b.47.1764090776833; 
 Tue, 25 Nov 2025 09:12:56 -0800 (PST)
Received: from localhost ([2a02:1748:dd5e:5d70:606d:597d:1701:b0fe])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-b7654fd4f4esm1639592266b.45.2025.11.25.09.12.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 25 Nov 2025 09:12:56 -0800 (PST)
From: Dominik Schrempf <dominik.schrempf@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#78209: 30.1; project-query-replace-regexp fails on a
 symlink to a directory
In-Reply-To: <d1e7989b-ad5b-499a-a7e6-cf297426e298@HIDDEN> (Dmitry Gutov's
 message of "Sun, 23 Nov 2025 23:34:50 +0200")
References: <aBSRykbzvZhPnNxv@HIDDEN> <87jyzvqawv.fsf@HIDDEN>
 <99e4a9b8-c9b9-414d-889b-66ac91aea08a@HIDDEN>
 <87h5uoeksd.fsf@HIDDEN>
 <5bc4ddbd-0964-48da-9d09-e5dfed1303ee@HIDDEN>
 <87ms4flua6.fsf@HIDDEN>
 <d1e7989b-ad5b-499a-a7e6-cf297426e298@HIDDEN>
User-Agent: mu4e 1.12.13; emacs 30.2
Date: Tue, 25 Nov 2025 18:12:55 +0100
Message-ID: <87bjkqvxwo.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78209
Cc: 78209 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


On Sun 23 Nov 2025 11:34:50 PM +02, Dmitry Gutov wrote:

> On 21/11/2025 09:27, Dominik Schrempf wrote:
>
>> I managed to reproduce the error in the original repository (and I can
>> do so reliably by using a unique string, see backtrace below),
>
> Very good.
>
>> but I can
>> not create a minimal example.
>
> If other approaches fail, you could try removing stuff from the directory=
 while
> checking that the error still reproduces. Removing other directories,
> submodules, etc.
>
> Then if the error is still there, you could just keep the files, copy it =
into
> another directory with bare Git history, and check them all in. And check=
 in the
> submodule settings as well (maybe copying the contents of .gitmodules, or
> creating the submodule using 'git submodule add') - that would be a git r=
epo one
> could share.

Thank you! I played around, and came up with a minimal example:

```
mkdir minimal
cd minimal
ln -s ../ link
git init
```

Then, in Emacs, navigate to `minimal`, and execute
`project-query-replace-regexp', replacing some fake values ('a', and
'b') are enough, since there are no files in the project. The error is

```
apply: Read error: Is a directory, /home/dominik/work/minimal/link
```

The link has to point to an _existing_ directory. The command that seems
to be executed behind the scenes is:

```
git --no-pager ls-files -z -c --exclude-standard -o .
```

It lists the link, and Emacs fails because it thinks it is a file, but
it points to a directory.



Also, I managed to get another error when I delete specific files in the
project, but that is a different story:

```
Debugger entered--Lisp error: (error "Lisp nesting exceeds =E2=80=98max-lis=
p-eval-depth=E2=80=99")
  #f(compiled-function () #<bytecode 0x14384da77d1335f3>)()
  #f(compiled-function (op value) #<bytecode -0x1f460cfe86881b93>)(:next ni=
l)
  iter-next(#f(compiled-function (op value) #<bytecode -0x1f460cfe86881b93>=
))
  fileloop-next-file(t)
  fileloop-next-file(t)
  fileloop-next-file(t)
  fileloop-next-file(t)
  fileloop-next-file(t)
  fileloop-next-file(t)
  fileloop-next-file(t)
  fileloop-next-file(t)
  ... [many many more]
  fileloop-next-file(t)
  fileloop-next-file(t)
  fileloop-next-file(t)
  fileloop-next-file(t)
  fileloop-next-file(t)
  fileloop-next-file(t)
  fileloop-next-file(t)
  fileloop-next-file(t)
  fileloop-continue()
  project-query-replace-regexp("laksjdf;lkajsd;flkjasdf" "asdfasdf")
  funcall-interactively(project-query-replace-regexp "laksjdf;lkajsd;flkjas=
df" "asdfasdf")
  command-execute(project-query-replace-regexp)

>
>> The backtrace is
>> Debugger entered--Lisp error: (file-error "Read error" "Is a directory"
>> "/path/to/proj/examples/botan/botan/")
>>    insert-file-contents("/path/to/proj/examples/botan/botan/./" nil)
>>    fileloop-next-file(t)
>>    fileloop-continue()
>>    project-query-replace-regexp("alskdjflasjdlfkjasdf" "")
>>    funcall-interactively(project-query-replace-regexp "alskdjflasjdlfkja=
sdf" "")
>>    command-execute(project-query-replace-regexp)
>> 'examples/botan/botan' is a git submodule (and it is empty in my case, I
>> haven't checked it out)! (But in a minimal example I tried to come up
>> with, that git-submodule fact alone didn't trigger the error). What is
>> also a bit surprising is this './' at the end of the argument to
>> `insert-file-contents'.
>
> Is there a chance that the .gitmodules entry is a bit unusual? Using some
> special chars or etc?
>
> Please evaluate (project--git-submodules) in the root of the project whic=
h has
> the problem. Does the return value - the list of strings - look as expect=
ed?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78209; Package emacs. Full text available.

Message received at 78209 <at> debbugs.gnu.org:


Received: (at 78209) by debbugs.gnu.org; 25 Nov 2025 20:17:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 25 15:17:00 2025
Received: from localhost ([127.0.0.1]:55363 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vNzT9-0005D3-32
	for submit <at> debbugs.gnu.org; Tue, 25 Nov 2025 15:16:59 -0500
Received: from [132.204.25.50] (port=45574 helo=mailscanner.iro.umontreal.ca)
 by debbugs.gnu.org with esmtps
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1vMQgj-0003pR-Ie
 for 78209 <at> debbugs.gnu.org; Fri, 21 Nov 2025 07:56:54 -0500
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 6FD4B440C86;
 Fri, 21 Nov 2025 07:56:21 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1763729780;
 bh=hE8kckQqpkr0mZOqWICFcK2Fc87KCKRUPrKW7GV2l3E=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=OBw2rVraoqWpAjGF3AwU1AYpiJoePA16m7oW0hRLatyMsfd0XiM4D9MBuThc3+pY2
 UJlB0HMHKlUoTU8NA3G7BmKN7fJYEsosDqKm9QYuFcUHKMKY4V2Kd7zVgmAS6WT/7v
 jAVd/8A4EuU76weIEW6pE2COVGKuY1UU4/BKjvbyScHahl29Pz00KGGnOg72l0NxOD
 g28dnBT8lrOhqo2a1DRj/rkjqjhRjCj84FjENh+1Djkgabv2MP9TqASbyBH2zCEc4K
 wNVo4iirfxALPe9YShRjqo/a0s12eWU5e5WG/g/sdhBhi2yMO5m2tCrn2ZhOuqKOQc
 jEOSTS1RCBcWg==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4DB1A44079B;
 Fri, 21 Nov 2025 07:56:20 -0500 (EST)
Received: from asado (unknown [181.28.45.30])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0DA4212059D;
 Fri, 21 Nov 2025 07:56:17 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#78209: 30.1; project-query-replace-regexp fails on a
 symlink to a directory
In-Reply-To: <3d1e9168-6879-4d9b-8785-81945b006d0e@HIDDEN>
Message-ID: <jwv5xb3im1k.fsf-monnier+emacs@HIDDEN>
References: <aBSRykbzvZhPnNxv@HIDDEN> <87jyzvqawv.fsf@HIDDEN>
 <87bjkz8jep.fsf@HIDDEN>
 <jwv5xb7pd80.fsf-monnier+emacs@HIDDEN>
 <77b38a17-ff61-4e75-8ac8-f65bb7f6fa1b@HIDDEN>
 <jwvpl9em9mp.fsf-monnier+emacs@HIDDEN>
 <3d1e9168-6879-4d9b-8785-81945b006d0e@HIDDEN>
Date: Fri, 21 Nov 2025 07:56:13 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.117 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: >>> It seems like it can be expensive to do that inside
 'project-files'
 >>> (e.g. calling file-regular-p on every item in the returned list, eagerly).
 >> Indeed, I don't think all callers of `project- [...] 
 Content analysis details:   (1.3 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 T_SPF_HELO_TEMPERROR   SPF: test of HELO record failed (temperror)
 0.0 T_SPF_TEMPERROR        SPF: test of record failed (temperror)
 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS
X-Debbugs-Envelope-To: 78209
Cc: Dominik Schrempf <dominik.schrempf@HIDDEN>, 78209 <at> debbugs.gnu.org,
 Sean Whitton <spwhitton@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.0 (--)

>>> It seems like it can be expensive to do that inside 'project-files'
>>> (e.g. calling file-regular-p on every item in the returned list, eagerly).
>> Indeed, I don't think all callers of `project-files` would like that, so
>> it would have to be optional.  the case of
>> `project-query-replace-regexp`, the operation needs to do a lot more
>> than test the symlink-ness of every file anyway, so an extra
>> `file-regular-p` or `file-symlink-p` should be lost in the noise.
>> At most, one might need to do the test lazily rather than test all the
>> files before even calling `fileloop-initialize`, but other than that the
>> performance impact should be negligible.
>
> Right, but the existing helpers fileloop-initialize-search and
> fileloop-initialize-replace don't have a per-file argument (yet?). We could
> do that using lower level functions from fileloop, probably.

I don't know what you want to say here, sorry.

My best guess is that you're saying we'd need some extra code/control in
fileloop to do the checks lazily, but that's not the case because
`fileloop-initialize` accepts an iterator as argument (in place of
a list).

>>> But note my previous email, regarding symlinks being in .gitignore.
>> Indeed, my understanding is that `project-files` should not include the
>> ignored files at least when called for `project-query-replace-regexp`.
>> The docstring clearly says:
>>      PROJECT is used to find the list of ignores for each directory.
>
> Yep yep.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78209; Package emacs. Full text available.

Message received at 78209 <at> debbugs.gnu.org:


Received: (at 78209) by debbugs.gnu.org; 21 Nov 2025 07:28:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 21 02:28:08 2025
Received: from localhost ([127.0.0.1]:53146 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vMLYt-00056F-Kg
	for submit <at> debbugs.gnu.org; Fri, 21 Nov 2025 02:28:08 -0500
Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:49601)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <dominik.schrempf@HIDDEN>)
 id 1vMLYf-00054b-EV
 for 78209 <at> debbugs.gnu.org; Fri, 21 Nov 2025 02:27:54 -0500
Received: by mail-wm1-x32f.google.com with SMTP id
 5b1f17b1804b1-477b198f4bcso12027955e9.3
 for <78209 <at> debbugs.gnu.org>; Thu, 20 Nov 2025 23:27:53 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1763710067; x=1764314867; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:user-agent
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=NCReRqztDVaz2VS9BzMKbtuSgJlp4pRxgPC67SBd92U=;
 b=gPiK4UwnnYOklnb6jXYxej9E2Zcfw+vNA8h3CihoNOWzFNJjN7+ZX520tddnKCPQY0
 zMPU0sUgqQxR+14fHTRXhpJcZEBuNIwoyPtYbpXfq8snjjcqAZtA9lvdLJtUJM3UYzUL
 /0NGMruQLbeQl1voUsnWv/qEaPCzSZv4msdxh5x0/HeCN8aXQyR86niXgc4mQiSYiDt4
 E9Q/L5ENSfx44ZbKbMRrxg9Bs0z8JJ3F7ra7yJUdC/LWgIzLGJn6NAiF+ywD2CdBlYbO
 IUleBVZJwySCEyUWSX05R0sN6fAKDZG+M0ccAZdqBm1vcjvqJqkq2PuWvAd3wvz2C7FE
 XuoA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1763710067; x=1764314867;
 h=content-transfer-encoding:mime-version:message-id:date:user-agent
 :references:in-reply-to:subject:cc:to:from:x-gm-gg
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=NCReRqztDVaz2VS9BzMKbtuSgJlp4pRxgPC67SBd92U=;
 b=rVcv1823Ww6SH96NYxMjEmL1IGdaCfdPE43Uj27PD+PN7UMm3RziB0sb8ZGvC2gs5V
 d08h5W+huyf9Ky4DCh9pOSJSkXl5CwuQgDEWIB0+BoxM3mfdRRJsKSdWo//2DVHJRTga
 77t40vEB4vZbefwq601W9IxA+N1+7YLHBHo9zaVkuRdUTq7TRzJ9UG3MY3SgpiXNBuYK
 tMwj9b4GkjQSN6xYz0CkpYS6wN78i2QE2zye2EJ1Vj1ISQJHiLHXJ2si+WAvWR6MoGzz
 0To+Ak+RdbA3KiFNlw3jLar8YPM8/jMuHXczEPxjIXUB/CQgLrx7hN9v1TXtOGgo7zcY
 DTkQ==
X-Gm-Message-State: AOJu0Yx2iUkFHiiwhtw34fzZDFuAugTdFtgbn0lbq4zWNaRyCNnYl5UQ
 WPTfW2HNy3lt+M3zeqaDYw/Ad42Al/URa0pSjVhYK3T/+oBsgsgENhE=
X-Gm-Gg: ASbGncvqBgUk3MpAp3xr9NxitXBykydixCnclmblAlOhLZqBqS0d0hGrSwoIB8pZKcy
 H0iVH98wFh6pUlFejKzgJzRuH2OySIIJHbPmt4yksEcupQqxNTLYzweOZf6rZiy8ncDzogDTpTe
 MvgJdYKhXSsDzsEMZUTSel6tc+eSfhLTGVvf/UIEoqSOKJPZG72AEPLnocR8e8OP+1qJa/CH5Xn
 1QGVQFltFfvSCqyst57NlzEo0uilT0RiKnaE+J+pmGDJI/9w6VxaM4yDm/9VU8I94mlir7IoGIP
 hWj67w3kWjpEKgAjI9nb2dMR4OyWVGsYNF585+Xv9MS88GFfYicS9yTlAAMZA5QXOuMvQuytcYy
 BIHe+3+Z/2kv7W+cwu/2/0l393/4itcr+Ak2zDFq5cuwc1i6jMHIxfidGhykJREWeovCK8mktCZ
 /jZxmC3ABOzp7GRvNpP+I=
X-Google-Smtp-Source: AGHT+IEM/6xR/LY+Nm3gCDoCawIVaROYIdT+ciYZved8u3rhxk6j1wLLVvczF/Konsm2nkd5V5Dw4A==
X-Received: by 2002:a05:600c:1994:b0:477:7af8:c88b with SMTP id
 5b1f17b1804b1-477c01740e1mr11158105e9.11.1763710067073; 
 Thu, 20 Nov 2025 23:27:47 -0800 (PST)
Received: from localhost ([2a02:1748:dd5e:5d70:4f63:9d8d:e1fd:2d94])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-477bf1f3e63sm29129335e9.7.2025.11.20.23.27.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 20 Nov 2025 23:27:46 -0800 (PST)
From: Dominik Schrempf <dominik.schrempf@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#78209: 30.1; project-query-replace-regexp fails on a
 symlink to a directory
In-Reply-To: <5bc4ddbd-0964-48da-9d09-e5dfed1303ee@HIDDEN> (Dmitry Gutov's
 message of "Fri, 21 Nov 2025 04:33:16 +0200")
References: <aBSRykbzvZhPnNxv@HIDDEN> <87jyzvqawv.fsf@HIDDEN>
 <99e4a9b8-c9b9-414d-889b-66ac91aea08a@HIDDEN>
 <87h5uoeksd.fsf@HIDDEN>
 <5bc4ddbd-0964-48da-9d09-e5dfed1303ee@HIDDEN>
User-Agent: mu4e 1.12.13; emacs 30.2
Date: Fri, 21 Nov 2025 08:27:45 +0100
Message-ID: <87ms4flua6.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78209
Cc: 78209 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On Fri 21 Nov 2025 04:33:16 AM +02, Dmitry Gutov wrote:

> On 20/11/2025 18:22, Dominik Schrempf wrote:
>
>>> This is an important point.
>>>
>>> Could you describe the corresponding .gitignore entry in more detail? O=
r show a
>>> self-contained example.
>> I apologize for being so quiet, but I didn't observe the bug for a few
>> days now. This is a bit suspicious. Maybe it depends on the order how
>> the files are traversed?
>
> I don't think so. At least if you traverse the file list to the end, whic=
h you
> could do quickly, for example, by entering a search string that has no ma=
tches
> anywhere.
>
> The latest Emacs did have turned the error into a warning, so if you're
> following the master branch, you could be enjoying the benefits of that. =
But
> still it should pop up in the *Warnings* buffer.

Thanks a lot for your patience.

No, I am not on master.

>
>> For your reference, I have a project setup equivalent to
>>      $ tree -a
>>      .
>>      =E2=94=9C=E2=94=80=E2=94=80 .direnv
>>      =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 link-to-some-file=
-outside-the-project-dir-1
>>      =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 link-to-some-file=
-outside-the-project-dir-2
>>      =E2=94=94=E2=94=80=E2=94=80 .gitignore
>>      2 directories, 3 fil
>>      $ cat .gitignore
>>      /.direnv/
>
> I've tried that setup, and when such an entry is present in .gitignore,
> project-files correctly omits those symlinked files.
>
> You can also test this without project-query-replace-regexp but just using
> project-find-file (bound to 'C-x p f'): the files in question, being igno=
red,
> should not be in the list of completions.
>
> If you encounter the problem again, perhaps you could reduce it to a small
> directory, zip it up and upload somewhere. Or maybe you find more clues, =
that'll
> help.

I managed to reproduce the error in the original repository (and I can
do so reliably by using a unique string, see backtrace below), but I can
not create a minimal example. The backtrace is

Debugger entered--Lisp error: (file-error "Read error" "Is a directory" "/p=
ath/to/proj/examples/botan/botan/")
  insert-file-contents("/path/to/proj/examples/botan/botan/./" nil)
  fileloop-next-file(t)
  fileloop-continue()
  project-query-replace-regexp("alskdjflasjdlfkjasdf" "")
  funcall-interactively(project-query-replace-regexp "alskdjflasjdlfkjasdf"=
 "")
  command-execute(project-query-replace-regexp)

'examples/botan/botan' is a git submodule (and it is empty in my case, I
haven't checked it out)! (But in a minimal example I tried to come up
with, that git-submodule fact alone didn't trigger the error). What is
also a bit surprising is this './' at the end of the argument to
`insert-file-contents'.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78209; Package emacs. Full text available.

Message received at 78209 <at> debbugs.gnu.org:


Received: (at 78209) by debbugs.gnu.org; 21 Nov 2025 02:39:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 20 21:39:19 2025
Received: from localhost ([127.0.0.1]:51684 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vMH3O-0007Ho-VV
	for submit <at> debbugs.gnu.org; Thu, 20 Nov 2025 21:39:19 -0500
Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]:44873)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1vMH3M-0007H9-T3
 for 78209 <at> debbugs.gnu.org; Thu, 20 Nov 2025 21:39:17 -0500
Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41])
 by mailfhigh.stl.internal (Postfix) with ESMTP id 751B17A01E6;
 Thu, 20 Nov 2025 21:39:11 -0500 (EST)
Received: from phl-mailfrontend-02 ([10.202.2.163])
 by phl-compute-01.internal (MEProxy); Thu, 20 Nov 2025 21:39:11 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :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:subject:subject:to:to; s=fm2; t=1763692751;
 x=1763779151; bh=P345FUb2CIeYlugMXpWdVxI0tCpxs+zZbuGnd92ET40=; b=
 h9bCjb1e2aRt6JFJe2WcIpn4dK9oBfLnPyz+6pe4QER4kvauLHAejdgLXnJZINzK
 d+C8s43zd+dxVkhxVAxbCTAyT8/0xnT0QT23G0W5S00u3m+wUKMuyRxY/EUBntlC
 /ppjdFDaMqAYMJI2FlR5Seqj4hZTUTczh7vYJRjbtZ6NJrMTPxfBfwJbqLFKpZ1+
 DwrTLEWI89vjxzc4uwHsuSHYUOaHbB6wG6+n2tI3GaQMc+CBzDXHB05j4JnrH/an
 DLfYQgmIQ1Z79tQ/OjPZr6ayRYTj5eZi8r+NtxpUzx/02c/eQfpwrslWpqqeEVpJ
 XOba1bCRgUk9qlUc8q9OnQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc: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:subject:subject:to:to:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1763692751; x=
 1763779151; bh=P345FUb2CIeYlugMXpWdVxI0tCpxs+zZbuGnd92ET40=; b=R
 i7HhvYkKXeA2N8Jq9Fj9lKdlYHuga9ITlFiql4+jTlF1tRaNdjRZF6COBESPZL3b
 qZsWMTnskNyll4STa4OfPtTeMEXDvlxXMesUzwH9peRbU+Yuzjs7oYRE0LdjxPPD
 W6oQr2PaUNsjsHBqtJbkLT1knycAuVkiKn+EWtCoWr/d/VlrcPyFMVIA1BGCeDDN
 IEF8HsZS/dXfkHZXXhZvLlZ43SAUXI7lNE+VKUDWixup5DE7CfZTZep5gwLGtLlg
 F2KSzHrk4TQ0Q4Mv11u5YvR1eZqOn/gRsFk3oWe1uS3jDhE+1SVuQ5VpFnPH8dCV
 tQoRoNRJMO/pSO6sw5+3w==
X-ME-Sender: <xms:ztAfaS14ZQlAGQy9eWR1Osfpl5_DpRSBFGoYBhZVGvNC0_DYss2BJw>
 <xme:ztAfaS6nyNLpDXXQ6jL43vmVBXb5TeVmtSkVN-tx7EepPqGUDUlUqhIipl_qeZDef
 Ot9c1wkmB2jHx55zpQ673YophlN5n3EvQA1v6njvaGwCBc4SkiLW7E>
X-ME-Received: <xmr:ztAfaVW4S7V0XBdyF_OvR3wyiOndRV-d1WqsI-LcgDVNtiWW8uvgxTdD1HCA6iApNA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvvdekjeekucetufdoteggodetrf
 dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu
 rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf
 gurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhithhr
 hicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrthhtvg
 hrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedujeeh
 necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmih
 htrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhp
 ohhuthdprhgtphhtthhopehmohhnnhhivghrsehirhhordhumhhonhhtrhgvrghlrdgtrg
 dprhgtphhtthhopehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgdprhgt
 phhtthhopeguohhmihhnihhkrdhstghhrhgvmhhpfhesghhmrghilhdrtghomhdprhgtph
 htthhopeejkedvtdelseguvggssghughhsrdhgnhhurdhorhhg
X-ME-Proxy: <xmx:ztAfaRAozCtUVApmGDj5ekRQezG5VAQuipbMDkmwz6hRDqVHOD33pg>
 <xmx:ztAfaU6ClmhXcV1IcTJ7KZvcTmpKT1WDp9zHgOweU3lFQpwmzBiolQ>
 <xmx:ztAfacx1PKDmHXLI08qwlkr65DigBEDYw2w1nk607aA1GHmfZRPXFw>
 <xmx:ztAfabwCtq5lmvaxfgXXm3wuCKkdykRF8Fn2UFch5pob1N6gSfgNZw>
 <xmx:z9AfaSGKbkYcfpW_K37omWJwI6uzi0g9cHXRULbToOvH4q7WE4u2FLwN>
Feedback-ID: i07de48aa:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 20 Nov 2025 21:39:09 -0500 (EST)
Message-ID: <3d1e9168-6879-4d9b-8785-81945b006d0e@HIDDEN>
Date: Fri, 21 Nov 2025 04:39:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#78209: 30.1; project-query-replace-regexp fails on a symlink
 to a directory
To: Stefan Monnier <monnier@HIDDEN>
References: <aBSRykbzvZhPnNxv@HIDDEN> <87jyzvqawv.fsf@HIDDEN>
 <87bjkz8jep.fsf@HIDDEN>
 <jwv5xb7pd80.fsf-monnier+emacs@HIDDEN>
 <77b38a17-ff61-4e75-8ac8-f65bb7f6fa1b@HIDDEN>
 <jwvpl9em9mp.fsf-monnier+emacs@HIDDEN>
Content-Language: en-US
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <jwvpl9em9mp.fsf-monnier+emacs@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 78209
Cc: Dominik Schrempf <dominik.schrempf@HIDDEN>, 78209 <at> debbugs.gnu.org,
 Sean Whitton <spwhitton@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 19/11/2025 15:39, Stefan Monnier wrote:
>>> IOW, I suspect the problem is in `project.el`, more specifically
>>> `project-files` or `project-query-replace-regexp` which should skip
>>> symlinks that don't point to a file, or maybe even skip all symlinks
>>> (after all, if it points outside of the project then we shouldn't
>>> visit it, and if it points inside the project, then we'll visit it
>>> via its non-symlink name already).
>>
>> It seems like it can be expensive to do that inside 'project-files'
>> (e.g. calling file-regular-p on every item in the returned list, eagerly).
> 
> Indeed, I don't think all callers of `project-files` would like that, so
> it would have to be optional.  the case of
> `project-query-replace-regexp`, the operation needs to do a lot more
> than test the symlink-ness of every file anyway, so an extra
> `file-regular-p` or `file-symlink-p` should be lost in the noise.
> 
> At most, one might need to do the test lazily rather than test all the
> files before even calling `fileloop-initialize`, but other than that the
> performance impact should be negligible.

Right, but the existing helpers fileloop-initialize-search and 
fileloop-initialize-replace don't have a per-file argument (yet?). We 
could do that using lower level functions from fileloop, probably.

Anyway, that is if we decide to support symlinked files or directories 
that don't have corresponding .gitignore entries. But in that case their 
status is a little dubious, as you noted.

>> But note my previous email, regarding symlinks being in .gitignore.
> 
> Indeed, my understanding is that `project-files` should not include the
> ignored files at least when called for `project-query-replace-regexp`.
> The docstring clearly says:
> 
>      PROJECT is used to find the list of ignores for each directory.

Yep yep.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78209; Package emacs. Full text available.

Message received at 78209 <at> debbugs.gnu.org:


Received: (at 78209) by debbugs.gnu.org; 21 Nov 2025 02:33:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 20 21:33:29 2025
Received: from localhost ([127.0.0.1]:51642 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vMGxk-0006qQ-Mh
	for submit <at> debbugs.gnu.org; Thu, 20 Nov 2025 21:33:29 -0500
Received: from fhigh-b6-smtp.messagingengine.com ([202.12.124.157]:59449)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1vMGxi-0006pj-5Y
 for 78209 <at> debbugs.gnu.org; Thu, 20 Nov 2025 21:33:27 -0500
Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51])
 by mailfhigh.stl.internal (Postfix) with ESMTP id 5A3D37A0286;
 Thu, 20 Nov 2025 21:33:20 -0500 (EST)
Received: from phl-mailfrontend-02 ([10.202.2.163])
 by phl-compute-11.internal (MEProxy); Thu, 20 Nov 2025 21:33:20 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :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:subject:subject:to:to; s=fm2; t=1763692400;
 x=1763778800; bh=EbVWbll1UKp+zu6n7+T06edDGfJh5QYq2FY2mRi9yq8=; b=
 kXnrUqgCqhckvI41a0UwleNpyHUaC2G4rFnfseqpWMIDhWSsw9i30zmrzKoTelnG
 3vn0hWGc62ymDhN1fUz5WqCWDpHBpTzF3HuHG0yEW120+5tvCtdiGdJEUT7NnIJb
 pZbG1f7SWnbHOWyfuLsQ40SXq7P/ZymyPN4jcnURrYuXuIO5+fzTFMIn+Az98r0a
 DmOBdxmhIDiLRPqwR5VXRN5euX6EvOwFWfgBqRZ12QgdcDFJO/zgNbVSNGYynvYK
 uv6oXM7Gwntn8K066FrsrTCKdGbdxAbfAHq9OWlwu9tZLY7EjiRE+3Wy5qW1XUnl
 jfWJjrg+nr+kaWYohvBreA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc: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:subject:subject:to:to:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1763692400; x=
 1763778800; bh=EbVWbll1UKp+zu6n7+T06edDGfJh5QYq2FY2mRi9yq8=; b=w
 gn3yQlJfIc+BDovuOnjVLxTBUQDU0TBW0ti79O9WVl1VbXae9ewVTKo3lES8fSIX
 urR2iXF4Nk4V8uhj1sPKZJRe2RMOb0sFfg+F3ScUkToLqJPiz/9KGrX8BC1AgV40
 TYoqJbEauvJV+WGaatBnpqL4SDB/UmlvEw+b9ocPBxd82lo+dX9PQC4SWJKw2/zz
 5eLqyysfgDpiD7ukUGllPzCbLZQNnvwchuidJcYcg4vnjPSMJbXx4lIPbYgFlRcI
 PlZDk4wn/eox5uoHtd3BJ1INDztfFHDG3u1shrgi0NS2pynlbICbdOhrtog23N2f
 7hhvSgcXIDkTF3V9ErGaw==
X-ME-Sender: <xms:b88fadNs2FCW8JEUjiE-huCkqWkfIT8YupsSZpBVNEdiaqOeRBcn8Q>
 <xme:b88faV-HAwP4muMQ2d-jyXe3l_NnJTRudbH3RfdWD1PD9JYRNcxjT6zlxWEJzqUtP
 h92morNEJO31uMH1vj6wfbss3agbvsUEdWxFRTr_5Z8onfVvUgoGQM>
X-ME-Received: <xmr:b88faZ7z_NVZhsthPxzpOXEzjz_slF_BHJvqjv_78uYtwbRO563MxuV8lHkcrzCJIw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvvdekjeeiucetufdoteggodetrf
 dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu
 rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf
 gurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeffmhhithhr
 hicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrthhtvg
 hrnhepgeelfeetkefghfdvhfdtgeevveevteetgeetveegtedthefhudekteehffeukeek
 necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmih
 htrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhp
 ohhuthdprhgtphhtthhopeguohhmihhnihhkrdhstghhrhgvmhhpfhesghhmrghilhdrtg
 homhdprhgtphhtthhopeejkedvtdelseguvggssghughhsrdhgnhhurdhorhhg
X-ME-Proxy: <xmx:b88faU33FSE3Z1E7LUaTa_prjfGKapz3ayvgWHuCmn7tC3DczzNhPw>
 <xmx:b88faYD3S32189P7vNwJ7BWZplJHPcOs7VuDrbWe6y_xLPuSUpMmDw>
 <xmx:b88fae1MTWHGPRqAit0r08pbNKsXOaHlNOpc7hfpacOBkPGFvDVzuA>
 <xmx:b88faathFy2Nz01YsFe80mORdSj5AuqmbvmQ39PXJb4igfOYk6Jm3A>
 <xmx:cM8fabKo35NwHJ2HqQn2B3utsJ4KWHPAjhwNmLs8G2dktjocSssNOG_w>
Feedback-ID: i07de48aa:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 20 Nov 2025 21:33:18 -0500 (EST)
Message-ID: <5bc4ddbd-0964-48da-9d09-e5dfed1303ee@HIDDEN>
Date: Fri, 21 Nov 2025 04:33:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#78209: 30.1; project-query-replace-regexp fails on a symlink
 to a directory
To: Dominik Schrempf <dominik.schrempf@HIDDEN>
References: <aBSRykbzvZhPnNxv@HIDDEN> <87jyzvqawv.fsf@HIDDEN>
 <99e4a9b8-c9b9-414d-889b-66ac91aea08a@HIDDEN> <87h5uoeksd.fsf@HIDDEN>
Content-Language: en-US
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <87h5uoeksd.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 78209
Cc: 78209 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 20/11/2025 18:22, Dominik Schrempf wrote:

>> This is an important point.
>>
>> Could you describe the corresponding .gitignore entry in more detail? Or show a
>> self-contained example.
> 
> I apologize for being so quiet, but I didn't observe the bug for a few
> days now. This is a bit suspicious. Maybe it depends on the order how
> the files are traversed?

I don't think so. At least if you traverse the file list to the end, 
which you could do quickly, for example, by entering a search string 
that has no matches anywhere.

The latest Emacs did have turned the error into a warning, so if you're 
following the master branch, you could be enjoying the benefits of that. 
But still it should pop up in the *Warnings* buffer.

> For your reference, I have a project setup equivalent to
> 
>      $ tree -a
>      .
>      ├── .direnv
>      │   ├── link-to-some-file-outside-the-project-dir-1
>      │   └── link-to-some-file-outside-the-project-dir-2
>      └── .gitignore
> 
>      2 directories, 3 fil
> 
>      $ cat .gitignore
>      /.direnv/

I've tried that setup, and when such an entry is present in .gitignore, 
project-files correctly omits those symlinked files.

You can also test this without project-query-replace-regexp but just 
using project-find-file (bound to 'C-x p f'): the files in question, 
being ignored, should not be in the list of completions.

If you encounter the problem again, perhaps you could reduce it to a 
small directory, zip it up and upload somewhere. Or maybe you find more 
clues, that'll help.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78209; Package emacs. Full text available.

Message received at 78209 <at> debbugs.gnu.org:


Received: (at 78209) by debbugs.gnu.org; 20 Nov 2025 16:22:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Nov 20 11:22:37 2025
Received: from localhost ([127.0.0.1]:49178 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vM7Qa-00014p-Pd
	for submit <at> debbugs.gnu.org; Thu, 20 Nov 2025 11:22:37 -0500
Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:45473)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <dominik.schrempf@HIDDEN>)
 id 1vM7QY-00014K-NN
 for 78209 <at> debbugs.gnu.org; Thu, 20 Nov 2025 11:22:35 -0500
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-640b06fa959so1775756a12.3
 for <78209 <at> debbugs.gnu.org>; Thu, 20 Nov 2025 08:22:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1763655748; x=1764260548; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:user-agent
 :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=WjuVL3xtnoyoqfPjO6iKqLzZfOM2/t2h+ebjVM3s4ds=;
 b=XPuc2n4xDRSgICod1juqkd6V17FeDNF121uoYrbJs+eWP15jAmFyFL0+1SfiL9GczB
 PShDV7Bjk8xxywoVCm4l/l2pmSQ5MJ+WNmBZOthXDvk9m0ACXCWwaAah5smy4T4dlsge
 +ZrtyaQG1PsUY8ZmtW1ZnX7UpLnurWiw1mIP41Z/0rY/x87gblVW2WTrcXHhE6Lc0he0
 3Md+vYMfLGxPC+xKTfm//qJGPLGctlfuced+TElJYjuQY6111hp8fn/nRsC/XmEX1HpO
 /x3MFDA9N/akatGo5HyscaRk/S2MsvwO1Y8Moi74rJSz6Lh/hIW0qcUZSRzmFIZzlLUV
 zG1A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1763655748; x=1764260548;
 h=content-transfer-encoding:mime-version:message-id:date:user-agent
 :references:in-reply-to:subject:cc:to:from:x-gm-gg
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=WjuVL3xtnoyoqfPjO6iKqLzZfOM2/t2h+ebjVM3s4ds=;
 b=CvMjWgINUVHxDXaE4sYwd4HXxVxI7hDGUKtrooV1gU09pB1+ZSFm4LK2nk7f7LIkIF
 mA3Ea273Vv6293FngHO15Uigy/m4RQur+Xo+sgl+518Lk+rX3Os1lFdaYNPnDWDaVyPn
 u8SqfcidnCAQ8DQpnEIW4y5B3FYo4qhDepfqNQmC4oS3tVU5KpuGHnQn/kNBBoIwI3V4
 /iq4sGs3z5I1ztlTHiisMs7FtwE1TFX5rEIFYgqyBBzUWMl//OuprhrW+m/eoeFdEYpz
 zOfIlPF0Xn6xn8tH+plzgF43dTuxYTFqOYdniNbSPffJqlas+XrBGwUN+CUz6013623F
 HXKg==
X-Gm-Message-State: AOJu0YwDLyebfOuDQlzQVP3CQNn2hd6BTwrOJIaXmVHNq8UH+iEVccvT
 6+y5RKQDimZjaqDJ3gCwzQvLUKayh7qq6/Duw//MORkQZ0E13I7TirD9CM3D
X-Gm-Gg: ASbGncsjpi3W9t+/wyznIkaCJUjeoNnLWHkSBPtW3/vkQuCO42URMoJEeTFPE1/+zNV
 oq2x1i/GtjWBeMa8W1+Io4YK3/tXOC6TU2L0nb6vTjB3wP6jjT2MGkJXgbam9WiR2ppo6bpZ0ye
 0k5h0S1+KSAJGxJSlCYKszgJffZcKpj+lggyUzvH9YdhA2Mvo1bMB06xGsMpkDQiwLLroHl5NnD
 kG3fIEiRUBpLUo0Gyco9gRgUCaIFzTWEKCPn+DGiukCZ69BUbRQsh5pPwSgQUJmjgji4kQ6Swwi
 JMdarWLdc1u+3ORfSM7w/y2ylBGmmKPUpHHXQSkyleoT4J8MNneyb9b2hGplmP0ngfX47D18BDs
 Whro0KMzfVuPaY7F2p2gcqOWzkDfJs34CSVSkK7qy5GulSfK8t7bbJyQMTLvcSVl/UVDE9qAgU/
 3jzARJnmeg2uP2Rvba
X-Google-Smtp-Source: AGHT+IFn+bb/6IJ9g8CtG1vd7aVDZCr9jLVJC8UpqDWKlmx5jqzCr8ega9/w78/bIlKulP+c8vGWjw==
X-Received: by 2002:a17:906:c107:b0:b2b:3481:93c8 with SMTP id
 a640c23a62f3a-b76587b1c55mr327366966b.19.1763655748008; 
 Thu, 20 Nov 2025 08:22:28 -0800 (PST)
Received: from localhost ([2a02:1748:dd5e:5d70:3618:8e9b:803a:4b4])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-b7654cdab19sm256571566b.10.2025.11.20.08.22.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 20 Nov 2025 08:22:27 -0800 (PST)
From: Dominik Schrempf <dominik.schrempf@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#78209: 30.1; project-query-replace-regexp fails on a
 symlink to a directory
In-Reply-To: <99e4a9b8-c9b9-414d-889b-66ac91aea08a@HIDDEN> (Dmitry Gutov's
 message of "Wed, 19 Nov 2025 04:22:54 +0200")
References: <aBSRykbzvZhPnNxv@HIDDEN> <87jyzvqawv.fsf@HIDDEN>
 <99e4a9b8-c9b9-414d-889b-66ac91aea08a@HIDDEN>
User-Agent: mu4e 1.12.13; emacs 30.2
Date: Thu, 20 Nov 2025 17:22:26 +0100
Message-ID: <87h5uoeksd.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78209
Cc: 78209 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi!

On Wed 19 Nov 2025 04:22:54 AM +02, Dmitry Gutov wrote:

> Hi!
>
> On 12/11/2025 22:00, Dominik Schrempf wrote:
>> The file is a symlink, and the directory is ignored by git. (Should we r=
eplace also in git-ignored files)?
>
> This is an important point.
>
> Could you describe the corresponding .gitignore entry in more detail? Or =
show a
> self-contained example.

I apologize for being so quiet, but I didn't observe the bug for a few
days now. This is a bit suspicious. Maybe it depends on the order how
the files are traversed?

For your reference, I have a project setup equivalent to

    $ tree -a
    .
    =E2=94=9C=E2=94=80=E2=94=80 .direnv
    =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 link-to-some-file-out=
side-the-project-dir-1
    =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 link-to-some-file-out=
side-the-project-dir-2
    =E2=94=94=E2=94=80=E2=94=80 .gitignore

    2 directories, 3 fil

    $ cat .gitignore
    /.direnv/

Best,
Dominik

>
> At least in basic testing, I see such an entry being honored, with projec=
t-files
> not including the (ignored) symlink in its return value.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78209; Package emacs. Full text available.

Message received at 78209 <at> debbugs.gnu.org:


Received: (at 78209) by debbugs.gnu.org; 19 Nov 2025 13:39:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 19 08:39:31 2025
Received: from localhost ([127.0.0.1]:37089 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vLiPC-00079y-Qr
	for submit <at> debbugs.gnu.org; Wed, 19 Nov 2025 08:39:31 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:44276)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1vLiP9-00079U-NO
 for 78209 <at> debbugs.gnu.org; Wed, 19 Nov 2025 08:39:28 -0500
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 99748441571;
 Wed, 19 Nov 2025 08:39:21 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1763559560;
 bh=fp8gyPx83+EHgD5I9RHi2mMGyrFKk2MGV/JLx11cu6g=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=AHgM2mBNxKJM5pZIO8jb7Ia/HTlnZAZxZOtyns41xEHZxxyqZ3T+LuVqm9TLqJcH0
 NwkZyvGJexfX7X3LC1vYhAY8qLVDcW+DFDwtpg/1FHPQ8PAvc3kc0m2DO6q0N04moO
 kYirTGzJQfaA9jwjhX4WAVyuWiAHHJTQDJqLXuFkNUhmH6nqAUFpEFIZeLe4eGETqZ
 yHTk0JLclpY8dGqWrhH05typ3VTK35ysVRZ/OlvTMBHcc4eCO3pIIWvpjWCrrJbXXa
 qP5iV9MpTVWAcMb+Q81BP+byNVssQuJgIlD9TyMgPkPGw6D1sKEsx0n5oxeG34OHCD
 tZK+5LxlJBskA==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 798C3442022;
 Wed, 19 Nov 2025 08:39:20 -0500 (EST)
Received: from asado (unknown [181.28.45.30])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id BD22C12046C;
 Wed, 19 Nov 2025 08:39:18 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Dmitry Gutov <dmitry@HIDDEN>
Subject: Re: bug#78209: 30.1; project-query-replace-regexp fails on a
 symlink to a directory
In-Reply-To: <77b38a17-ff61-4e75-8ac8-f65bb7f6fa1b@HIDDEN>
Message-ID: <jwvpl9em9mp.fsf-monnier+emacs@HIDDEN>
References: <aBSRykbzvZhPnNxv@HIDDEN> <87jyzvqawv.fsf@HIDDEN>
 <87bjkz8jep.fsf@HIDDEN>
 <jwv5xb7pd80.fsf-monnier+emacs@HIDDEN>
 <77b38a17-ff61-4e75-8ac8-f65bb7f6fa1b@HIDDEN>
Date: Wed, 19 Nov 2025 08:39:14 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.123 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 78209
Cc: Dominik Schrempf <dominik.schrempf@HIDDEN>, 78209 <at> debbugs.gnu.org,
 Sean Whitton <spwhitton@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

>> IOW, I suspect the problem is in `project.el`, more specifically
>> `project-files` or `project-query-replace-regexp` which should skip
>> symlinks that don't point to a file, or maybe even skip all symlinks
>> (after all, if it points outside of the project then we shouldn't
>> visit it, and if it points inside the project, then we'll visit it
>> via its non-symlink name already).
>
> It seems like it can be expensive to do that inside 'project-files'
> (e.g. calling file-regular-p on every item in the returned list, eagerly).

Indeed, I don't think all callers of `project-files` would like that, so
it would have to be optional.  the case of
`project-query-replace-regexp`, the operation needs to do a lot more
than test the symlink-ness of every file anyway, so an extra
`file-regular-p` or `file-symlink-p` should be lost in the noise.

At most, one might need to do the test lazily rather than test all the
files before even calling `fileloop-initialize`, but other than that the
performance impact should be negligible.

> And it looks like now, with bug#79356 resolved, at least in Emacs 31+
> symlinks won't stop the replacement in all other, regular files. They'll
> just show up in the *Warnings* buffer.

Good.

> But note my previous email, regarding symlinks being in .gitignore.

Indeed, my understanding is that `project-files` should not include the
ignored files at least when called for `project-query-replace-regexp`.
The docstring clearly says:

    PROJECT is used to find the list of ignores for each directory.


- Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78209; Package emacs. Full text available.

Message received at 78209 <at> debbugs.gnu.org:


Received: (at 78209) by debbugs.gnu.org; 19 Nov 2025 02:26:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 18 21:26:56 2025
Received: from localhost ([127.0.0.1]:32904 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vLXuJ-0004ih-GL
	for submit <at> debbugs.gnu.org; Tue, 18 Nov 2025 21:26:56 -0500
Received: from fhigh-b1-smtp.messagingengine.com ([202.12.124.152]:44533)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1vLXuH-0004hq-3E
 for 78209 <at> debbugs.gnu.org; Tue, 18 Nov 2025 21:26:53 -0500
Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43])
 by mailfhigh.stl.internal (Postfix) with ESMTP id A2C7E7A00D2;
 Tue, 18 Nov 2025 21:26:47 -0500 (EST)
Received: from phl-mailfrontend-02 ([10.202.2.163])
 by phl-compute-03.internal (MEProxy); Tue, 18 Nov 2025 21:26:47 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :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:subject:subject:to:to; s=fm2; t=1763519207;
 x=1763605607; bh=kpfcImbHUaN0F5pvpQ/PPIYsJvF9gZPlgp1OBOyNYcI=; b=
 fgaf6Ee7d8lIzTES86Udju87DRFL84sGC5HUnJE6lm7mXirW77HpvkH9uAcauE0f
 CD03vR3kpaMQk4NlSDfo9kSLVnZOSM8Nme9+3M7+ECKYdCzEpMa7Zre0hpU/Ewdw
 nc76CJZNBFinNqMbDQFB51e2t5d47eySHReIP/69sSwdcG6yV6zwg9+BNSpNomyY
 /mmpTWdvWTYXrV61BQ+VBACGxJHfbXeBYhpDQQy/s0Bllb2FZjIqnWpdyND4rMo9
 3m5MKQE0f74aTAMmBpEn0LxGo4ffUQxJkP1E7qFNnDNwb+iV6lHS545sz6vpfF/E
 bvu7czOXCQHUwKYswj+aZA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc: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:subject:subject:to:to:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1763519207; x=
 1763605607; bh=kpfcImbHUaN0F5pvpQ/PPIYsJvF9gZPlgp1OBOyNYcI=; b=k
 aUlV9IkqrwqP+jpqL8bXR+b0QAhmtQDtSRFFCAP2dGIUZgJIY1hsc7HtyTzWTX9h
 yVHQUw3DCMhjsEaymWZYgO/MffIj/yIeuO0Sv2D0jvRQG4lHC71gnff4EF7fjslG
 sL+VMMqGHx0TcFHqfgjJ1K9y7e7mVuGA9mAObwPWQWWbcWMQuMlhe1Pv5btQEsGo
 F6C9bFwcahMMx6GB4BQ6vyis5t2N6W3wb3dkfX+CCS+3vNShQI21z1WbpBU696Xr
 S4np1H4ad17L1wWjxCmXqo8hOGXDtaPDfwLAU1yxl6/JuuCvOMIZLiL+W5oJhgfz
 p5tkSNIhO/BSA/t/AlTkQ==
X-ME-Sender: <xms:5yodaR_o6xz_3yMGHeFBH-MDB-NCktrbCuQ1_3YItvdEdQxFP569Tw>
 <xme:5yodaTi9sfpCcapSEMKocGl6K7wIbVipUZAaADfZtcPh2LqG3hnlZylnCqGHU11dE
 M2EtK3Jr63-tW7zVRLC08CnQH_XcpUH6GpF2uJLm_CKJbsba9L73IU>
X-ME-Received: <xmr:5yodaZcWjxq5Ac_8kdR-W0abqXslWNlJBWQ6TSxr2HpER2Sqhkd7uV_T8pkcD5wcsmR0>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvvdeftddtucetufdoteggodetrf
 dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu
 rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf
 gurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeffmhhithhr
 hicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrthhtvg
 hrnhepteduleejgeehtefgheegjeekueehvdevieekueeftddvtdevfefhvdevgedujeeh
 necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepughmih
 htrhihsehguhhtohhvrdguvghvpdhnsggprhgtphhtthhopeegpdhmohguvgepshhmthhp
 ohhuthdprhgtphhtthhopehmohhnnhhivghrsehirhhordhumhhonhhtrhgvrghlrdgtrg
 dprhgtphhtthhopehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvgdprhgt
 phhtthhopeguohhmihhnihhkrdhstghhrhgvmhhpfhesghhmrghilhdrtghomhdprhgtph
 htthhopeejkedvtdelseguvggssghughhsrdhgnhhurdhorhhg
X-ME-Proxy: <xmx:5yodaSqWAvFHc3p-BMBzZK65-tJh_6kLTATHOwvw0wEcepY6qOfabA>
 <xmx:5yodaWC_plNDXtn0-N9dPqVUp0VzhFUwvi4VgTTaWfP6BZ7BXAydLQ>
 <xmx:5yodaXainDU0JqzG3MEW5CO94OWnx6zhaK7wdUmXNhnsFPo-TaAa3Q>
 <xmx:5yodaR7DgUnc2IBWSDFQXvxvrgZkanbxq63PepMfV-MHFKhDNNtm4w>
 <xmx:5yodaWND7qeWy1VlRBfZZXQ1orCd3yKvlZvki4ENLYMvv0NNoUUrRUKK>
Feedback-ID: i07de48aa:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 18 Nov 2025 21:26:45 -0500 (EST)
Message-ID: <77b38a17-ff61-4e75-8ac8-f65bb7f6fa1b@HIDDEN>
Date: Wed, 19 Nov 2025 04:26:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#78209: 30.1; project-query-replace-regexp fails on a symlink
 to a directory
To: Stefan Monnier <monnier@HIDDEN>,
 Sean Whitton <spwhitton@HIDDEN>
References: <aBSRykbzvZhPnNxv@HIDDEN> <87jyzvqawv.fsf@HIDDEN>
 <87bjkz8jep.fsf@HIDDEN>
 <jwv5xb7pd80.fsf-monnier+emacs@HIDDEN>
Content-Language: en-US
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <jwv5xb7pd80.fsf-monnier+emacs@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 78209
Cc: Dominik Schrempf <dominik.schrempf@HIDDEN>, 78209 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 18/11/2025 17:40, Stefan Monnier via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> IOW, I suspect the problem
> is in `project.el`, more specifically `project-files` or
> `project-query-replace-regexp` which should skip symlinks that don't point
> to a file, or maybe even skip all symlinks (after all, if it points
> outside of the project then we shouldn't visit it, and if it points
> inside the project, then we'll visit it via its non-symlink name
> already).

It seems like it can be expensive to do that inside 'project-files' 
(e.g. calling file-regular-p on every item in the returned list, eagerly).

And it looks like now, with bug#79356 resolved, at least in Emacs 31+ 
symlinks won't stop the replacement in all other, regular files. They'll 
just show up in the *Warnings* buffer.

But note my previous email, regarding symlinks being in .gitignore.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78209; Package emacs. Full text available.

Message received at 78209 <at> debbugs.gnu.org:


Received: (at 78209) by debbugs.gnu.org; 19 Nov 2025 02:23:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 18 21:23:07 2025
Received: from localhost ([127.0.0.1]:32860 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vLXqd-0004O5-IE
	for submit <at> debbugs.gnu.org; Tue, 18 Nov 2025 21:23:07 -0500
Received: from fhigh-b1-smtp.messagingengine.com ([202.12.124.152]:43713)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dmitry@HIDDEN>) id 1vLXqb-0004NC-3Z
 for 78209 <at> debbugs.gnu.org; Tue, 18 Nov 2025 21:23:05 -0500
Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44])
 by mailfhigh.stl.internal (Postfix) with ESMTP id 6C1117A0134;
 Tue, 18 Nov 2025 21:22:59 -0500 (EST)
Received: from phl-mailfrontend-02 ([10.202.2.163])
 by phl-compute-04.internal (MEProxy); Tue, 18 Nov 2025 21:22:59 -0500
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:subject:subject:to:to; s=fm2; t=1763518979;
 x=1763605379; bh=mKn85ITctCjzgdkIuxAd2G1vD20ca/eU13G1eHXYe+o=; b=
 JskryeqZZX0OmTTEeUEaoooIUQGebx0p1r4gX/rep35w57dxK3+m6NDzFMaXcQ00
 y6xJxQtni54gnKu5NXsne9HZPLIlgCssMf0uZ+H/93IKfN8BeV0dI1lYQgwNanpT
 QIWgqAddBawgbLBl3QmW/FW+BkDPvc9g6/d2vmlbsM65fjsYNxBS6Jw8kp+0SpKR
 /q8MPJ8I7lPT4vqCEuME2duIgLMrJWIJUdVe5S8Qsj28Zv1n4q+5wfetUWYDJ27u
 KayWr0nn8AGyxcegvG8YhiFW+25OuavCT5RCw5pvVbeMsE57fLscfbnn1UvenI8p
 vOuiYiH3sD0P+Qsx1LQuNw==
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:subject:subject:to:to:x-me-proxy:x-me-sender
 :x-me-sender:x-sasl-enc; s=fm3; t=1763518979; x=1763605379; bh=m
 Kn85ITctCjzgdkIuxAd2G1vD20ca/eU13G1eHXYe+o=; b=cVbgrxbFTWVSssOXd
 Kxl5JIgTVZea+LjgCmQ6Lg1Q32YMI5H7Maxy0wq0UjspL59kTiSXMeMVa8u5Z9tw
 buJEmX5Zf5rkgdrI+LG1jl/0KhNw7DodmrDh2wV5QCcB7yYoKuZLIKXKpoCa/Clz
 gs+qGiAwQHe/Y7Wa265xA9m6pZaaWODFYK6tjAlW5wmhm9/ube1eVEIzCc3frymW
 N0qh5eI20LeDJmVqCfrODCt1pQhEn/3mh27djm5kpkHKmL56cLand1BpDaPXcr54
 vXwts/Z+E0G67PUFn2Bw5yUtdqIn+l5un2MLPgXnExVrbsYbeNnfii4+sGmD1OMk
 kBqxg==
X-ME-Sender: <xms:AiodaXLsOc5ySw3m3TtuhjXWq3q3s7fOUFjzN6fLTqEypjJc03KYzQ>
 <xme:AiodaRK4w4Zpe2CidhHWjsKJuKvM5D57VmkPDYC9je5Iq0StC4hGpXKNh5yNFIktw
 gJgRqwi1G_0L0ATSqqpBM2c__RKKNrwZLM7nxSO2dcJPqUNFzHrOb8>
X-ME-Received: <xmr:AiodadWBlrkKrE-VjuqqaBELuIWkD3lPCBvcpzjHdp2JijKPjzhh4sHacX37A5CHbngE>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvvddvleekucetufdoteggodetrf
 dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu
 rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf
 gurhepkfffgggfuffvfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhmihhtrhih
 ucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtthgvrh
 hnpedthfeuvddtveelgeeuleevvdejveehffevveehvdeuffdtfefhvdeugefgtefgtden
 ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumhhith
 hrhiesghhuthhovhdruggvvhdpnhgspghrtghpthhtohepvddpmhhouggvpehsmhhtphho
 uhhtpdhrtghpthhtohepughomhhinhhikhdrshgthhhrvghmphhfsehgmhgrihhlrdgtoh
 hmpdhrtghpthhtohepjeekvddtleesuggvsggsuhhgshdrghhnuhdrohhrgh
X-ME-Proxy: <xmx:Aiodabju8MsjS5tkpNeYjuc5XzYLyAYYYm9V5APjuWBo_nFcA4ac8A>
 <xmx:AiodaQ9yddfeCiJXHDhaO9usmJeezpTyIo82UN6F-ZZos4wGECNROA>
 <xmx:AiodadD15gYFsRCL6Lj_fLuy8-XFnHOeFz2q9BGphZJ5Xl2Z62xL-A>
 <xmx:AiodaVI8hEht39wnxLt66ffnkSrmM0B7Jjka0IMgtHUv9UqiIPYBkg>
 <xmx:AyodaenF34XmGuZ1vv-fU8w4BPgPldlw4rkClfPn_kfTBz3ceP_onQwd>
Feedback-ID: i07de48aa:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 18 Nov 2025 21:22:57 -0500 (EST)
Message-ID: <99e4a9b8-c9b9-414d-889b-66ac91aea08a@HIDDEN>
Date: Wed, 19 Nov 2025 04:22:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#78209: 30.1; project-query-replace-regexp fails on a symlink
 to a directory
To: Dominik Schrempf <dominik.schrempf@HIDDEN>, 78209 <at> debbugs.gnu.org
References: <aBSRykbzvZhPnNxv@HIDDEN> <87jyzvqawv.fsf@HIDDEN>
Content-Language: en-US
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <87jyzvqawv.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 78209
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi!

On 12/11/2025 22:00, Dominik Schrempf wrote:
> The file is a symlink, and the directory is ignored by git. (Should we replace also in git-ignored files)?

This is an important point.

Could you describe the corresponding .gitignore entry in more detail? Or 
show a self-contained example.

At least in basic testing, I see such an entry being honored, with 
project-files not including the (ignored) symlink in its return value.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78209; Package emacs. Full text available.

Message received at 78209 <at> debbugs.gnu.org:


Received: (at 78209) by debbugs.gnu.org; 18 Nov 2025 15:41:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 18 10:41:01 2025
Received: from localhost ([127.0.0.1]:58533 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vLNpF-0006j7-2x
	for submit <at> debbugs.gnu.org; Tue, 18 Nov 2025 10:41:01 -0500
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:25696)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1vLNpC-0006in-Qm
 for 78209 <at> debbugs.gnu.org; Tue, 18 Nov 2025 10:40:59 -0500
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 3259881C86;
 Tue, 18 Nov 2025 10:40:53 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1763480452;
 bh=C4+nL1CrJPi/4vZ1FF2afEX1rrWsoeALQz3gxmPzVmQ=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=Y4Z50l/GyDUksBH4Z9SfwDfE3sIFW4htTzi7IXa/6SsD7tkWtY2dP5ViDpyEWj0dC
 EfSChxS4b4u709LyhBJQG40qypxAl2s8ciRqM9+sS3a/9aKCUydB5+GF9SwV3bmWgI
 mcuV84Ufnoin4KXnC1zlpOJkCk0UtyKG4s1cy7KVActD9FZp25IPuDhbsjmCCRJ7nD
 tq4itOndf/BJPdvRFFP1jGTo/kOrdO7r68XDu8s/cTB8BCDnR1HKPGUTSth9nZApDQ
 Z2jIFiPgL58rNI4q63bA7sa2wD5N8t+7LDlfm1dZY7wA39U0uX+KtzSexpIblGKnVv
 KwHIpcYjAGniQ==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 6C57980B13;
 Tue, 18 Nov 2025 10:40:52 -0500 (EST)
Received: from asado (unknown [181.28.45.30])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2DA9B120680;
 Tue, 18 Nov 2025 10:40:50 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Sean Whitton <spwhitton@HIDDEN>
Subject: Re: bug#78209: 30.1; project-query-replace-regexp fails on a
 symlink to a directory
In-Reply-To: <87bjkz8jep.fsf@HIDDEN>
Message-ID: <jwv5xb7pd80.fsf-monnier+emacs@HIDDEN>
References: <aBSRykbzvZhPnNxv@HIDDEN> <87jyzvqawv.fsf@HIDDEN>
 <87bjkz8jep.fsf@HIDDEN>
Date: Tue, 18 Nov 2025 10:40:46 -0500
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.236 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 78209
Cc: Dominik Schrempf <dominik.schrempf@HIDDEN>, 78209 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Thanks.  Adding Stefan, who authored fileloop.

My involvement was mostly in refactoring that code.
IIRC fileloop is not responsible for the choice of which files to visit,
this is delegated to the user of fileloop.  IOW, I suspect the problem
is in `project.el`, more specifically `project-files` or
`project-query-replace-regexp` which should skip symlinks that don't point
to a file, or maybe even skip all symlinks (after all, if it points
outside of the project then we shouldn't visit it, and if it points
inside the project, then we'll visit it via its non-symlink name
already).


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78209; Package emacs. Full text available.

Message received at 78209 <at> debbugs.gnu.org:


Received: (at 78209) by debbugs.gnu.org; 18 Nov 2025 15:12:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 18 10:12:08 2025
Received: from localhost ([127.0.0.1]:58390 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vLNNH-0004uT-OF
	for submit <at> debbugs.gnu.org; Tue, 18 Nov 2025 10:12:07 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:46114)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>)
 id 1vLNNF-0004tx-IZ
 for 78209 <at> debbugs.gnu.org; Tue, 18 Nov 2025 10:12:05 -0500
DKIM-Signature: a=rsa-sha256;
 b=BG8029a4T7zXf/UMFBqgcO7eQf9Ic7dLdt/Dr5iRn1KXoW0IEu85C0aAw4ljUpmrTq79MeNudbZrSULWB/SazT1LfRHW1PoN+nfE8sRgp1L5Yyr2QPe1vhgHBrp7wHxFBT1jFYp/mhF0NvLvoxUkOEkYWTRVe6T/EzmTTXziP1s4P+S08+s/AGtikQ66tDxuDNRElbhkmpiamD5Cxi7Ztl9AEa4ZrS6AZhXSVU0z+6K7H4XK5edQwUPULksSu5hJKcWrypT/BPBRqUVNCoxlXVSXKbJGHUP3/jwZLuz4VLsRr+TEVa0ZDhA0xyUvHMgpo/5odt1oKRksbzGZZqJskA==;
 s=purelymail3; d=spwhitton.name; v=1;
 bh=QahxgEgtE2R9bzdz3sr7PVTB21mPFRJihLXd2Na5xfc=;
 h=Received:Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=DyZC7LTGhd9CCHig8Rx6IUOz+aerV3ho4qG1BXdHptFZS6CtmJ3PTfc+ko14OB+WIiBCPmnN0mX8eFmNHknQ8SjhNX1ajdGEvDmJzFc+pH7wmhQDKuFyMTN1x4DtTHK8IrGxAJOQMqbW2L5zKrAsG2eg7/ydMd36fSdWFXFnbSR3vVy80Q3Z9ycrfVF0r3au0eeYOPbjb4ti+37Tis+2r66hHXRq2GE+iLtS5Q2LBtNe/BRWp9pm7KYkfstpWHnai1o6CewXY+XIVoFMGSiWXeI4keFPGfid4Ry8/VwkfNwNiM6HcDvq8VgKO7FspGPvWeHWpmYBNnXhc6rxMY7CBg==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=QahxgEgtE2R9bzdz3sr7PVTB21mPFRJihLXd2Na5xfc=;
 h=Feedback-ID:Received:Received:From:To:Subject:Date; 
Feedback-ID: 20115:3760:null:purelymail
X-Pm-Original-To: 78209 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -299046390; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 18 Nov 2025 15:11:59 +0000 (UTC)
Received: by zephyr.silentflame.com (Postfix, from userid 1000)
 id 6A13B94051B; Tue, 18 Nov 2025 15:11:58 +0000 (GMT)
From: Sean Whitton <spwhitton@HIDDEN>
To: Dominik Schrempf <dominik.schrempf@HIDDEN>
Subject: Re: bug#78209: 30.1; project-query-replace-regexp fails on a
 symlink to a directory
In-Reply-To: <87jyzvqawv.fsf@HIDDEN>
References: <aBSRykbzvZhPnNxv@HIDDEN> <87jyzvqawv.fsf@HIDDEN>
Date: Tue, 18 Nov 2025 15:11:58 +0000
Message-ID: <87bjkz8jep.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78209
Cc: 78209 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello,

On Wed 12 Nov 2025 at 09:00pm +01, Dominik Schrempf wrote:

> Hello!
>
> I am also running into this quite frequently.
>
> In particular, when executing `project-query-replace-regexp`, I get
>
> apply: Read error: Is a directory,
> /path/to/project/.direnv/flake-inputs/a2awwif8wvk1jcgjqk104025g6lzr1jd-source
>
> The file is a symlink, and the directory is ignored by git. (Should we replace
> also in git-ignored files)?

Thanks.  Adding Stefan, who authored fileloop.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78209; Package emacs. Full text available.

Message received at 78209 <at> debbugs.gnu.org:


Received: (at 78209) by debbugs.gnu.org; 12 Nov 2025 20:00:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 12 15:00:13 2025
Received: from localhost ([127.0.0.1]:51156 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1vJH0n-0006wp-0u
	for submit <at> debbugs.gnu.org; Wed, 12 Nov 2025 15:00:13 -0500
Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]:43340)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <dominik.schrempf@HIDDEN>)
 id 1vJH0i-0006pV-RE
 for 78209 <at> debbugs.gnu.org; Wed, 12 Nov 2025 15:00:11 -0500
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-b727f452fffso177703866b.1
 for <78209 <at> debbugs.gnu.org>; Wed, 12 Nov 2025 12:00:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1762977602; x=1763582402; darn=debbugs.gnu.org;
 h=mime-version:message-id:date:user-agent:subject:to:from:from:to:cc
 :subject:date:message-id:reply-to;
 bh=YEF5iJuvBzZ04BPfmi0zqSkfVnY9eejxwHLXPQIxa/k=;
 b=NEENipIB6cu3PuUvXc/6eAynmbX1hlh5NoaMiPGHcdShQ4ZvexLPIMU4Dekss/fO82
 E3AYUgWCuJ+d/xdNLIOcaG/CGh0510r+f6qxcAzU3SpCP/+eL5g1CQbt72cvx7TC0Fk0
 sNSt4yPWUB02Dpi73Lu/xY2yEJdLE556lP4thd1oLrZJUYtUWCrgMq0RkC0TXoMT3GkQ
 WPf/ee8bJ2rXl4JhI8Xr/i4WiwXXEJNa6Y01sFElRJdWj5w0CFCYEfysUCNS/K1JXtzn
 JV8DFx70e2wc8bvY3/mVIWF9bK66sh0eM/qUtWjc9XLzKaoDDs4RPvbVMo1r42/nnVqb
 9pzA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1762977602; x=1763582402;
 h=mime-version:message-id:date:user-agent:subject:to:from:x-gm-gg
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=YEF5iJuvBzZ04BPfmi0zqSkfVnY9eejxwHLXPQIxa/k=;
 b=FrXK5kWDuFSIyVpU2nTsyQerlauu/TOQ4IfIPkS0rNYFuls+JXKREGTQHbuRzT0GQX
 U6T8Haw7j4/n8yteJg7IrlJN041aFhWXKnKQJQFtsmz0fjJyg3C8346pxDzGaTn4VDBY
 cDcL9R7Ub1v3SJwF9Cyv5KGNhMVKs23cjWhi/w9sgd82m5wRhaKQpJbJOzqY3L0FGrl6
 lzF5mmSiebC30E9phLgftHx6qFWgEPowMXgpcxnkzDH71crJy6dWpa+95JashozJArMY
 FgnSg9LWrPfCpneu2ivWsD01jzFqQGA760R59xD9IqfFXD2KB1ciq70D1K5qXB5JdSf6
 +hhA==
X-Gm-Message-State: AOJu0Yw7Mt3QNVhP9g6ZlzznlwHZpuUn3apei/GZ4fE+AibVwGC1P573
 /Or0RMQFSt7xHVBksAEe8F87VqurIuGxbcUZWLchPcjwf3/gqPS87xmWNlv/
X-Gm-Gg: ASbGncueQQl+3dvR7LQnJzad7lYDk03QpEIq5aX1M09ceknbyf767axhVUYxOCN54QM
 fjNsA7W5l0MBFllqOkCtYxDM7YslPU1xtH5REcG6IiOo+/lNedJyV2ODvRvsYmElTGdKa+Q95DW
 41MhBx2rHZtsT18Zod66xQSR80tPKGQ7I0AbBagbbnkAF8Kh/Qsh0H/ffHmftO2Ic8BC5Qw83Uc
 Bk7T9YUrTDoxfcljSa53qnqedTsR/5gsqKoxxsRMmUmyk2fMbYJ3xdf0Dzr/V2rELuFNz/nMmy4
 qsC0tXgm3FDwprp4Vn0vYJ+xBz/bLnPdtbwt1bkYwb37lLh01NmKuOxVGXoIcDAIHWJ244xmtzt
 /5AFCOmujA5CTfNKrZQf9FBseGsFQlXO6F2/AeEEDosY/YAV3YX05x+94WIHZRY6GmkQhFStA1M
 MtggOLKWA=
X-Google-Smtp-Source: AGHT+IEEhjwfQbS3VpLksgA6wrMVtsEo7GCNIOdmmEtIVCHgfFnJ1uJK67J5c8zc+Z4rtwoQg+/iHQ==
X-Received: by 2002:a17:907:ec86:b0:b73:2ced:9af0 with SMTP id
 a640c23a62f3a-b73484f2271mr54215566b.27.1762977602167; 
 Wed, 12 Nov 2025 12:00:02 -0800 (PST)
Received: from localhost ([2a02:1748:dd5e:5d70:6d93:3a5b:7175:3072])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-b72bfa24d14sm1669115766b.74.2025.11.12.12.00.01
 for <78209 <at> debbugs.gnu.org>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 12 Nov 2025 12:00:01 -0800 (PST)
From: Dominik Schrempf <dominik.schrempf@HIDDEN>
To: 78209 <at> debbugs.gnu.org
Subject: 30.1; project-query-replace-regexp fails on a symlink to a directory
User-Agent: mu4e 1.12.13; emacs 30.2
Date: Wed, 12 Nov 2025 21:00:00 +0100
Message-ID: <87jyzvqawv.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78209
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello!

I am also running into this quite frequently.

In particular, when executing `project-query-replace-regexp`, I get

apply: Read error: Is a directory, /path/to/project/.direnv/flake-inputs/a2awwif8wvk1jcgjqk104025g6lzr1jd-source

The file is a symlink, and the directory is ignored by git. (Should we replace also in git-ignored files)?

Best,
Dominik




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#78209; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 May 2025 11:45:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 02 07:45:43 2025
Received: from localhost ([127.0.0.1]:57057 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uAopq-0005Z4-AZ
	for submit <at> debbugs.gnu.org; Fri, 02 May 2025 07:45:43 -0400
Received: from lists.gnu.org ([2001:470:142::17]:48096)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <lukasz.wojnilowicz@HIDDEN>)
 id 1uAmne-000475-O5
 for submit <at> debbugs.gnu.org; Fri, 02 May 2025 05:35:19 -0400
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 <lukasz.wojnilowicz@HIDDEN>)
 id 1uAmnY-0006A7-BI
 for bug-gnu-emacs@HIDDEN; Fri, 02 May 2025 05:35:12 -0400
Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <lukasz.wojnilowicz@HIDDEN>)
 id 1uAmnW-0008Cu-Rp
 for bug-gnu-emacs@HIDDEN; Fri, 02 May 2025 05:35:12 -0400
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-acacb8743a7so319914766b.1
 for <bug-gnu-emacs@HIDDEN>; Fri, 02 May 2025 02:35:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1746178509; x=1746783309; darn=gnu.org;
 h=content-transfer-encoding:content-disposition:mime-version
 :message-id:subject:to:from:date:from:to:cc:subject:date:message-id
 :reply-to; bh=jODnInZ3f3KD+ZBX2V04ShBwSATLfrBX7vF9Ti11sE8=;
 b=ZsmmiNZYFZ7DmgucOzXgFp9GSD4cWE58wD/i2HDqPw42WpilkJJOUxjuM3aiZYut+/
 yAv3m03SFYOJpfD6h9wkh+k2iU7S9pNoaVmo+UVqrINO01ZvGTQKB1eAcPlIVKIrG5Xw
 6jpj0sXkZQmwP/FBvaCZEpkG3XGTl+LPMVXSBuO9yO+iJV9LlrMeJuzUNdOfJ/6g8AYc
 3IYrBGmaLQ7zqBYuJURW92v3wtRz4lpqe8cl0QXGim9zeEkD6m+4FubAClKD5aJbPdss
 rLeoQvH5P/cw+UguuBlKr/NhXmCBZyHmIzhNNqSX18RLkZy5ZFlVlcAJXBqPJfkbzqNM
 lW7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1746178509; x=1746783309;
 h=content-transfer-encoding:content-disposition:mime-version
 :message-id:subject:to:from:date:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=jODnInZ3f3KD+ZBX2V04ShBwSATLfrBX7vF9Ti11sE8=;
 b=YSIPo5uCK0QkQeZkpPPZQD7qzPlfFc+dN48VvqM5QjwshLfqO4Jr2PZDL8lkRRra21
 ciO7FKxedoNpoHZB6NKgInxg4xAYuNKZfFy89lbBMcd0nRrLzJyziKKjZzoguJcexdQB
 zPuvDUIOTIQszK1PR7pzLzJ8t4fmyROjQv3AOmMIQONNFOpF+gE6/Lv9OB3ukMrdqcI1
 RoxTbcDMtrdOgw3C7bAgM5KUl571IZhoe9rsl0o1qsjQdBw8J5v4p2xXDSP8IPWKF44b
 65lJNOUlodi6B2PRY0LikzIsMm4S5cG2SE2ndOv6EucRVmuNQUfkJICRg4ZvCDfPsPIl
 kDog==
X-Gm-Message-State: AOJu0YwHOeM4lw116IsJFrf4WA7mkwOyFqJBYRa+1Ys/hkhYfw27QmSK
 DT4a6wb3JqWhkLvjtnERMaPPTM2GUlL3K5YjmmU8dCMMCyVIvWbkmnijHw==
X-Gm-Gg: ASbGncucRt55/8WSMWlr0E7vBWXpjLNrJqKPCruRzRqPpg98yzgJyBzJ71GAlQ/yN1m
 dO6VENteIRLW0VkZ2d5iIE0n3p3VlvI0hDXTr6lWM/wNclEZ4frZa8La+L3DYoZUfuCUMaMQuA+
 g2GnnEsQylTU5iQ4IYchPo1LenXKh2+Uqwku5F5phsLpVLchLLIg1j+T7qDqvZLbafiz95J2YQN
 AKdPhmT8rwrOGahJB4uL3QFlx/SqwbeGR+PuPpC7y6rrCOoSmKNOxaJ9/uYc5Axjkk/jsEkpCic
 fiGedttejwj6DXcZby/q2FVF+PDeSnWiUn7qyHVt+WbsB4GmgCZF/5x+TbSoVqIzkbg=
X-Google-Smtp-Source: AGHT+IG1og4hDlKmI5eEfa6f253wpJdP8sENjO6BsiXIDrmnNaKzLtTSnjrNPNkVja9OGP6C6xPoPA==
X-Received: by 2002:a17:906:c109:b0:ace:f075:3e56 with SMTP id
 a640c23a62f3a-acefed6affamr553187166b.11.1746178508863; 
 Fri, 02 May 2025 02:35:08 -0700 (PDT)
Received: from gmail.com (d221-136.icpnet.pl. [109.173.221.136])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-ad1891f3c60sm22546066b.80.2025.05.02.02.35.08
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 May 2025 02:35:08 -0700 (PDT)
Date: Fri, 2 May 2025 11:35:06 +0200
From: =?utf-8?Q?=C5=81ukasz_Wojni=C5=82owicz?= <lukasz.wojnilowicz@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 30.1; project-query-replace-regexp fails on a symlink to a directory
Message-ID: <aBSRykbzvZhPnNxv@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2a00:1450:4864:20::629;
 envelope-from=lukasz.wojnilowicz@HIDDEN; helo=mail-ej1-x629.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Fri, 02 May 2025 07:45:40 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Executing project-query-replace-regexp on a git repository like below
-----------------------
.
├── ./a
│   └── ./a/file.txt
└── ./link-to-a -> a

3 directories, 1 file
-----------------------

on Linux fails with

"fileloop-next-file: Read error: Is a directory, /absolute/path/to/project-query-replace-regexp/link-to-a"

Could you fix that?




Acknowledgement sent to Łukasz Wojniłowicz <lukasz.wojnilowicz@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#78209; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 25 Nov 2025 20:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.