From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Philipp Stephani
Newsgroups: gmane.emacs.bugs
Subject: bug#47799: 28.0.50;
Default `project-files' implementation doesn't work with quoted
filenames
Date: Mon, 19 Apr 2021 16:48:45 +0200
Message-ID:
References:
<658a3e61-9511-5502-43de-8f591cec7387@yandex.ru>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
logging-data="2462"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 47799@debbugs.gnu.org
To: Dmitry Gutov
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 19 16:50:27 2021
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 1lYVEJ-0000WM-0u
for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Apr 2021 16:50:27 +0200
Original-Received: from localhost ([::1]:43612 helo=lists1p.gnu.org)
by lists.gnu.org with esmtp (Exim 4.90_1)
(envelope-from )
id 1lYVEI-0000NQ-2C
for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Apr 2021 10:50:26 -0400
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43118)
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from )
id 1lYVDu-0000Lq-32
for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 10:50:02 -0400
Original-Received: from debbugs.gnu.org ([209.51.188.43]:40041)
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from )
id 1lYVDt-0003qy-Qp
for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 10:50:01 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
(envelope-from ) id 1lYVDt-00005z-Ov
for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 10:50:01 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Philipp Stephani
Original-Sender: "Debbugs-submit"
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Mon, 19 Apr 2021 14:50:01 +0000
Resent-Message-ID:
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 47799
X-GNU-PR-Package: emacs
Original-Received: via spool by 47799-submit@debbugs.gnu.org id=B47799.161884374432749
(code B ref 47799); Mon, 19 Apr 2021 14:50:01 +0000
Original-Received: (at 47799) by debbugs.gnu.org; 19 Apr 2021 14:49:04 +0000
Original-Received: from localhost ([127.0.0.1]:51585 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1lYVCy-0008W3-8I
for submit@debbugs.gnu.org; Mon, 19 Apr 2021 10:49:04 -0400
Original-Received: from mail-ot1-f53.google.com ([209.85.210.53]:33750)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from ) id 1lYVCw-0008VC-7P
for 47799@debbugs.gnu.org; Mon, 19 Apr 2021 10:49:02 -0400
Original-Received: by mail-ot1-f53.google.com with SMTP id
92-20020a9d02e50000b029028fcc3d2c9eso10305489otl.0
for <47799@debbugs.gnu.org>; Mon, 19 Apr 2021 07:49:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:cc; bh=Huyknc7hxw59fqP+7MQvfUhVmIcdptjmtI+E2WP4wlo=;
b=IfhdWyBlgj4G0tyMn5FsndCilsKGXfbYKBqSMGzoJQ2wDb+XXkWlBeWww+8DUIeBXe
HXQInmFmnXFthPLefISmwBnPnDZCzjck65NHCePy4PQgYWXtm5NNbO7ZduNsCsgPz1YL
ZIwe/c5kngMKzweyce72AL+wzXZNYGcJNiXEcSWef2j7EcZ4fJO+DjVr5ll4C9HtG0Ys
uJBd6cj/4+BMKVyYh9d7MRQzmxWk18ogROJQyngj5wjlIH8qUhcH4ATu4lRYzFjT8xgh
0AUC9XJjO9oXkrKslG0pzYzPSKppn9okbbT2U+T9/zLL13ZNcOxwfY216mHmy3Ou2T7u
jw8w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc;
bh=Huyknc7hxw59fqP+7MQvfUhVmIcdptjmtI+E2WP4wlo=;
b=LuiAZ1/NnLUeEqvurTji4lt274ZJd8XXlcvV3YBlH/Jo9WVyu7Lt31dRNMyTxGrtTJ
H039mwT66vrOuVLCLqH4fHRkvfNMoBxB/0qyxezPjo0Xo/B4oeV1MyFsoyAUWmFXbyXX
oijkHyLvxbYtEBeZWchazHPlSwSo9u5mqdN+AAuSp7TmANtaCydEhTOHBZ4m3Ow0tgCp
WwX3/GC/CT8cPa60p+6EpfRbBN8EPpaf/5/h5FQRMLFi+mJsJ4qpM/VB0+8LXDmQANp6
vlxKN0olsjBnN+zmT15bOgizkm/X8WFFUgQTE4LiAgnoVM5z02Pu2rH61u7bT9Qi/q+V
5+AA==
X-Gm-Message-State: AOAM531m0SpR0LNuvE6DrJNejqUuQhHkXLJGYjyRLCUu8Z32qMdzA0V1
jDwPK2W4go4zcwzrmhsWFTWzRWElUglTqWlPN9I=
X-Google-Smtp-Source: ABdhPJw9t4oKfI84V4vpJ7rYsz0p3+NTFjs879eHpKzga9Rlnn1E/xUAZbmAOQFniPysuApvUSTTst+DykeD92K4nio=
X-Received: by 2002:a05:6830:150d:: with SMTP id
k13mr12425918otp.156.1618843736465;
Mon, 19 Apr 2021 07:48:56 -0700 (PDT)
In-Reply-To:
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
the Swiss army knife of text editors"
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: "bug-gnu-emacs"
Xref: news.gmane.io gmane.emacs.bugs:204466
Archived-At:
Am So., 18. Apr. 2021 um 22:21 Uhr schrieb Dmitry Gutov :
> >> Regarding your change, though, have you tried project-find-regexp in a
> >> "transient" project with a quoted root directory name?
> >>
> >> You've made project--files-in-directory quote the returned file names,
> >> but that list gets passed to xref-matches-in-files, which pipes them to
> >> find-grep in the end. I suppose xref-matches-in-files could use a step
> >> similar to (when remote-id ...) that is already there.
> >
> > Good point, I've pushed 6ebc6e12cf to fix. But xref.el should also be
> > fixed. Maybe I'll find some time to take a look at it.
>
> Yes, I think the fix needs to be in xref-matches-in-files, and it also
> needs to use file-name-quoted-p similarly to (file-remote-p
> default-directory, to avoid the mapping overhead when the list of file
> names is large.
>
> It's a realistic use case, and the impact is significant (e.g. 1s to
> list files, 2s to unquote them all), so please look into this soon. The
> fix in xref should be simple enough, I'd just like for someone to
> realistically test it before installing (I can send a patch, if you want).
Hah, I wasn't aware that quoting/unquoting is so slow.
Rather than making assumptions in xref-matches-in-files, maybe we
could work more with relative filenames. For example:
1. Add another project method "project-relative-files" that returns
filenames relative to the root. By default, this would call
project-files and make the filenames relative, but project
implementations can provide an optimized implementation.
2. Give xref-matches-in-files an optional root directory argument and
allow users to pass names relative to that root.
Then I think both project and xref could leave these relative
filenames alone. WDYT?