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: Mon, 5 Jul 2021 21:05:01 +0200 Message-ID: <5196C041-589E-4876-8254-3A6974D6DA53@gmail.com> References: <658a3e61-9511-5502-43de-8f591cec7387@yandex.ru> <91dd2467-f64e-eede-8098-14fc8ccd7ae7@yandex.ru> <429484E1-DDFA-4050-B5BF-E43477441C84@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.100.0.2.22\)) 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="34256"; 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 Jul 05 21:06:10 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 1m0Tv0-0008er-Hf for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Jul 2021 21:06:10 +0200 Original-Received: from localhost ([::1]:58628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m0Tuz-0002NT-GH for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Jul 2021 15:06:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m0Tut-0002Mf-2q for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2021 15:06:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35116) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m0Tus-00038B-Ly for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2021 15:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m0Tus-0003a3-D0 for bug-gnu-emacs@gnu.org; Mon, 05 Jul 2021 15:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philipp Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Jul 2021 19:06:02 +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.162551191013703 (code B ref 47799); Mon, 05 Jul 2021 19:06:02 +0000 Original-Received: (at 47799) by debbugs.gnu.org; 5 Jul 2021 19:05:10 +0000 Original-Received: from localhost ([127.0.0.1]:46662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Tu1-0003Yw-RE for submit@debbugs.gnu.org; Mon, 05 Jul 2021 15:05:10 -0400 Original-Received: from mail-wm1-f46.google.com ([209.85.128.46]:34461) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m0Tu0-0003Yc-6L for 47799@debbugs.gnu.org; Mon, 05 Jul 2021 15:05:08 -0400 Original-Received: by mail-wm1-f46.google.com with SMTP id u5-20020a7bc0450000b02901480e40338bso400627wmc.1 for <47799@debbugs.gnu.org>; Mon, 05 Jul 2021 12:05:08 -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=6m6wM+6Y3TYnLNfjB4pYB6Q98RWXvC93Zns07Z7eGYU=; b=ni1efZf2nvkYIguQtG3JyTTJbUwy3RmuyfJ1ikiLLDEu5/jWU/Ia1JjdQqntUGGNiL M+nygPFaL78gP1mSAcDeOldo7OEwL3fNr2pIxHQnmqDhzx+WyrkYy8FKBpvu1YlpV3Og 0wz6yB3Jx59jng7FF4p0on2uUwM0vVA44JZyf71VzvZP/ZtLkFaI8dTmf72GeyYR2Ec4 utAbePz7x5cVqC/h5cchGF/rwK7mM/braYActSxSsvU0LLHB5Csd8Mz4PwrrbvqrOJ9D Vq5nzR2tGovzFxtUL0RF0eGMYu+/c3S/aBhupyKrcegMNtWF/Q3TT43QCc8I18A5Ix/g CJwg== 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=6m6wM+6Y3TYnLNfjB4pYB6Q98RWXvC93Zns07Z7eGYU=; b=AblqysGpjTA63ZSW2Fp1IZI0TBPWUmWreXAoxD5Wf/Fh3aRnCrGBmBNVsqF723ZLhL x0UQE0zCciJgW5dUw26x0KhifdeEHkLKoGdq4L92RaaZwzXISZKYtnvVGrOLivyFnXEy TlyODFpLbvX+SUULaR6y/mzrPoKTzSxNYuvYj7LvNO2bYNNEd8DdGkFuDxFsukZeOuAd eCOzqoKYqRQNVy8e8tcsxqZeMyO2Tjd2+Z1gx99a8CkL02C93WeNR9JHrS5bTWsbyQjW rm+y/snLAVPeWeUWAxDRd3GeJ6SRILG6SqM32O1JcD1bq6WybNYcclbHEVWPWNo+u8mW f6EQ== X-Gm-Message-State: AOAM531IMX9++hCD8EKlCeHUa2nn9ke4WgQK2RiTjhBhseaTQU+W+PKt oB606uZKPQCRONdyfPZ65Rg= X-Google-Smtp-Source: ABdhPJzv5t7o1e0/qfZ/emw37F7DTYgVcVXFppdj5sHmUCf47STdCyAj6nYTw7Fdtfc+4VjTwA4ANw== X-Received: by 2002:a05:600c:4fc1:: with SMTP id o1mr2691965wmq.158.1625511902395; Mon, 05 Jul 2021 12:05:02 -0700 (PDT) Original-Received: from smtpclient.apple ([46.128.198.100]) by smtp.gmail.com with ESMTPSA id r9sm314675wmh.40.2021.07.05.12.05.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jul 2021 12:05:01 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3654.100.0.2.22) 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:209485 Archived-At: > Am 17.05.2021 um 01:22 schrieb Dmitry Gutov : >=20 > On 16.05.2021 16:37, Philipp wrote: >=20 >> 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? >=20 > That sounds like an interesting idea to explore. >=20 > We create/concatenate those file names inside project-files, and then = "parse" them again to convert to local names inside = xref-matches-in-files. Creating such structures might indeed save us on = some parsing and garbage generation. >=20 > Experiments and patches welcome. >=20 > What I was also thinking of previously, is some "fileset" data = structure which could contain a list of local file names and their = connection in a separate slot. Maybe even separating the parent/root = directory into a separate slot when feasible, to minimize GC further, = though that might complicate applications. >=20 > A more structured "file" value format might make this stuff easier to = use indeed, and perhaps the performance difference will be negligible. I think those are very good ideas. The "fileset" structure sounds like = a pretty good abstraction. >=20 > The difficulty is having a method like project-files return one format = for some users, and another for users who want to take advantage of this = performance improvement. Or we break the compatibility and/or introduce = a new method with this new behavior. A general design approach in OOP is to not treat abstract virtual = functions (generic functions in ELisp terminology) as part of the public = interface of a type; i.e., abstract functions can be implemented, but = shouldn't be called outside of the module that defines them (project.el = in this case). That allows for changes like this: implementers could = freely return the new fileset structure because only project.el would = call project-files. Not sure how much ELisp code adheres to this = principle, though. If there's too much code (outside of project.el) = that relies on project-files returning a list, we need to indeed fall = back to some of the other options.