Function: python-shell-get-buffer

python-shell-get-buffer is a byte-compiled function defined in python.el.gz.

Signature

(python-shell-get-buffer)

Documentation

Return inferior Python buffer for current buffer.

If current buffer is in inferior-python-mode, return it.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/python.el.gz
(defun python-shell-get-buffer ()
  "Return inferior Python buffer for current buffer.
If current buffer is in `inferior-python-mode', return it."
  (if (derived-mode-p 'inferior-python-mode)
      (current-buffer)
    (seq-some
     (lambda (dedicated)
       (let* ((proc-name (python-shell-get-process-name dedicated))
              (buffer-name (format "*%s*" proc-name)))
         (when (comint-check-proc buffer-name)
           buffer-name)))
     '(buffer project nil))))