Function: markdown-update-list-levels
markdown-update-list-levels is a byte-compiled function defined in
markdown-mode.el.
Signature
(markdown-update-list-levels MARKER INDENT LEVELS)
Documentation
Update list levels given list MARKER, block INDENT, and current LEVELS.
Here, MARKER is a string representing the type of list, INDENT is an integer giving the indentation, in spaces, of the current block, and LEVELS is a list of the indentation levels of parent list items. When LEVELS is nil, it means we are at baseline (not inside of a nested list).
Source Code
;; Defined in ~/.emacs.d/elpa/markdown-mode-20260321.143/markdown-mode.el
(defun markdown-update-list-levels (marker indent levels)
"Update list levels given list MARKER, block INDENT, and current LEVELS.
Here, MARKER is a string representing the type of list, INDENT is an integer
giving the indentation, in spaces, of the current block, and LEVELS is a
list of the indentation levels of parent list items. When LEVELS is nil,
it means we are at baseline (not inside of a nested list)."
(cond
;; New list item at baseline.
((and marker (null levels))
(setq levels (list indent)))
;; List item with greater indentation (four or more spaces).
;; Increase list level.
((and marker (>= indent (+ (car levels) markdown-list-indent-width)))
(setq levels (cons indent levels)))
;; List item with greater or equal indentation (less than four spaces).
;; Do not increase list level.
((and marker (>= indent (car levels)))
levels)
;; Lesser indentation level.
;; Pop appropriate number of elements off LEVELS list (e.g., lesser
;; indentation could move back more than one list level). Note
;; that this block need not be the beginning of list item.
((< indent (car levels))
(while (and (> (length levels) 1)
(< indent (+ (cadr levels) markdown-list-indent-width)))
(setq levels (cdr levels)))
levels)
;; Otherwise, do nothing.
(t levels)))