Function: evil-normalize-position

evil-normalize-position is a byte-compiled function defined in evil-common.el.

Signature

(evil-normalize-position POS)

Documentation

Return POS if it does not exceed the buffer boundaries.

If POS is less than point-min, return point-min. Is POS is more than point-max, return point-max. If POS is a marker, return its position.

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-common.el
;;; Movement

(defun evil-normalize-position (pos)
  "Return POS if it does not exceed the buffer boundaries.
If POS is less than `point-min', return `point-min'.
Is POS is more than `point-max', return `point-max'.
If POS is a marker, return its position."
  (cond
   ((not (number-or-marker-p pos))
    pos)
   ((< pos (point-min))
    (point-min))
   ((> pos (point-max))
    (point-max))
   ((markerp pos)
    (marker-position pos))
   (t
    pos)))