Function: majutsu-jj--completion-payload

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

Signature

(majutsu-jj--completion-payload ARGS &optional CATEGORY)

Documentation

Return jj native completion payload for ARGS.

ARGS are command-line arguments after the leading jj executable name.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-jj.el
(defun majutsu-jj--completion-payload (args &optional category)
  "Return jj native completion payload for ARGS.
ARGS are command-line arguments after the leading jj executable name."
  (let* ((category (or category 'majutsu-revision))
         (items (majutsu-jj-completion-items args))
         (annotations (make-hash-table :test #'equal))
         candidates)
    (dolist (item items)
      (let ((candidate (if (consp item) (car item) item))
            (annotation (and (consp item) (cdr item))))
        (when (and (stringp candidate) (not (string-empty-p candidate)))
          (push candidate candidates)
          (when (and (stringp annotation) (not (string-empty-p annotation)))
            (puthash candidate annotation annotations)))))
    (list :category category
          :candidates (nreverse candidates)
          :annotations annotations
          :annotation-suffix-function
          (majutsu-jj--completion-suffix-function annotations))))