Function: majutsu-diff--range-option

majutsu-diff--range-option is a natively compiled function defined in majutsu-diff.el.

Signature

(majutsu-diff--range-option LONG &optional SHORT)

Documentation

Return LONG (or SHORT) option value from the current diff range.

Both --option=VALUE and the two-argument --option VALUE forms are accepted. Return the symbol missing when the option is absent, and an empty string when it is present without a value.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-diff.el
(defun majutsu-diff--range-option (long &optional short)
  "Return LONG (or SHORT) option value from the current diff range.
Both `--option=VALUE' and the two-argument `--option VALUE' forms are
accepted.  Return the symbol `missing' when the option is absent, and an
empty string when it is present without a value."
  (let ((args majutsu-buffer-diff-range)
        (value 'missing))
    (while (and args (eq value 'missing))
      (let ((arg (pop args)))
        (cond
         ((or (equal arg long) (and short (equal arg short)))
          (setq value (if (and args (stringp (car args)))
                          (pop args)
                        "")))
         ((and (stringp arg)
               (string-prefix-p (concat long "=") arg))
          (setq value (substring arg (1+ (length long))))))))
    value))