Function: majutsu-call-jj
majutsu-call-jj is a natively compiled function defined in
majutsu-process.el.
Signature
(majutsu-call-jj &rest ARGS)
Documentation
Call jj synchronously in a separate process, for side-effects.
Process output goes into a new section in the buffer returned by
majutsu-process-buffer. Return the exit code.
Unlike majutsu-start-jj, this does not implicitly refresh any Majutsu
buffers. Call majutsu-refresh explicitly when desired.
This function waits using accept-process-output rather than
process-file, so Emacs can continue to service subprocesses such as an
Emacs-based GPG pinentry while jj is running.
Source Code
;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-process.el
(defun majutsu-call-jj (&rest args)
"Call jj synchronously in a separate process, for side-effects.
Process output goes into a new section in the buffer returned by
`majutsu-process-buffer'. Return the exit code.
Unlike `majutsu-start-jj', this does not implicitly refresh any Majutsu
buffers. Call `majutsu-refresh' explicitly when desired.
This function waits using `accept-process-output' rather than
`process-file', so Emacs can continue to service subprocesses such as an
Emacs-based GPG pinentry while jj is running."
(let* ((default-directory (majutsu--toplevel-safe default-directory))
(jj (majutsu-jj--executable))
(args (majutsu-process-jj-arguments args))
(pwd default-directory)
(process-buf (let ((default-directory pwd))
(majutsu-process-buffer t)))
(process-root (with-current-buffer process-buf default-directory)))
(pcase-let* ((section
(with-current-buffer process-buf
(prog1 (majutsu--process-insert-section pwd jj args nil nil)
(backward-char 1))))
(inhibit-read-only t)
(exit (apply #'majutsu--call-process-responsive
jj process-buf section process-root args)))
(setq exit (majutsu-process-finish exit process-buf (current-buffer) process-root section))
exit)))