emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs-27 b46c75b: xref-matches-in-files: Big Tramp speed-up


From: Dmitry Gutov
Subject: Re: emacs-27 b46c75b: xref-matches-in-files: Big Tramp speed-up
Date: Wed, 8 Jan 2020 16:52:21 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

Hi Michael,

On 08.01.2020 11:03, Michael Albinus wrote:
address@hidden (Dmitry Gutov) writes:

     xref-matches-in-files: Big Tramp speed-up

     * lisp/progmodes/xref.el (xref-matches-in-files):
     Greatly improve performance with remote files using Tramp
     (bug#34343).

Thanks. I've made a further improvement in tramp-file-local-name. In
case NAME is not a Tramp file name, it calls file-local-name now.

This is to handle use cases like

(copy-file "/ssh:host:/path/index.html" "https://example.com/path/index.html";)

and more subtle constellations.

Looks like a good change, functionality-wise. But speaking of the change below, I'll probably make it, but upon reading the code anybody would struggle to guess that this function can handle other local names, not just Tramp ones.

+      (setq files (mapcar
+                   (if (tramp-tramp-file-p dir)
+                       #'tramp-file-local-name
+                       #'file-local-name)
+                   files)))

You can change this now to

(setq files (mapcar #'tramp-file-local-name files))

This will shorten the code, and it'll require one fewer declare-function in the file.

But allow me to state for the record once more that I'm puzzled by the architectural choice we're working with here.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]