Function: python-pdbtrack-set-tracked-buffer

python-pdbtrack-set-tracked-buffer is a byte-compiled function defined in python.el.gz.

Signature

(python-pdbtrack-set-tracked-buffer FILE-NAME)

Documentation

Set the buffer for FILE-NAME as the tracked buffer.

Internally it uses the python-pdbtrack-tracked-buffer variable. Returns the tracked buffer.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/python.el.gz
(defun python-pdbtrack-set-tracked-buffer (file-name)
  "Set the buffer for FILE-NAME as the tracked buffer.
Internally it uses the `python-pdbtrack-tracked-buffer' variable.
Returns the tracked buffer."
  (let* ((file-name-prospect (concat (file-remote-p default-directory)
                              file-name))
         (file-buffer (get-file-buffer file-name-prospect)))
    (unless file-buffer
      (cond
       ((file-exists-p file-name-prospect)
        (setq file-buffer (find-file-noselect file-name-prospect)))
       ((and (not (equal file-name file-name-prospect))
             (file-exists-p file-name))
        ;; Fallback to a locally available copy of the file.
        (setq file-buffer (find-file-noselect file-name-prospect))))
      (when (and python-pdbtrack-kill-buffers
                 (not (member file-buffer python-pdbtrack-buffers-to-kill)))
        (add-to-list 'python-pdbtrack-buffers-to-kill file-buffer)))
    (setq python-pdbtrack-tracked-buffer file-buffer)
    file-buffer))