From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#34343: [PATCH] Make project--find-regexp-in-files work with remote files Date: Tue, 07 Jan 2020 15:29:30 +0100 Message-ID: <87zhezwd9x.fsf@gmx.de> References: <87h81mqiq5.fsf@gmx.de> <0ff03b20-20d8-b6c0-c876-3fd525586180@yandex.ru> <87mubdps6s.fsf@gmx.de> <87blrsz3tf.fsf@gmx.de> <87blrrmht9.fsf@gmx.de> <87tv5fs6kf.fsf@gmx.de> <7a1e2e22-89d4-b8b9-6cd4-e6947436138c@yandex.ru> <87mub6uoa6.fsf@gmx.de> <87blrksxco.fsf@gmx.de> <81589ba9-0f93-599d-e55f-6605479454b0@yandex.ru> <87y2ukjuan.fsf@gmx.de> <10dbccdd-99e8-883b-01e6-e8d3bc1e195e@yandex.ru> <87k163fwsl.fsf@gmx.de> <7d46d704-6bcb-391c-64bb-4a443a88130d@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="69668"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: =?UTF-8?Q?Felici=C3=A1n_?= =?UTF-8?Q?N=C3=A9meth?= , 34343@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 07 16:05:16 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ioqPx-000FGx-KA for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Jan 2020 16:05:13 +0100 Original-Received: from localhost ([::1]:50856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioqPw-0006Ze-0Z for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Jan 2020 10:05:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39580) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioprx-0001Vb-Uu for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 09:30:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioprv-0007qI-PO for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 09:30:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41605) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioprv-0007nx-La for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 09:30:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iopru-00081B-IY for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 09:30:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Jan 2020 14:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 34343-submit@debbugs.gnu.org id=B34343.157840738930775 (code B ref 34343); Tue, 07 Jan 2020 14:30:02 +0000 Original-Received: (at 34343) by debbugs.gnu.org; 7 Jan 2020 14:29:49 +0000 Original-Received: from localhost ([127.0.0.1]:47578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ioprg-00080J-Nb for submit@debbugs.gnu.org; Tue, 07 Jan 2020 09:29:48 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:44459) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iopre-000805-HI for 34343@debbugs.gnu.org; Tue, 07 Jan 2020 09:29:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1578407379; bh=YC0mvS1p/0JqH8ZfoNmP5mCGTOK1JsPpdHYQQtSqN9w=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=QnMaWhGEHflWGBD6jIs373gAKebsQzQY3mPOBPeG1UGzYreh33QSRyit0KBRF/bPF EbE3zM0+NK/LfqO6obQ4GzbdjQSx899/XiqsFD/lNQjGz3v0RhNwvmTfdeF1AtK/35 /9pp14ZgziuEw4sGHChfcCE/Ztd8xQ3I2nbVUp4w= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from detlef.gmx.de ([212.91.238.170]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MfYLa-1jLgdf2YXY-00g2U8; Tue, 07 Jan 2020 15:29:39 +0100 In-Reply-To: <7d46d704-6bcb-391c-64bb-4a443a88130d@yandex.ru> (Dmitry Gutov's message of "Tue, 7 Jan 2020 16:40:10 +0300") X-Provags-ID: V03:K1:GenOkgYvauoFzW7e+bt5CJsn604QS1EXByS2F/0esl22N9di9BO PefRxbs9TaHR8dZP3NHnrYVwKXdIsZPAaQfZUH5TTBI4LpclVUpZHGeq4ABXdaNJ4Th5BA2 DjxazL65YJNW2HxyebtwFviEVsVpyyIPaXT9ryjF3Y5X7l+a1EvG6j+GQziaWPy1+jeD5+G AsFnJIRDihVjPgKSXTlDA== X-UI-Out-Filterresults: notjunk:1;V03:K0:+tUU3SaAUd0=:Dzg+xBfLXvAEF9N5TT/zn/ S/kjQNiqrd6DXxRWKjBDKsMXNmFbORQGzwUGREJ6XZM2BPPIIiznFEsMhcU1HGJqecJwyg0in 1KbZ63ciRoANEGG8raLGe6Siqvv1OAdDp38o2SgCFNITHWWMuGrzGX8MDvBpllyzfvJc6NfPb Hk+JdvoqVqfIwVqRIxtq7DhGrCmUy4+RMimF1Knsp7qiwDTVc7B0Bl9u6enUow6xoJifoyZWv +AiAD8rtANSosGyLE3E9zpUrJwX6PYNY8vqnqjGCGui3S3CVfg+lEJKLCkIDqoqHSFJ77CgjP P8wdziRK2ZxKkxUuvgkQ9hFpTYXUz3uWWD1d4Q5o9g6Gdtv4lKhl23IdCjNM8Zdh3cmCEqIHd 05x8WW6pYdpGlzh73Z4ojZeV+G7TKxEOQFdjB0c1d/dU1FkgkBlBOsVDJzo4lR9sRLwqPjGWi gsitt3LrQyWfpQuSKCBNIZnhl9tj1Yk8bhs5W3t1tVccJRztCfeMG4DKjyex8DGCEjxtNbdy9 hxlkHnc4cHHFWcjs/duGTZ3Ib5L7D+pHiqPCnK7zzktn5Dg/gVWojOP6RF4VwRZmeQj7990HV GgMFLz/W2t1Z69NbpIBwSrP+S3ijOGnt4ZGQJzGNdlF2O35+Jj9O3XEYBF6Ol4HDP5quIp1ne D3qaKLoZYzkVZs6W7dKFFhPBOUKfNKhmFqcOzUFKx0HeZTuIGLPEfCMCUoxj8lcViLKR0O7Ik 0KnlLO9b1G5humJZNYVwu8WIUizVamqGG6+94fZ7W2FUoobxBiP6mPFZwC07EheYGUhiydLn X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:174302 Archived-At: Dmitry Gutov writes: > (defun file-local-name (file) > "Return the local name component of FILE. > This function removes from FILE the specification of the remote host > and the method of accessing the host, leaving only the part that > identifies FILE locally on the remote system. > The returned file name can be used directly as argument of > `process-file', `start-file-process', or `shell-command'." > (let ((handler (find-file-name-handler file 'file-local-name))) > (if handler > (funcall handler 'file-local-name file) > ;; Until all the implementations switch over, > ;; not sure how long to keep the compatibility here. > (or (file-remote-p file 'localname) file)))) handler would be tramp-file-name-handler, so I don't see how it helps. > 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)) > 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))) Best regards, Michael.