Function: magit--with-temp-process-buffer

magit--with-temp-process-buffer is a macro defined in magit-git.el.

Signature

(magit--with-temp-process-buffer &rest BODY)

Documentation

Like with-temp-buffer, but always propagate process-environment.

When that var is buffer-local in the calling buffer, it is not propagated by with-temp-buffer, so we explicitly ensure that happens, so that processes will be invoked consistently. BODY is as for that macro.

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-git.el
(defmacro magit--with-temp-process-buffer (&rest body)
  "Like `with-temp-buffer', but always propagate `process-environment'.
When that var is buffer-local in the calling buffer, it is not
propagated by `with-temp-buffer', so we explicitly ensure that
happens, so that processes will be invoked consistently.  BODY is
as for that macro."
  (declare (indent 0) (debug (body)))
  (let ((p (gensym)))
    `(let ((,p process-environment))
       (with-temp-buffer
         (setq-local process-environment ,p)
         ,@body))))