Function: projection--with-shell-command-buffer

projection--with-shell-command-buffer is a macro defined in projection-utils.el.

Signature

(projection--with-shell-command-buffer COMMAND &rest BODY)

Documentation

Run BODY in a temporary buffer with the output of COMMAND.

Source Code

;; Defined in /nix/store/j6y921qbdmdqxjnd43iibapbig3p4hai-emacs-packages-deps/share/emacs/site-lisp/elpa/projection-20260614.1822/projection-utils.el
(defmacro projection--with-shell-command-buffer (command &rest body)
  "Run BODY in a temporary buffer with the output of COMMAND."
  (declare (indent defun))
  ;; We evaluate the command before we move to a temporary buffer to ensure
  ;; if it depends on any buffer local variables then they are available.
  `(let ((projection--with-shell-command-buffer-command ,command))
     (with-temp-buffer
       (insert (or
                (projection--shell-command-to-string
                 projection--with-shell-command-buffer-command)
                ""))
       (goto-char (point-min))
       (unless (string-empty-p (buffer-substring (point-min) (point-max)))
         ,@body))))