Function: evil-sort

evil-sort is a macro defined in evil-common.el.

Signature

(evil-sort &rest VARS)

Documentation

Sort the symbol values of VARS.

Place the smallest value in the first argument and the largest in the last, sorting in between.

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-common.el
(defmacro evil-sort (&rest vars)
  "Sort the symbol values of VARS.
Place the smallest value in the first argument and the largest in the
last, sorting in between."
  (if (= (length vars) 2)
      `(when (> ,@vars) (evil-swap ,@vars))
    (let ((sorted (make-symbol "sortvar")))
      `(let ((,sorted (sort (list ,@vars) #'<)))
         (setq ,@(apply #'nconc
                        (mapcar (lambda (var) (list var `(pop ,sorted)))
                                vars)))))))