Function: markdown-demote

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

Signature

(markdown-demote)

Documentation

Demote or move element at point to the right.

Depending on the context, this function will demote a heading or list item at the point, move a table column to the right, or cycle or remove markup.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/markdown-mode-20260321.143/markdown-mode.el
(defun markdown-demote ()
  "Demote or move element at point to the right.
Depending on the context, this function will demote a heading or
list item at the point, move a table column to the right, or cycle
or remove markup."
  (interactive)
  (let (bounds)
    (cond
     ;; Demote atx heading subtree
     ((thing-at-point-looking-at markdown-regex-header-atx)
      (markdown-demote-subtree))
     ;; Demote setext heading
     ((thing-at-point-looking-at markdown-regex-header-setext)
      (markdown-cycle-setext 1))
     ;; Demote horizontal rule
     ((thing-at-point-looking-at markdown-regex-hr)
      (markdown-cycle-hr 1))
     ;; Demote list item
     ((setq bounds (markdown-cur-list-item-bounds))
      (markdown-demote-list-item bounds))
     ;; Move table column to the right
     ((markdown-table-at-point-p)
      (call-interactively #'markdown-table-move-column-right))
     ;; Demote bold
     ((thing-at-point-looking-at markdown-regex-bold)
      (markdown-cycle-bold))
     ;; Demote italic
     ((thing-at-point-looking-at markdown-regex-italic)
      (markdown-cycle-italic))
     (t
      (user-error "Nothing to demote at point")))))