Function: markdown-inline-code-at-pos
markdown-inline-code-at-pos is a byte-compiled function defined in
markdown-mode.el.
Signature
(markdown-inline-code-at-pos POS &optional FROM)
Documentation
Return non-nil if there is an inline code fragment at POS starting at FROM.
Uses the beginning of the block if FROM is nil.
Return nil otherwise. Set match data according to
markdown-match-code upon success.
This function searches the block for a code fragment that
contains the point using markdown-match-code. We do this
because thing-at-point-looking-at does not work reliably with
markdown-regex-code.
The match data is set as follows: Group 1 matches the opening backquotes. Group 2 matches the code fragment itself, without backquotes. Group 3 matches the closing backquotes.
Source Code
;; Defined in ~/.emacs.d/elpa/markdown-mode-20260321.143/markdown-mode.el
(defun markdown-inline-code-at-pos (pos &optional from)
"Return non-nil if there is an inline code fragment at POS starting at FROM.
Uses the beginning of the block if FROM is nil.
Return nil otherwise. Set match data according to
`markdown-match-code' upon success.
This function searches the block for a code fragment that
contains the point using `markdown-match-code'. We do this
because `thing-at-point-looking-at' does not work reliably with
`markdown-regex-code'.
The match data is set as follows:
Group 1 matches the opening backquotes.
Group 2 matches the code fragment itself, without backquotes.
Group 3 matches the closing backquotes."
(save-excursion
(goto-char pos)
(let ((old-point (point))
(end-of-block (progn (markdown-end-of-text-block) (point)))
found)
(if from
(goto-char from)
(markdown-beginning-of-text-block))
(while (and (markdown-match-code end-of-block)
(setq found t)
(< (match-end 0) old-point)))
(let ((match-group (if (eq (char-after (match-beginning 0)) ?`) 0 1)))
(and found ; matched something
(<= (match-beginning match-group) old-point) ; match contains old-point
(> (match-end 0) old-point))))))