Function: hywiki-highlight-word-get-range

hywiki-highlight-word-get-range is a byte-compiled function defined in hywiki.el.

Signature

(hywiki-highlight-word-get-range)

Documentation

Return list of (HyWikiWord#section:Lnum:Cnum start end) around point.

Also highlight HyWikiWord as necessary.

A call to hywiki-active-in-current-buffer-p at point must return non-nil or this will return '(nil nil nil).

If the HyWikiWord reference is delimited, point must be within the delimiters. The delimiters are excluded from start and end. If not at a HyWikiWord, return '(nil nil nil).

This works regardless of whether the HyWikiWord has been highlighted or not. Call hywiki-highlighted-word-at to test for a highlighted HyWikiWord at point.

This does not test whether a referent exists for the HyWikiWord; call hywiki-referent-exists-p without an argument for that.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hywiki.el
(defun hywiki-highlight-word-get-range ()
  "Return list of (HyWikiWord#section:Lnum:Cnum start end) around point.
Also highlight HyWikiWord as necessary.

A call to `hywiki-active-in-current-buffer-p' at point must return
non-nil or this will return \\='(nil nil nil).

If the HyWikiWord reference is delimited, point must be within the
delimiters.  The delimiters are excluded from start and end.  If not
at a HyWikiWord, return \\='(nil nil nil).

This works regardless of whether the HyWikiWord has been highlighted
or not.  Call `hywiki-highlighted-word-at' to test for a highlighted
HyWikiWord at point.

This does not test whether a referent exists for the HyWikiWord; call
`hywiki-referent-exists-p' without an argument for that."
  (cl-destructuring-bind (wikiword start end)
      (hywiki-word-get-range)
    ;; Ensure wikiword in buffer is highlighted before
    ;; returning its non-highlighted string version.
    (when (and wikiword start end
	       (not (hproperty:but-get start 'face hywiki-word-face))
	       (hywiki-referent-exists-p wikiword))
      (hywiki-maybe-highlight-region-reference start end))
    (list wikiword start end)))