From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#29149: Tramp shell uses local shell setting in windows Date: Fri, 17 Nov 2017 15:53:09 +0100 Message-ID: <87tvxtq7my.fsf@gmx.de> References: <8360ahp4zr.fsf@gnu.org> <87inecuaom.fsf@gmx.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1510930455 28482 195.159.176.226 (17 Nov 2017 14:54:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 17 Nov 2017 14:54:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: 29149@debbugs.gnu.org To: Shuguang Sun Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 17 15:54:08 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1eFi1v-0006qS-Vr for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Nov 2017 15:54:08 +0100 Original-Received: from localhost ([::1]:46341 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFi21-0008EI-4y for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Nov 2017 09:54:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFi1u-0008E2-UU for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 09:54:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFi1q-0005jB-Oy for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 09:54:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:35751) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eFi1q-0005it-KE for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 09:54:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eFi1q-0000ou-EF for bug-gnu-emacs@gnu.org; Fri, 17 Nov 2017 09:54: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: Fri, 17 Nov 2017 14:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29149 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29149-submit@debbugs.gnu.org id=B29149.15109304003097 (code B ref 29149); Fri, 17 Nov 2017 14:54:02 +0000 Original-Received: (at 29149) by debbugs.gnu.org; 17 Nov 2017 14:53:20 +0000 Original-Received: from localhost ([127.0.0.1]:44432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFi1A-0000nt-C6 for submit@debbugs.gnu.org; Fri, 17 Nov 2017 09:53:20 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:54770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFi18-0000nd-5W for 29149@debbugs.gnu.org; Fri, 17 Nov 2017 09:53:18 -0500 Original-Received: from detlef.gmx.de ([212.86.60.192]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MOwY7-1eIi133yoZ-006PhC; Fri, 17 Nov 2017 15:53:11 +0100 In-Reply-To: (Shuguang Sun's message of "Thu, 16 Nov 2017 10:20:41 +0800") X-Provags-ID: V03:K0:WXlKESNxXD/119QO2Sac5Fts4I63M2q9ELdbm4LkAO4WR0oNFhy /mKttYnEt0TbOQklgk6B+a0Ro8t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list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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:140006 Archived-At: Shuguang Sun writes: > Hi Michael, Hi Shuguang, > I attached the trace log which has actions: open the file > coxph_bench.r, and edit it, and save it. If you need the full log, > please let me know. Thanks! I'll show the most interesting lines here, which tell us the flow ====================================================================== 1 -> (tramp-file-name-handler find-backup-file-name "/plink:username@host.com:/opt/home/username/test/coxph_bench.r") The function `find-backup-file-name' has called the Tramp file name handler due to the remote nature of the file name. | 2 -> (tramp-sh-file-name-handler find-backup-file-name "/plink:username@host.com:/opt/home/username/test/coxph_bench.r") | | 3 -> (tramp-handle-find-backup-file-name "/plink:username@host.com:/opt/home/username/test/coxph_bench.r") Some Tramp internal flow in order to find the correct funtion. It is `tramp-handle-find-backup-file-name'. | | | 4 -> (tramp-run-real-handler find-backup-file-name ("/plink:username@host.com:/opt/home/username/test/coxph_bench.r")) `tramp-handle-find-backup-file-name' calls again `find-backup-file-name', but suppressing file name handlers. This is intended in order to ensure proper encoding of "/", ":" "!" and alike. | | | | 5 -> (tramp-file-name-handler file-exists-p "/plink:username@host.com:/home/bceuser/username/.emacs.d/backup-tramp/Rfiles") | | | | 5 <- tramp-file-name-handler: t Some other file name operations are called in `find-backup-file-name', which work fine. I've removed them from the trace. The last such operation is `file-exists-p'. | | | | 5 -> (tramp-file-name-handler expand-file-name "/plink!username@host.com!/opt/home/username/test/coxph_bench.r" "/plink:username@host.com:/opt/home/username/test/") `find-backup-file-name' has finished the encoding of the file name (it is "/plink!username@host.com!/opt/home/username/test/coxph_bench.r"). Due to the encoding, it looks like a local file name. Now, `expand-file-name' is called with the encoded file name. Due to the leading "/", it is regarded as absolute file name. Tramp is involved due to the remote default-directory. | | | | 5 <- tramp-file-name-handler: "c:/plink!username@host.com!/opt/home/username/test/coxph_bench.r" ... And this is the problem. Since Tramp sees the local absolute file, it doesn't do anything, but let the default `expand-file-name' do the job. This prefixes the file name with "c:/". The rest is not surprising. The leading "c:" is transformed into "!drive_c!", and here we are. | | | | 5 -> (tramp-file-name-handler expand-file-name "!drive_c!plink!!username@host.com!!!opt!bee!home_nas!username!test!coxph_bench.r" "/plink:username@host.com:~/.emacs.d/backup-tramp/Rfiles") | | | | 5 <- tramp-file-name-handler: "/plink:username@host.com:/home/bceuser/username/.emacs.d/backup-tramp/Rfiles/!drive_c!plink!!username@host.com!!!opt!bee!home_nas!username!test!coxph_bench.r" | | | | 5 -> (tramp-file-name-handler expand-file-name "/plink:username@host.com:/home/bceuser/username/.emacs.d/backup-tramp/Rfiles/" nil) | | | | 5 -> (tramp-file-name-handler file-name-all-completions "!drive_c!plink!!username@host.com!!!opt!bee!home_nas!username!test!coxph_bench.r.~" "/plink:username@host.com:/home/bceuser/username/.emacs.d/backup-tramp/Rfiles/") | | | | 5 <- tramp-file-name-handler: ("!drive_c!plink!!username@host.com!!!opt!bee!home_nas!username!test!coxph_bench.r.~1~") | | | 4 <- tramp-run-real-handler: ("/plink:username@host.com:/home/bceuser/username/.emacs.d/backup-tramp/Rfiles/!drive_c!plink!!username@host.com!!!opt!bee!home_nas!username!test!coxph_bench.r.~2~") | | 3 <- tramp-handle-find-backup-file-name: ("/plink:username@host.com:/home/bceuser/username/.emacs.d/backup-tramp/Rfiles/!drive_c!plink!!username@host.com!!!opt!bee!home_nas!username!test!coxph_bench.r.~2~") | 2 <- tramp-sh-file-name-handler: ("/plink:username@host.com:/home/bceuser/username/.emacs.d/backup-tramp/Rfiles/!drive_c!plink!!username@host.com!!!opt!bee!home_nas!username!test!coxph_bench.r.~2~") 1 <- tramp-file-name-handler: ("/plink:username@host.com:/home/bceuser/username/.emacs.d/backup-tramp/Rfiles/!drive_c!plink!!username@host.com!!!opt!bee!home_nas!username!test!coxph_bench.r.~2~") I have no clue yet how to fix. Pls give me some days to think about. Best regards, Michael.