diff options
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)) |