Function: doom-modeline--insert-segment-in-list

doom-modeline--insert-segment-in-list is a natively compiled function defined in doom-modeline-core.el.

Signature

(doom-modeline--insert-segment-in-list LIST ANCHOR SEGMENT POSITION)

Documentation

Insert SEGMENT in LIST relative to ANCHOR at POSITION.

POSITION can be :before or :after. Returns the modified list.

Source Code

;; Defined in /nix/store/1lcicrdd2r4b8rkc91nnn74ymk1jl6yd-emacs-packages-deps/share/emacs/site-lisp/elpa/doom-modeline-20260928.1632/doom-modeline-core.el
(defun doom-modeline--insert-segment-in-list (list anchor segment position)
  "Insert SEGMENT in LIST relative to ANCHOR at POSITION.
POSITION can be :before or :after.
Returns the modified list."
  (cond ((null list) (list segment))
        ((eq (car list) anchor)
         (if (eq position :before)
             (cons segment list)
           (cons anchor (cons segment (cdr list)))))
        (t
         (cons (car list)
               (doom-modeline--insert-segment-in-list (cdr list) anchor segment position)))))