Function: hywiki-create-referent-and-display
hywiki-create-referent-and-display is an interactive and byte-compiled
function defined in hywiki.el.
Signature
(hywiki-create-referent-and-display WIKIWORD &optional PROMPT-FLAG)
Documentation
Display the HyWiki referent for WIKIWORD and return the referent value.
The value is the referent linked to without its type.
If there is no existing WIKIWORD referent and PROMPT-FLAG is non-nil,
prompt for and choose a referent type; see hywiki-referent-menu for
valid referent types. Otherwise, if there is no existing HyWiki page
for WIKIWORD, add a page for it.
Use hywiki-get-referent to determine whether a HyWikiWord referent
or page exists.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260822.1645/hywiki.el
(defun hywiki-create-referent-and-display (wikiword &optional prompt-flag)
"Display the HyWiki referent for WIKIWORD and return the referent value.
The value is the referent linked to without its type.
If there is no existing WIKIWORD referent and PROMPT-FLAG is non-nil,
prompt for and choose a referent type; see `hywiki-referent-menu' for
valid referent types. Otherwise, if there is no existing HyWiki page
for WIKIWORD, add a page for it.
Use `hywiki-get-referent' to determine whether a HyWikiWord referent
or page exists."
(interactive (list nil current-prefix-arg))
(let ((at-wikiword-reference (hywiki-word-at)))
(unless (stringp wikiword)
(setq wikiword (or at-wikiword-reference
(hywiki-word-read-new
(format "Add/Edit and display HyWiki %s: "
(if current-prefix-arg "referent" "page"))))))
(unless (equal (hywiki-get-singular-wikiword wikiword)
(hywiki-get-singular-wikiword at-wikiword-reference))
(if buffer-read-only
(error "(hywiki-create-referent-and-display): Read-only buffer: %s; call this with point on: \"%s\""
(current-buffer) wikiword)
(skip-syntax-forward "^-")
(unless (or (bolp) (= (char-syntax (preceding-char)) ?\ ))
(insert " "))
(insert wikiword)))
(when (and (not prompt-flag) hywiki-referent-prompt-flag
(called-interactively-p 'interactive))
(setq prompt-flag t))
(let* ((normalized-word (hywiki-get-singular-wikiword wikiword))
(referent (hywiki-find-referent wikiword prompt-flag)))
(cond (referent)
((hywiki-word-is-p normalized-word)
(when (hywiki-add-page normalized-word)
(hywiki-display-page normalized-word)))
(t (user-error "(hywiki-create-referent-and-display): Invalid HyWikiWord: '%s'; must be capitalized, all alpha" wikiword))))))