Function: python-shell--with-environment
python-shell--with-environment is a byte-compiled function defined in
python.el.gz.
Signature
(python-shell--with-environment EXTRAENV BODYFUN)
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/python.el.gz
(defun python-shell--with-environment (extraenv bodyfun)
;; FIXME: This is where the generic code delegates to Tramp.
(let* ((vec
(and (file-remote-p default-directory)
(fboundp 'tramp-dissect-file-name)
(ignore-errors
(tramp-dissect-file-name default-directory 'noexpand)))))
(if vec
(python-shell--tramp-with-environment vec extraenv bodyfun)
(cl-letf (((default-value 'process-environment)
(append extraenv process-environment))
((default-value 'exec-path)
;; FIXME: This is still Python-specific.
(python-shell-calculate-exec-path)))
(funcall bodyfun)))))