Function: majutsu--jj-completion-argv

majutsu--jj-completion-argv is a natively compiled function defined in majutsu-command.el.

Signature

(majutsu--jj-completion-argv COMMAND)

Documentation

Return argv to pass to jj's completion engine for COMMAND.

COMMAND is the minibuffer text before point. Preserve an empty trailing argument when completion happens after whitespace.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-command.el
(defun majutsu--jj-completion-argv (command)
  "Return argv to pass to jj's completion engine for COMMAND.
COMMAND is the minibuffer text before point.  Preserve an empty trailing
argument when completion happens after whitespace."
  (let* ((ends-in-space (or (string-empty-p command)
                            (string-match-p "[  ]\'" command)))
         (argv (condition-case nil
                   (split-string-shell-command command)
                 (error nil)))
         (jj (majutsu-jj--executable)))
    (when (and argv
               (string= (majutsu--command-program-name (car argv))
                        (majutsu--command-program-name jj)))
      (setq argv (cdr argv)))
    (when ends-in-space
      (setq argv (append argv '(""))))
    argv))