From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Philipp
Newsgroups: gmane.emacs.bugs
Subject: bug#47799: 28.0.50;
Default `project-files' implementation doesn't work with quoted
filenames
Date: Sun, 16 May 2021 15:37:07 +0200
Message-ID: <429484E1-DDFA-4050-B5BF-E43477441C84@gmail.com>
References:
<658a3e61-9511-5502-43de-8f591cec7387@yandex.ru>
<91dd2467-f64e-eede-8098-14fc8ccd7ae7@yandex.ru>
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.80.0.2.43\))
Content-Type: text/plain;
charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
logging-data="40371"; 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 Sun May 16 15:38:14 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 1liGyE-000AIU-NG
for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 May 2021 15:38:14 +0200
Original-Received: from localhost ([::1]:47206 helo=lists1p.gnu.org)
by lists.gnu.org with esmtp (Exim 4.90_1)
(envelope-from )
id 1liGyD-0007g4-E2
for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 16 May 2021 09:38:13 -0400
Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55166)
by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
(Exim 4.90_1) (envelope-from )
id 1liGy2-0007fw-Gs
for bug-gnu-emacs@gnu.org; Sun, 16 May 2021 09:38:02 -0400
Original-Received: from debbugs.gnu.org ([209.51.188.43]:38329)
by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
(Exim 4.90_1) (envelope-from )
id 1liGy2-0004kH-98
for bug-gnu-emacs@gnu.org; Sun, 16 May 2021 09:38:02 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
(envelope-from ) id 1liGy2-0005E0-1m
for bug-gnu-emacs@gnu.org; Sun, 16 May 2021 09:38:02 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Philipp
Original-Sender: "Debbugs-submit"
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Sun, 16 May 2021 13:38: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.162117223620030
(code B ref 47799); Sun, 16 May 2021 13:38:01 +0000
Original-Received: (at 47799) by debbugs.gnu.org; 16 May 2021 13:37:16 +0000
Original-Received: from localhost ([127.0.0.1]:49875 helo=debbugs.gnu.org)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from )
id 1liGxI-0005Cy-B3
for submit@debbugs.gnu.org; Sun, 16 May 2021 09:37:16 -0400
Original-Received: from mail-ed1-f43.google.com ([209.85.208.43]:33574)
by debbugs.gnu.org with esmtp (Exim 4.84_2)
(envelope-from ) id 1liGxG-0005Cm-NO
for 47799@debbugs.gnu.org; Sun, 16 May 2021 09:37:15 -0400
Original-Received: by mail-ed1-f43.google.com with SMTP id b17so3865161ede.0
for <47799@debbugs.gnu.org>; Sun, 16 May 2021 06:37:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
h=mime-version:subject:from:in-reply-to:date:cc
:content-transfer-encoding:message-id:references:to;
bh=JwF7KDPvhUIxjuQ9gPIL+yuwhg0gBiRr40vq2o9aj08=;
b=BcCtCnvpZd8VIH9sAKG/j5EGflUXsCngPr14bVwdFoYBn74rz79+Q6KwJ0ebob9LGD
0fevOy4cZNcgFnkGlwq2NoSSmJz6tFUtkXrfLju2SRPGd/wtnoElYlRKPv18U2CMvMmL
lkndtAkuatf9dDwkFgCJ1VwliOUQA8QAcFBLabpt6MRBqFZU4/POGk85XywCrsrithXM
saA99hGCWh/dSpi8Kb1BYmSQIxeZoQMx4Djq+4qaVl/3kNVk6Sy7ZkXKabN6djhSeEVK
/WkDCEENj+IzVyzVkw45WKqm71CHWZ8W5rOLz4g8ilxWoRMWHhk535jElQ9sW0VIoNhs
kvtg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
:content-transfer-encoding:message-id:references:to;
bh=JwF7KDPvhUIxjuQ9gPIL+yuwhg0gBiRr40vq2o9aj08=;
b=fNKYA5dFD1R0pVCdcbTB34FN73FcGhdPg3RYOEqxhEuYD4sdzjaewZNysGSuDy2euk
2XQAF8kYlwnN2mewDdYuprypw2gnPTtJ7VCvIhb2MpMI/LL5hyZeFU0TQJHZCXIjx30v
g3axd+SqtbKMA7lI/oHSkciLXYBoz2XAlJB1q0k99C6kh8CAkSGpOCH2mNdfH/DiTxeh
i6oTB26i29/lDmTrWzjE5GUh2BU0POP5skNvz5YVqpfefk+IZsZVpXTzag8NQiyx3/wj
bww7LJTzR+pFBpWu8ObZMjnJYUFQgAwrG7nrK00HjWYOct9TCvuijhOF1phuvoLi2UlL
3zFQ==
X-Gm-Message-State: AOAM5339KPfi95Cd4gcqKX7DzurnAtXyb8uTXo7mJE7Jm7oFQVFN0o/7
F44K0P1oVOqkLCtex/vKA5Q=
X-Google-Smtp-Source: ABdhPJxbSCQ6PjRiYit/WV+3G3XSqpSwWppzze80CycM4E2Vu2OJMwTsbW27wfc9lF7k73rvZIeE3A==
X-Received: by 2002:aa7:d90d:: with SMTP id a13mr64584667edr.76.1621172228793;
Sun, 16 May 2021 06:37:08 -0700 (PDT)
Original-Received: from smtpclient.apple ([46.128.198.100])
by smtp.gmail.com with ESMTPSA id i8sm7362313ejj.68.2021.05.16.06.37.08
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Sun, 16 May 2021 06:37:08 -0700 (PDT)
In-Reply-To: <91dd2467-f64e-eede-8098-14fc8ccd7ae7@yandex.ru>
X-Mailer: Apple Mail (2.3654.80.0.2.43)
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:206660
Archived-At:
> Am 19.04.2021 um 22:48 schrieb Dmitry Gutov :
>=20
>=20
>> 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?
>=20
> We've discussed this before, but it's a change in the API, a +1 method =
for a very minor feature.
>=20
> And how will we explain anyway that xref-matches-in-files, when called =
without the new ROOT argument, doesn't handle remote or quoted file =
names?
>=20
> So if you can fix this to avoid performance loss in the general case, =
that would be a good improvement for now.
Yeah, I think you're right, we shouldn't complicate the API =
unnecessarily for optimization purposes.
One thing that came to my mind is: in general, in Elisp (not just XRef), =
we spend lots of time parsing filenames to support remote and quoted =
filenames. Other languages probably solve this by introducing proper =
types for filenames (e.g. the Java Path class), which can then hold =
preprocessed information about the underlying filesystem (or special =
file name handler, in the case of Elisp). How about doing similar for =
Elisp? For example, introduce a `parsed-file-name' class or structure =
holding the remote/quoting state, or attach it to string properties? I =
haven't tried out that idea, but I think it could significantly speed up =
the parsing (since we'd only have to do it once and don't have to search =
for filename handlers all the time), as well as remain =
backward-compatible to "plain" unparsed filenames by allowing both =
strings and this new object type. WDYT?=