Function: hsys-org-link-at-p
hsys-org-link-at-p is a byte-compiled function defined in hsys-org.el.
Signature
(hsys-org-link-at-p)
Documentation
Return (start . end) iff point is on a delimited Org mode link, else nil.
Start and end are the buffer positions of the label of the link. This is either the optional description or if none, then the referent, i.e. either [[referent][description]] or [[referent]], sans the outer brackets.
If the link referent is to a HyWikiWord, e.g. [[hy:WikiWord]], or point is on a HyWikiWord in the link description, then ignore this as an Org link (return nil); instead activate it as HyWikiWord reference.
Assume caller has already checked that the current buffer is in
org-mode or is looking for an Org link in a non-Org buffer type.
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hsys-org.el
(defun hsys-org-link-at-p ()
"Return (start . end) iff point is on a delimited Org mode link, else nil.
Start and end are the buffer positions of the label of the link. This
is either the optional description or if none, then the referent, i.e.
either [[referent][description]] or [[referent]], sans the outer brackets.
If the link referent is to a HyWikiWord, e.g. [[hy:WikiWord]], or point
is on a HyWikiWord in the link description, then ignore this as an Org
link (return nil); instead activate it as HyWikiWord reference.
Assume caller has already checked that the current buffer is in
`org-mode' or is looking for an Org link in a non-Org buffer type."
(unless (or (smart-eolp) (smart-eobp))
(let (label-start-end)
(if (derived-mode-p 'org-mode)
;; Must be in `org-mode' to use `org-element-property'
(when (org-element-property :raw-link (org-element-context))
;; At an Org link
(save-match-data
;; If this Org link matches a potential HyWikiWord, ignore it.
(when (and (not (and (fboundp 'hywiki-word-at) (hywiki-word-at)))
(setq label-start-end (hsys-org-link-label-start-end)))
(cons (nth 1 label-start-end) (nth 2 label-start-end)))))
;; Non-Org mode (can't call org-element (which
;; hsys-org-thing-at-p calls) outside of Org mode.
;; Check if point is inside a link.
(save-match-data
;; If any Org link matches a potential HyWikiWord, ignore it.
(when (and (not (and (fboundp 'hywiki-word-at) (hywiki-word-at)))
(setq label-start-end (hargs:delimited "[[" "]]" nil nil t)))
(let* ((start (nth 1 label-start-end))
(end (nth 2 label-start-end)))
(cons start end))))))))