[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG] Full file path (/ssh:remote...) when executing a saved Python
From: |
Michael Albinus |
Subject: |
Re: [BUG] Full file path (/ssh:remote...) when executing a saved Python script |
Date: |
Sat, 14 Sep 2013 09:50:18 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
[CC address@hidden, address@hidden
Kit-Yan Choi <address@hidden> writes:
> Hi Michael,
Hi Kit,
> Thank you for your response! I was editing the script saved on the
> remote machine and press C-c C-c to execute the buffer after saving
> (C-x C-s).
>
> I am using Emacs 23.3.1 with Tramp and python-mode 6.1.1 (the one
> found on launchpad).
For the readers on address@hidden: Kit has saved a python script
on a remote host, and tries to execute it afterwards from the respective
buffer.
I have installed python-mode 6.1.1 and could reproduce the
problem. First I've tried the more recent python-mode 6.1.2, but I did
run into other problems when pressing C-c C-c even for a local python
script. Maybe somebody from the python-mode guys could check.
With python-mode 6.1.1, the following patch solves the problem for me:
--8<---------------cut here---------------start------------->8---
*** /home/albinus/Downloads/python-mode.el-6.1.1/python-mode.el.~1~
2013-02-15 20:51:37.000000000 +0100
--- /home/albinus/Downloads/python-mode.el-6.1.1/python-mode.el 2013-09-14
09:37:28.549155641 +0200
***************
*** 9373,9379 ****
(strg (buffer-substring-no-properties start end))
(sepchar (or sepchar (char-to-string py-separator-char)))
(py-buffer-name (py-buffer-name-prepare pyshellname sepchar))
! (localname file)
(switch (or switch py-switch-buffers-on-execute-p))
(split (or split py-split-windows-on-execute-p))
(proc (if dedicated
--- 9373,9379 ----
(strg (buffer-substring-no-properties start end))
(sepchar (or sepchar (char-to-string py-separator-char)))
(py-buffer-name (py-buffer-name-prepare pyshellname sepchar))
! (localname (or (file-remote-p file 'localname) file))
(switch (or switch py-switch-buffers-on-execute-p))
(split (or split py-split-windows-on-execute-p))
(proc (if dedicated
--8<---------------cut here---------------end--------------->8---
But I don't know python-mode.el, maybe there's a better (more central)
place to apply such a patch.
> Kit
Best regards, Michael.