Function: evil-delimited-arguments
evil-delimited-arguments is a byte-compiled function defined in
evil-common.el.
Signature
(evil-delimited-arguments STRING &optional COUNT)
Documentation
Parse STRING as a sequence of delimited arguments.
Return a list of COUNT strings, or as many arguments as the string contains. The first non-blank character is taken to be the delimiter. If some arguments are missing from STRING, the resulting list is padded with nil values. Two delimiters following directly after each other gives an empty string.
Source Code
;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-common.el
(defun evil-delimited-arguments (string &optional count)
"Parse STRING as a sequence of delimited arguments.
Return a list of COUNT strings, or as many arguments as the string
contains. The first non-blank character is taken to be the delimiter.
If some arguments are missing from STRING, the resulting list is
padded with nil values. Two delimiters following directly after each
other gives an empty string."
(unless count (setq count -1))
(let ((idx 0) delim regexp result)
(when (string-match "^[[:space:]]*\\([^[:space:]]\\)" string)
(setq delim (match-string 1 string)
regexp (format "%s\\(\\(?:\\\\.\\|[^%s]\\)*\\)"
(regexp-quote delim) delim))
(while (and (/= count 0) (string-match regexp string idx)
(/= (match-beginning 1) (length string)))
(setq idx (match-end 0)
count (1- count))
(push
(if (when (= count 0)
(not (string-match-p
(concat (regexp-quote delim) "[[:space:]]*$")
string idx)))
(substring string (match-beginning 1))
(match-string 1 string))
result)))
(dotimes (_ count) (push nil result))
(nreverse result)))