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: Michael Albinus
Subject: Re: emacs-27 b46c75b: xref-matches-in-files: Big Tramp speed-up
Date: Wed, 08 Jan 2020 15:13:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Dmitry Gutov <address@hidden> writes:

> Hi Michael,

Hi Dmitry,

> 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.

Yes. I made this change because I need it Tramp internal. No tramp-*
function is intended to be called outside Tramp itself except the ones
in the Tramp manual. By intention, I haven't documented it there, and I
have given it also a comment NOT to use it outside Tramp. You're the
only one so far I gave permission :-)

>>> +      (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.

And it avoids one tramp-tramp-file-p call.

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

I know that. Tramp follows the generic file name handler approach, as
described in (info "(elisp) Magic File Names") . This works fine for
single files, but might not be appropriate for filesets, as you happen
to be faced with. Maybe we need an architectural extension for a file
name handler of filesets. Or we add new magic operations, which work
over a fileset. Like vc operations do :-)

Best regards, Michael.



reply via email to

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