From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#34343: [PATCH] Make project--find-regexp-in-files work with remote files Date: Tue, 7 Jan 2020 17:34:38 +0300 Message-ID: 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> <87zhezwd9x.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="147118"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 Cc: =?UTF-8?Q?Felici=C3=A1n_?= =?UTF-8?Q?N=C3=A9meth?= , 34343@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jan 07 16:06:23 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 1ioqR4-000ZX7-If for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Jan 2020 16:06:22 +0100 Original-Received: from localhost ([::1]:50936 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioqR2-0000Hl-W0 for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Jan 2020 10:06:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40813) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iopwl-0007nR-Hr for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 09:35:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iopwk-00020u-FE for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 09:35:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41609) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iopwk-00020l-BN for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 09:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iopwk-00089a-7V for bug-gnu-emacs@gnu.org; Tue, 07 Jan 2020 09:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Jan 2020 14:35: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.157840768931316 (code B ref 34343); Tue, 07 Jan 2020 14:35:02 +0000 Original-Received: (at 34343) by debbugs.gnu.org; 7 Jan 2020 14:34:49 +0000 Original-Received: from localhost ([127.0.0.1]:47582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iopwX-000892-AQ for submit@debbugs.gnu.org; Tue, 07 Jan 2020 09:34:49 -0500 Original-Received: from mail-lj1-f194.google.com ([209.85.208.194]:34026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iopwV-00088j-Do for 34343@debbugs.gnu.org; Tue, 07 Jan 2020 09:34:47 -0500 Original-Received: by mail-lj1-f194.google.com with SMTP id z22so50157035ljg.1 for <34343@debbugs.gnu.org>; Tue, 07 Jan 2020 06:34:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=9q2DoR3/cFqZshMInYs3cqZsi6XHxbO4UieppPDkyMA=; b=dljnswCQq9iAhEON5fZhE++NJh677dlbUA1Ek4FQqukOrdT1GqUW1PV25VpgbRZElw dMvoVZ4qUnUo63wy76QkhoFqg/lrZrVup/1zSD3MsEHobj0y8GPflq40esFgovtSFm4N WJYV2v+IHek4WHn4xfrKnfJQng45V783xGmGRq9MZB+V9JTv7llg2uhx66r7FjSvE2Mv KCh/QS3+6ICemU/jsmvPlq9HKYIb5VRJDbiduXr4ZohWDuAKwl+9Vqyz3Hj3q6HeABGM 9avJgGYX6cRyUamcUTy1b3xEcwnjtC12Ss5ep38nWjz21atDK3UJX0DkiH3QQl90bBXH C/JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9q2DoR3/cFqZshMInYs3cqZsi6XHxbO4UieppPDkyMA=; b=CGT9D2Kk3sILJj8WmXsq4xsBveRLJ4AWc/9fGyfjQvKz9wkfrXhvkbCP2UGM6GtYzd SIYRCK/ioEiAOrLcv7hpP8YY7sLm7jdUDaRLxVkSDk2iOKPe58++U48lI2QcSzrSCWRn 8Av24ROdrUEpuEOpsiyFeyKFoycfnPeKRrFvICBIkw0E6QKHpJ/sncxOmjvj71jctmBL QRwuITGDZ2D2IQxys0IExabr15N9+q2CBUAjjyxED3Eylnr6aWvlxKPYxMrGTY4QbpV3 04KPV2LBCsupTn4yVM1l43QsW/QVh/RHZ95saOvQIvoRpTI7QnZgtLmeNeksA/pSnkQA wqdw== X-Gm-Message-State: APjAAAWeYS91eqUS+JNNgEa40vOJRZeJx1Sq9KlIXobJvcNR5bdvMuen xn2eYqlDeUxTlFCqrrIzVXgq/CPK4lI= X-Google-Smtp-Source: APXvYqy30ts1DMS9QZH2WkTtOfA1rxaLXi+QOrkchPKuD6aVxgfuehw4Qql0u95SnoaNlxbu7lwcow== X-Received: by 2002:a2e:b0db:: with SMTP id g27mr65107292ljl.74.1578407680972; Tue, 07 Jan 2020 06:34:40 -0800 (PST) Original-Received: from [192.168.1.142] ([178.252.127.239]) by smtp.googlemail.com with ESMTPSA id e20sm30888484ljl.59.2020.01.07.06.34.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Jan 2020 06:34:39 -0800 (PST) In-Reply-To: <87zhezwd9x.fsf@gmx.de> Content-Language: en-US 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:174303 Archived-At: 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.