Function: markdown-demote-list-item

markdown-demote-list-item is an interactive and byte-compiled function defined in markdown-mode.el.

Signature

(markdown-demote-list-item &optional BOUNDS)

Documentation

Indent (or demote) the current list item.

Optionally, BOUNDS of the current list item may be provided if available. In nested lists, demote child items as well.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/markdown-mode-20260321.143/markdown-mode.el
(defun markdown-demote-list-item (&optional bounds)
  "Indent (or demote) the current list item.
Optionally, BOUNDS of the current list item may be provided if available.
In nested lists, demote child items as well."
  (interactive)
  (when (or bounds (setq bounds (markdown-cur-list-item-bounds)))
    (save-excursion
      (let* ((item-start (set-marker (make-marker) (nth 0 bounds)))
             (item-end (set-marker (make-marker) (nth 1 bounds)))
             (list-start (progn (markdown-beginning-of-list)
                                (set-marker (make-marker) (point))))
             (list-end (progn (markdown-end-of-list)
                              (set-marker (make-marker) (point)))))
        (goto-char item-start)
        (while (< (point) item-end)
          (unless (markdown-cur-line-blank-p)
            (insert (make-string markdown-list-indent-width ? )))
          (forward-line))
        (markdown-syntax-propertize-list-items list-start list-end)))))