GNU bug report logs - #34343
[PATCH] Make project--find-regexp-in-files work with remote files

Previous Next

Package: emacs;

Reported by: Felicián Németh <felician.nemeth <at> gmail.com>

Date: Wed, 6 Feb 2019 08:19:01 UTC

Severity: normal

Tags: moreinfo, patch

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 34343 <at> debbugs.gnu.org, Felicián Németh <felician.nemeth <at> gmail.com>
Subject: bug#34343: [PATCH] Make project--find-regexp-in-files work with remote files
Date: Tue, 7 Jan 2020 17:34:38 +0300
On 07.01.2020 16:29, Michael Albinus wrote:

> handler would be tramp-file-name-handler, so I don't see how it helps.

See my previous patch. It would only need one comparison, and 
file-remote-p wouldn't need to be mentioned.

>> Well, if you like the following piece of code, I guess we could live
>> with that.
>>
>>        (setq files (mapcar
>>                     (if (tramp-tramp-file-p dir)
>>                         #'tramp-file-local-name
>>                         #'file-local-name)
>>                     files)))
> 
> That would work. If you are sure that you will handle only Tramp based
> remote files, you could simplify this to
> 
> (setq files (mapcar #'tramp-file-local-name files))

Of course I'm not sure. Hence the conditional.

>> By the way, I have no idea what to do about having tramp-tramp-file-p
>> called twice.
> 
> Take the tramp-tramp-file-p call out of mapcar, like
> 
> (let ((fun (if (tramp-tramp-file-p dir)
>                 #'tramp-file-local-name #'file-local-name)))
>    (setq files (mapcar fun files)))

The above is pretty much equivalent.

Anyway, please never mind. It's just one extra call to 
tramp-tramp-file-p. Not twice per each file.




This bug report was last modified 3 years and 303 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.