Function: hywiki-at-range-delimiter
hywiki-at-range-delimiter is a byte-compiled function defined in
hywiki.el.
Signature
(hywiki-at-range-delimiter)
Documentation
Immediately before or after a balanced delimiter, return the delimited range.
Include: (), {}, <>, [] and "" (double quotes). Exclude Org links and radio targets.
Range is a list of (start end) positions or if no such range, then '(nil nil). It is limited to the previous, current and next lines, as HyWikiWord references are limited to two lines maximum. The range is inclusive of the delimiters: (), {}, <>, [] and "" (double quotes).
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hywiki.el
(defun hywiki-at-range-delimiter ()
"Immediately before or after a balanced delimiter, return the delimited range.
Include: (), {}, <>, [] and \"\" (double quotes). Exclude Org links
and radio targets.
Range is a list of (start end) positions or if no such range, then \\='(nil
nil). It is limited to the previous, current and next lines, as HyWikiWord
references are limited to two lines maximum. The range is inclusive of the
delimiters: (), {}, <>, [] and \"\" (double quotes)."
(save-excursion
(save-restriction
;; Limit balanced pair checks to previous through next lines for
;; speed when no region is active. Point must be either on the
;; opening or the closing line to recognize any delimiters.
(unless (use-region-p)
(narrow-to-region (line-beginning-position 0) (line-end-position 2)))
(let* ((result (hywiki-get-delimited-region))
(start (nth 0 result))
(end (nth 1 result))
(delimited-flag (and (integerp start) (integerp end))))
;; If there is an active region, then point can be before the
;; start of the delimited region, within it or many characters
;; after it ends, handle those three cases.
(setq result
(cond (delimited-flag
(if (use-region-p)
(hywiki--extend-region (min start (region-beginning))
(max end (region-end)))
(hywiki--extend-region start end)))
((use-region-p)
(hywiki--extend-region (region-beginning) (region-end)))
(t result)))
(if delimited-flag
result
(list nil nil))))))