diff options
| author | Ken Manheimer | 2015-09-19 21:34:36 -0400 |
|---|---|---|
| committer | Ken Manheimer | 2015-09-19 21:34:36 -0400 |
| commit | 89898fcd83db040923a2d454e849bfcc0f463bd4 (patch) | |
| tree | e248958258486ded2237ee9212c5cf006aecb9e9 /lisp/progmodes/python.el | |
| parent | df6f6107257cb76d994fff97fc8904a3d1bd3fb4 (diff) | |
| download | emacs-89898fcd83db040923a2d454e849bfcc0f463bd4.tar.gz emacs-89898fcd83db040923a2d454e849bfcc0f463bd4.zip | |
Repair pdbtrack so it follows transition from one remote file to another.
* python.el (python-pdbtrack-set-tracked-buffer).
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 9528ffeebbc..243125e310c 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -3635,12 +3635,18 @@ Never set this variable directly, use | |||
| 3635 | "Set the buffer for FILE-NAME as the tracked buffer. | 3635 | "Set the buffer for FILE-NAME as the tracked buffer. |
| 3636 | Internally it uses the `python-pdbtrack-tracked-buffer' variable. | 3636 | Internally it uses the `python-pdbtrack-tracked-buffer' variable. |
| 3637 | Returns the tracked buffer." | 3637 | Returns the tracked buffer." |
| 3638 | (let ((file-buffer (get-file-buffer | 3638 | (let* ((file-name-prospect (concat (file-remote-p default-directory) |
| 3639 | (concat (file-remote-p default-directory) | 3639 | file-name)) |
| 3640 | file-name)))) | 3640 | (file-buffer (get-file-buffer file-name-prospect))) |
| 3641 | (if file-buffer | 3641 | (if file-buffer |
| 3642 | (setq python-pdbtrack-tracked-buffer file-buffer) | 3642 | (setq python-pdbtrack-tracked-buffer file-buffer) |
| 3643 | (setq file-buffer (find-file-noselect file-name)) | 3643 | (cond |
| 3644 | ((file-exists-p file-name-prospect) | ||
| 3645 | (setq file-buffer (find-file-noselect file-name-prospect))) | ||
| 3646 | ((and (not (equal file-name file-name-prospect)) | ||
| 3647 | (file-exists-p file-name)) | ||
| 3648 | ;; Fallback to a locally available copy of the file. | ||
| 3649 | (setq file-buffer (find-file-noselect file-name-prospect)))) | ||
| 3644 | (when (not (member file-buffer python-pdbtrack-buffers-to-kill)) | 3650 | (when (not (member file-buffer python-pdbtrack-buffers-to-kill)) |
| 3645 | (add-to-list 'python-pdbtrack-buffers-to-kill file-buffer))) | 3651 | (add-to-list 'python-pdbtrack-buffers-to-kill file-buffer))) |
| 3646 | file-buffer)) | 3652 | file-buffer)) |