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#38648: 27.0.50; Emacs `compile' command does not handle remote (over TRAMP) file name correctly Date: Tue, 17 Dec 2019 17:02:12 +0100 Message-ID: <8736djym7v.fsf@gmx.de> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="101772"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 38648@debbugs.gnu.org To: Fan Yang Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 17 17:04:30 2019 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 1ihFKn-000QKW-KG for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Dec 2019 17:04:29 +0100 Original-Received: from localhost ([::1]:42458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihFKm-0004TQ-5J for geb-bug-gnu-emacs@m.gmane.org; Tue, 17 Dec 2019 11:04:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37477) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihFJU-0003MB-4z for bug-gnu-emacs@gnu.org; Tue, 17 Dec 2019 11:03:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihFJP-0008IM-76 for bug-gnu-emacs@gnu.org; Tue, 17 Dec 2019 11:03:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36270) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ihFJO-0008Ee-Uv for bug-gnu-emacs@gnu.org; Tue, 17 Dec 2019 11:03:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ihFJN-0006nq-Sz for bug-gnu-emacs@gnu.org; Tue, 17 Dec 2019 11:03:01 -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, 17 Dec 2019 16:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38648 X-GNU-PR-Package: emacs Original-Received: via spool by 38648-submit@debbugs.gnu.org id=B38648.157659857526135 (code B ref 38648); Tue, 17 Dec 2019 16:03:01 +0000 Original-Received: (at 38648) by debbugs.gnu.org; 17 Dec 2019 16:02:55 +0000 Original-Received: from localhost ([127.0.0.1]:42243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ihFJH-0006nS-70 for submit@debbugs.gnu.org; Tue, 17 Dec 2019 11:02:55 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:49061) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ihFJC-0006n7-8r for 38648@debbugs.gnu.org; Tue, 17 Dec 2019 11:02:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1576598535; bh=ntQFFOqcAAhLmo4ov2xpQnYJL31Ya3XfDw0HfzwFyXk=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=MfRXgjtSH1W70pHkKxCYJxElRpRipcTcIGByy0tXI858NACuBiKCm62Ma1isgyTMt oKttq3Cvv0x3gUaYlc0fQOIHTtzt94ShueXRT5L1nIBm9I5gjA6bBgy9yfrSQhKK2x OJzBIVBB4VubFZklEw1adr8ZogxfA3R2FhCaBJ8w= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from detlef.gmx.de ([217.70.140.123]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MOiHl-1iKsQq0Ac3-00Q7jz; Tue, 17 Dec 2019 17:02:15 +0100 In-Reply-To: (Fan Yang's message of "Tue, 17 Dec 2019 20:44:28 +0800") X-Provags-ID: V03:K1:SeZlVS7BS0vaGkGDr7yEe05kAYNaVUDEuSFQrxqyYs1ar6fC5NS HQFhjqUwKYALbN/gprgWV00Cv2CriZts+PrW6bN5T+X8S2q0MiNEvBOa5hOLWIOyziEiJju Tbw4HqhgBuOCPA/DdHSjNm1AgxBXIuWLJcfEGVh/KDeyhkgAxkXmkTqHV2yNb+xk6ZSDNsT dAKOqEd1ym/JIZa0IldrQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:2sjgJ9Cp6Dc=:PDJqO524IlPt92ZBnfyu6y 5EDkcaIEV6QMZn0exd2eZiaV23ZNT0m51iSDKyoIesW4Mns1jS6vK9QkUQs7Vd5I9lknYHgmD w5zGTJHUFR4qbS2GSuAnsLhn2M1CPgM6OQgyWAePP/8t3u+PdsrgrQhFH+RylD/p6E4An36KQ HBzXZ/gnbDtZ1tHDW1SX18Squ3d9s58cPCEonMg8NI1vcpMB4MGHhmO30hm8YkoRYOMMcbXPv Yl0oZ3hVel+jdF5LOCmNr5haYPmj+VghZhQ/FVvuRO7Hg9mvToTcXL6L0iOWL3shYRrdrAdLF qnyIBdvNsC1aEUD9qM8vRmo+RAWqGSfBPvJx0b+wBELLIFoWt98ztbZkamNiTYY/7H7TVKAy9 CTldXXlujcYPRiKhHY9EajcCEj8P8QIhq9AofMWihUHrl1HI3BlNjsxSxKe/m1NOORuZqXcVE gxVxnPCII18JYmPZRsXQE449z88OyRdiHNfI29oYcMV8r7S9MVRUkvZYAXtHd/8uhhwQTpEBG bPn2nILs+bZpnGbGsJLu9qWsUR48ZP61w15myo6OHwBiX76KnHuuplmTg0f8Oia4FgeDqxV/s VRISUqD5TxQJ7YpNUaV2b/h6+WmlOlS6IqeO1EDk8cVoR4xxOsKoauLhJ9sk/jhhBuY+p7n6H sWjpvbIKI79zUCILzV9rMFKVQfs+ezKGcWcfZP1qLS3cXJ+6Or5OzT6mO2y+znbgBdp7CKtqN oCAAqywHzknNI5JMV57f3ZVpEZER0vaV1Q9ZaGqS+FweIi+k7n9xt7eDB34BOJ0ljRdvYp93 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:173485 Archived-At: --=-=-= Content-Type: text/plain Fan Yang writes: Hi, > Re-produce steps: > > 1. `find-file' to my project root directory on a remote machine, > namely, "/scp:vm00:pmdk-balloon/". > 2. `M-x compile', and give compile command "make". > 3. (Previously I have injected some typos in some of my source files, > say "obj.c"). > 4. In the *compilation* buffer, the "obj.c" file appears. But when I > click the underlined text (or on it), an error occurs in the > minibuffer: > > "Find this error in (default obj.c): /scp:vm00:/System/Volumes/Data/home/fan/pmdk-balloon/src/libpmemobj" > > The "/System/Volumes/Data/" is actually a path on my local machine. > It appears that when compile.el was handling the remote path, it > mixed-up part of my local machine path with the > remote machine path, resulting the error. > > Then I find that in my environment, `(file-symlink-p "/home")' is > evaluated to "/System/Volumes/Data/home". Now I stuck here since I know > little about TRAMP and how a remote file path should be handled. Could you pls check, whether the appended patch fixes the problem? Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 3fbd6eb2c7..197d52b2de 100644 =2D-- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -2936,21 +2936,15 @@ compilation-get-file-structure ;; Let's normalize it and look again. (let ((filename (car file)) ;; Get the specified directory from FILE. - (spec-directory (if (cdr file) - (file-truename (cdr file))))) + (spec-directory + (if (cdr file) + (file-truename (concat comint-file-name-prefix (cdr file)))))) ;; Check for a comint-file-name-prefix and prepend it if appropriate. ;; (This is very useful for compilation-minor-mode in an rlogin-mode ;; buffer.) - (when (and (boundp 'comint-file-name-prefix) - (not (equal comint-file-name-prefix ""))) - (if (file-name-absolute-p filename) - (setq filename - (concat comint-file-name-prefix filename)) - (if spec-directory - (setq spec-directory - (file-truename - (concat comint-file-name-prefix spec-directory)))))) + (if (file-name-absolute-p filename) + (setq filename (concat comint-file-name-prefix filename))) ;; If compilation-parse-errors-filename-function is ;; defined, use it to process the filename. The result might be a --=-=-=--