bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#51699: 29.0.50; [PATCH] Improve performance of 'file-name-case-insen


From: Jim Porter
Subject: bug#51699: 29.0.50; [PATCH] Improve performance of 'file-name-case-insensitive-p' for Tramp files
Date: Wed, 10 Nov 2021 16:48:03 -0800

On 11/10/2021 4:17 AM, Michael Albinus wrote:
`tramp-find-foreign-file-name-handler' loops through
`tramp-register-foreign-file-name-handler'. Only operations registered
there need to support a VEC-OR-FILENAME argument.
`tramp-archive-file-name-p' and `tramp-crypt-file-name-p' are not
registered, so no change is needed.

Ah ha. I didn't realize they weren't included (I thought I just had to configure something to add them in `tramp-foreign-file-name-handler-alist'). In that case, it definitely makes sense eliminate the `accepts-vec' bits from my patch.

We could (and should) inform the authors of both packages, that the
signature for the `tramp-FOO-file-name-p' functions will change with
Tramp 2.6. As I can see, there's no problem to adapt
`magit-tramp-file-name-p' and `tramp-jumper-file-name-p'. And yes, an
entry in etc/NEWS should be added as well.

Sounds good to me. I've added a NEWS entry that hopefully explains the change fairly clearly. Just to be extra-certain, I re-ran my performance tests from before and the results are the same.

A  little bit more friendly for debugging:

--8<---------------cut here---------------start------------->8---
        ;; The signature of `tramp-FOO-file-name-p' has changed, it
        ;; expects a VEC here.
         (when (with-demoted-errors "Error: %S" (funcall (car elt) vec))
--8<---------------cut here---------------end--------------->8---

I went with this since it should make it easier for third parties to notice the issue and make the appropriate update to their code. Thanks for the pointer.

Attachment: 0001-Improve-performance-of-tramp-find-foreign-file-name-.patch
Description: Text document


reply via email to

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