Function: markdown-insert-code

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

Signature

(markdown-insert-code)

Documentation

Insert markup to make a region or word an inline code fragment.

If there is an active region, make the region an inline code fragment. If the point is at a word, make the word an inline code fragment. Otherwise, simply insert code delimiters and place the point in between them.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/markdown-mode-20260321.143/markdown-mode.el
(defun markdown-insert-code ()
  "Insert markup to make a region or word an inline code fragment.
If there is an active region, make the region an inline code
fragment.  If the point is at a word, make the word an inline
code fragment.  Otherwise, simply insert code delimiters and
place the point in between them."
  (interactive)
  (if (use-region-p)
      ;; Active region
      (let ((bounds (markdown-unwrap-things-in-region
                     (region-beginning) (region-end)
                     markdown-regex-code 1 3)))
        (markdown-wrap-or-insert "`" "`" nil (car bounds) (cdr bounds)))
    ;; Code markup removal, code markup for word, or empty markup insertion
    (if (markdown-inline-code-at-point)
        (markdown-unwrap-thing-at-point nil 0 2)
      (markdown-wrap-or-insert "`" "`" 'word nil nil))))