Function: markdown--append-list-item-bounds
markdown--append-list-item-bounds is a byte-compiled function defined
in markdown-mode.el.
Signature
(markdown--append-list-item-bounds MARKER INDENT CUR-BOUNDS BOUNDS)
Documentation
Update list item BOUNDS given list MARKER, block INDENT, and CUR-BOUNDS.
Here, MARKER is a string representing the type of list and INDENT
is an integer giving the indentation, in spaces, of the current
block. CUR-BOUNDS is a list of the form returned by
markdown-cur-list-item-bounds and BOUNDS is a list of bounds
values for parent list items. When BOUNDS 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--append-list-item-bounds (marker indent cur-bounds bounds)
"Update list item BOUNDS given list MARKER, block INDENT, and CUR-BOUNDS.
Here, MARKER is a string representing the type of list and INDENT
is an integer giving the indentation, in spaces, of the current
block. CUR-BOUNDS is a list of the form returned by
`markdown-cur-list-item-bounds' and BOUNDS is a list of bounds
values for parent list items. When BOUNDS is nil, it means we are
at baseline (not inside of a nested list)."
(let ((prev-indent (or (cl-third (car bounds)) 0)))
(cond
;; New list item at baseline.
((and marker (null bounds))
(list cur-bounds))
;; List item with greater indentation (four or more spaces).
;; Increase list level by consing CUR-BOUNDS onto BOUNDS.
((and marker (>= indent (+ prev-indent markdown-list-indent-width)))
(cons cur-bounds bounds))
;; List item with greater or equal indentation (less than four spaces).
;; Keep list level the same by replacing the car of BOUNDS.
((and marker (>= indent prev-indent))
(cons cur-bounds (cdr bounds)))
;; Lesser indentation level.
;; Pop appropriate number of elements off BOUNDS 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 prev-indent)
(while (and (> (length bounds) 1)
(setq prev-indent (cl-third (cadr bounds)))
(< indent (+ prev-indent markdown-list-indent-width)))
(setq bounds (cdr bounds)))
(cons cur-bounds bounds))
;; Otherwise, do nothing.
(t bounds))))