Function: hywiki-highlighted-word-at

hywiki-highlighted-word-at is a byte-compiled function defined in hywiki.el.

Signature

(hywiki-highlighted-word-at &optional RANGE-FLAG)

Documentation

Return highlighted HyWikiWord and optional #section:Lnum:Cnum at point or nil.

If the HyWikiWord is delimited, point must be within the delimiters.

With optional RANGE-FLAG, return a list of (HyWikiWord start-position end-position); the positions include the entire HyWikiWord#section:Lnum:Cnum string but exclude any delimiters.

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

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

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hywiki.el
(defun hywiki-highlighted-word-at (&optional range-flag)
  "Return highlighted HyWikiWord and optional #section:Lnum:Cnum at point or nil.
If the HyWikiWord is delimited, point must be within the delimiters.

With optional RANGE-FLAG, return a list of (HyWikiWord start-position
end-position); the positions include the entire
HyWikiWord#section:Lnum:Cnum string but exclude any delimiters.

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

A call to `hywiki-active-in-current-buffer-p' at point must return non-nil
or this will return nil."
  (when (and (hywiki-active-in-current-buffer-p)
	     (setq hywiki--range (hywiki-word-at :range))
	     (car hywiki--range))
    (cl-destructuring-bind (wikiword start end)
	hywiki--range
      (if (and (hproperty:but-get start 'face hywiki-word-face)
	       (string-match hywiki-word-with-optional-suffix-exact-regexp wikiword))
	  (if range-flag
	      (list wikiword start end)
	    wikiword)
	(when range-flag
	  '(nil nil nil))))))