Function: denote--inside-link-regexp-p
denote--inside-link-regexp-p is a byte-compiled function defined in
denote.el.
Signature
(denote--inside-link-regexp-p REGEXP POSITION)
Documentation
Check if POSITION is inside a Denote link REGEXP.
Return either nil or a list whose elements are two cons cells:
- The first cons cell has the link target and the link description,
like ("denote:20250816T080008" . "This is a test").
- The second cons cell consists of two buffer positions, pointing to the
beginning and end of REGEXP.
Source Code
;; Defined in ~/.emacs.d/elpa/denote-4.2.3/denote.el
;; Adapted from `org-in-regexp'.
(defun denote--inside-link-regexp-p (regexp position)
"Check if POSITION is inside a Denote link REGEXP.
Return either nil or a list whose elements are two cons cells:
- The first cons cell has the link target and the link description,
like (\"denote:20250816T080008\" . \"This is a test\").
- The second cons cell consists of two buffer positions, pointing to the
beginning and end of REGEXP."
(catch 'exit
(let ((line-end (line-end-position)))
(save-excursion
(forward-line 0)
(while (and (re-search-forward regexp line-end t)
(<= (match-beginning 0) position))
(when (>= (match-end 0) position)
(throw 'exit (list (cons
(match-string-no-properties 1)
(match-string-no-properties 2))
(cons
(match-beginning 0)
(match-end 0))))))))))