Function: hywiki-word-is-p

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

Signature

(hywiki-word-is-p WORD &optional REGEXP-FLAG)

Documentation

Return non-nil if WORD is a HyWikiWord and optional #section:Lnum:Cnum.

With optional REGEXP-FLAG non-nil, #section may be a regular expression. When non-nil, the return value is the position where either the # character starts or the word ends. Use it to extract the wikiword by itself with
(substring WORD 0 <return-value>).

WORD may not yet have a referent (non-existent). Use hywiki-get-referent to determine whether a HyWikiWord referent exists.

Return nil if WORD is a prefixed, typed hy:HyWikiWord, since these are handled by the Org mode link handler.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260822.1645/hywiki.el
(defun hywiki-word-is-p (word &optional regexp-flag)
  "Return non-nil if WORD is a HyWikiWord and optional #section:Lnum:Cnum.
With optional REGEXP-FLAG non-nil, #section may be a regular expression.
When non-nil, the return value is the position where either the # character
starts or the word ends.  Use it to extract the wikiword by itself with
\(substring WORD 0 <return-value>).

WORD may not yet have a referent (non-existent).  Use `hywiki-get-referent'
to determine whether a HyWikiWord referent exists.

Return nil if WORD is a prefixed, typed hy:HyWikiWord, since
these are handled by the Org mode link handler."
  (and (stringp word) (not (string-empty-p word))
       (let (case-fold-search)
	 (and (or (string-match-p hywiki-word-with-optional-suffix-exact-regexp word)
		  ;; For now this next version allows spaces and tabs in
		  ;; the suffix part
		  (eq 0 (string-match-p hywiki-word-with-optional-suffix-exact-regexp
                                        word)))
	      ;; If has a #section and `regexp-flag' is nil,
              ;; ensure there are no invalid chars
	      (if regexp-flag
                  (or (string-match-p "#" word) (length word))
                (if (string-match-p "#" word)
		    (string-match "#[^][#()<>{}\"\n\r\f]+\\'" word)
		  (length word)))))))