Function: python-shell-get-process-name

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

Signature

(python-shell-get-process-name DEDICATED)

Documentation

Calculate the appropriate process name for inferior Python process.

If DEDICATED is nil, this is simply python-shell-buffer-name. If DEDICATED is buffer or project, append the current buffer name respectively the current project name.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/python.el.gz
(defun python-shell-get-process-name (dedicated)
  "Calculate the appropriate process name for inferior Python process.
If DEDICATED is nil, this is simply `python-shell-buffer-name'.
If DEDICATED is `buffer' or `project', append the current buffer
name respectively the current project name."
  (pcase dedicated
    ('nil python-shell-buffer-name)
    ('project
     (if-let ((proj (and (featurep 'project)
                         (project-current))))
         (format "%s[%s]" python-shell-buffer-name (file-name-nondirectory
                                                    (directory-file-name
                                                     (project-root proj))))
       python-shell-buffer-name))
    (_ (format "%s[%s]" python-shell-buffer-name (buffer-name)))))