From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [elpa] master 2751b96 1/2: Issue #40: Use process-file instead of shell-command-to-string Date: Tue, 27 Dec 2016 10:34:01 -0500 Message-ID: References: <20161227122750.6385.19869@vcs.savannah.gnu.org> <20161227122750.AD0A72201C7@vcs.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1482853859 32662 195.159.176.226 (27 Dec 2016 15:50:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Dec 2016 15:50:59 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: Alexey Veretennikov To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 27 16:50:56 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLu1Y-0006xH-KV for ged-emacs-devel@m.gmane.org; Tue, 27 Dec 2016 16:50:48 +0100 Original-Received: from localhost ([::1]:54659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLu1d-0000YK-FJ for ged-emacs-devel@m.gmane.org; Tue, 27 Dec 2016 10:50:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLtlR-0003rF-RY for emacs-devel@gnu.org; Tue, 27 Dec 2016 10:34:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLtlN-0005Sd-8b for emacs-devel@gnu.org; Tue, 27 Dec 2016 10:34:09 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:59905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLtlN-0005SE-5E for emacs-devel@gnu.org; Tue, 27 Dec 2016 10:34:05 -0500 Original-Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id uBRFY1bU008365; Tue, 27 Dec 2016 10:34:01 -0500 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 420C9AE10D; Tue, 27 Dec 2016 10:34:01 -0500 (EST) In-Reply-To: <20161227122750.AD0A72201C7@vcs.savannah.gnu.org> (Alexey Veretennikov's message of "Tue, 27 Dec 2016 12:27:50 +0000 (UTC)") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV5901=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5901> : inlines <5609> : streams <1726485> : uri <2347965> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:210840 Archived-At: > + (file2-untrampified (ztree-untrampify-filename file2))) > + (if (or > + (/= (nth 7 (file-attributes file1-untrampified)) > (nth 7 (file-attributes file2-untrampified))) > - (> (length (shell-command-to-string diff-cmd)) 2)) > + (/= 0 (process-file diff-command nil nil nil "-q" > + file1-untrampified > + file2-untrampified))) process-file decides on which host to run the command based on default-directory, so you should be careful to set it (that's why in my example I bound it to (file-name-directory file1). Then using file-relative-name saved me from having to mention Tramp explicitly). Stefan