Function: evil--parse-delmarks

evil--parse-delmarks is a byte-compiled function defined in evil-commands.el.

Signature

(evil--parse-delmarks TO-BE-PARSED &optional PARSED)

Documentation

Where TO-BE-PARSED can contain ranges in the form x-y.

PARSED is a list of characters whose marks should be deleted. Like vim, on invalid input, preceeding valid input is still parsed.

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-commands.el
(defun evil--parse-delmarks (to-be-parsed &optional parsed)
  "Where TO-BE-PARSED can contain ranges in the form `x-y'.
PARSED is a list of characters whose marks should be deleted.
Like vim, on invalid input, preceeding valid input is still parsed."
  (cl-destructuring-bind (&optional a b c &rest) to-be-parsed
    (cond
     ((null to-be-parsed) parsed)
     ;; single mark...
     ((and (not (eq ?- b)) (or (<= ?a a ?z) (<= ?A a ?Z) (<= ?0 a ?9)
                               (memq a '(?\" ?^ ?. ?\[ ?\] ?< ?>))))
      (evil--parse-delmarks (cdr to-be-parsed) (cons a parsed)))
     ;; range of marks...
     ((and (eq ?- b) c (or (<= ?a a c ?z) (<= ?A a c ?Z) (<= ?0 a c ?9)))
      (evil--parse-delmarks (nthcdr 3 to-be-parsed)
                            (append parsed (number-sequence a c))))
     (t (progn (evil-echo "Invalid input: %s" (apply #'string (remove nil to-be-parsed)))
               parsed)))))