From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59722: 30.0.50; project-find-regexp searches project-ignored files Date: Mon, 05 Dec 2022 00:36:34 +0100 Message-ID: References: <9de53f42-8f76-3770-b059-d78a5252d31a@yandex.ru> <1f6b991a-d67e-5e38-b77f-038e97218e4e@yandex.ru> Reply-To: Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5244"; mail-complaints-to="usenet@ciao.gmane.io" To: Dmitry Gutov , 59722@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 05 00:37:14 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p1yXq-00019z-PG for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Dec 2022 00:37:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p1yXf-0000OD-W3; Sun, 04 Dec 2022 18:37:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p1yXe-0000Nk-Jw for bug-gnu-emacs@gnu.org; Sun, 04 Dec 2022 18:37:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p1yXe-0007BN-CJ for bug-gnu-emacs@gnu.org; Sun, 04 Dec 2022 18:37:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p1yXd-0004Ts-UR for bug-gnu-emacs@gnu.org; Sun, 04 Dec 2022 18:37:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Dec 2022 23:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59722 X-GNU-PR-Package: emacs Original-Received: via spool by 59722-submit@debbugs.gnu.org id=B59722.167019701017210 (code B ref 59722); Sun, 04 Dec 2022 23:37:01 +0000 Original-Received: (at 59722) by debbugs.gnu.org; 4 Dec 2022 23:36:50 +0000 Original-Received: from localhost ([127.0.0.1]:60464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1yXR-0004TW-HZ for submit@debbugs.gnu.org; Sun, 04 Dec 2022 18:36:49 -0500 Original-Received: from mr85p00im-hyfv06021301.me.com ([17.58.23.188]:58902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1yXM-0004TO-Dn for 59722@debbugs.gnu.org; Sun, 04 Dec 2022 18:36:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1670196998; bh=cE2JCL22wpWuw/rZqfg6hhtloS2vXwq+K5UDAQdUp+o=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ne5otCCuCxT0BS8G1Lgt4Be4GorLEh6SGUgX/I/w4VzP7uZeM9MivcWu96EIcVqqI bQWMFDHOlv+gQJhmbEp/jdRxczW9totbUB9xZ4f6Tiy/7QwSQe9l4NAQsfuST0YukK YNBdvtCh8uoFf0sqtJmpwYVrfmVG0warP+Z6XdZnFDMgdF6dh10qO3NS6gG3giH5jx 0O3IA5GrFsSYdQdRfgQGmK+8Ewrg5FLPbpQ6xc6nLV5ctePS1vE8XKF83/ryYUt+N1 QVFMvR4CbkqyQ3duBuhnMhZVLES8ZchonC0VuAYWODQks9yp+SY+LrxPpuSR34WVid FzV0HW88gGvRA== Original-Received: from Rudolfs-MacBook-Air.local (mr38p00im-dlb-asmtp-mailmevip.me.com [17.57.152.18]) by mr85p00im-hyfv06021301.me.com (Postfix) with ESMTPSA id 0B1292151400; Sun, 4 Dec 2022 23:36:37 +0000 (UTC) In-Reply-To: <1f6b991a-d67e-5e38-b77f-038e97218e4e@yandex.ru> X-Proofpoint-GUID: BQKtmwFRgRb2aQ4KJ7HSwKcQGKhOfB4I X-Proofpoint-ORIG-GUID: BQKtmwFRgRb2aQ4KJ7HSwKcQGKhOfB4I X-Proofpoint-Virus-Version: vendor=fsecure engine=1.1.170-22c6f66c430a71ce266a39bfe25bc2903e8d5c8f:6.0.425, 18.0.816, 17.0.605.474.0000000 definitions=2022-01-18_01:2022-01-14_01, 2022-01-18_01, 2020-01-23_02 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 phishscore=0 malwarescore=0 spamscore=0 clxscore=1015 adultscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2212040215 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249976 Archived-At: Dmitry Gutov writes: > Okay. Thank you for your time, Dmitry! > I wonder how that could be possible: project-find-regexp (that if what > you have 'C-x p g' bound to, right?) does the search across the files > returned by 'project-files'. So there is just one place that > interprets the ignores' list and produces the list of files, and both > project-find-file and project-find-regexp consume the result. I provide a hypothesis about how that could happen below. > Can you step through 'project-find-regexp' with edebug? Does the > return value of 'project-files' (saved to 'files') contain the extra > entries? So, I debugged the problem. FINDING 1: The first finding may explain why I see the ignored files in C-x p g. For my dir-local ignore pattern ((nil . ((project-ignores . ("apps/**/*.scm"))))) Emacs ends up calling git ls-files -z -c --exclude-standard \ --no-empty-directory -o -- :(exclude,glob,top)apps/**/*.scm which gives a listing that DOES NOT contain (as expected) any '*.scm' files in the 'apps' directory, such as apps/lib-app-core/src/main/assets/app/atrium.scm apps/lib-app-core/src/main/assets/app/database.scm ... but it still DOES contain "logically empty" parent directories (as not expected, perhaps) that would have contained the ignored files if not ignored, such as apps/lib-app-core/src/main/assets/app My interpretation: git ls-files does not output just files, as one would expect, but also directories with no matching files. grep then gets a list of files and possibly also directories, and searches through it all. FINDING 2: Given the configuration (setq project-switch-use-entire-map t project-switch-commands '((nil "C-x p"))) when I type C-x p p <...project...> g then Emacs uses the global project ignores and not the ones defined in the directory-local file. However, C-x p g inside of any project buffer works OK. Notes: While probably not the root cause, this bug made debugging much harder, until I realized it exists, so I report this finding as well. Rudy --=20 "One can begin to reason only when a clear picture has been formed in the imagination." -- Walter Warwick Sawyer, Mathematician's Delight, 1943 Rudolf Adamkovi=C4=8D [he/him] Studenohorsk=C3=A1 25 84103 Bratislava Slovakia