Function: majutsu-read-revset

majutsu-read-revset is a natively compiled function defined in majutsu-jj.el.

Signature

(majutsu-read-revset PROMPT &key DEFAULT INITIAL-INPUT HISTORY COMPLETION-ARGS ALLOW-EMPTY)

Documentation

Read a free-form revset expression with PROMPT.

DEFAULT, INITIAL-INPUT, HISTORY, COMPLETION-ARGS, and ALLOW-EMPTY have the same meaning as in majutsu-read-revision.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-jj.el
(cl-defun majutsu-read-revset
    (prompt &key default initial-input history completion-args allow-empty)
  "Read a free-form revset expression with PROMPT.

DEFAULT, INITIAL-INPUT, HISTORY, COMPLETION-ARGS, and ALLOW-EMPTY have
the same meaning as in `majutsu-read-revision'."
  (setq default
        (or default
            (and (not allow-empty)
                 (or (majutsu-revision-at-point) "@"))))
  (let ((majutsu-jj--revset-completion-args completion-args))
    (let ((value (minibuffer-with-setup-hook
                     #'majutsu-jj--revset-minibuffer-setup
                   (read-from-minibuffer
                    (format-prompt prompt default)
                    initial-input
                    majutsu-read-revset-map
                    nil
                    (or history 'majutsu-read-revset-history)
                    (and (not allow-empty) default)))))
      (cond
       ((not (string-empty-p value)) value)
       (allow-empty nil)
       ((and default (not (string-empty-p default))) default)
       (t (user-error "Need non-empty input"))))))