Function: hywiki-create-referent

hywiki-create-referent is an interactive and byte-compiled function defined in hywiki.el.

Signature

(hywiki-create-referent WIKIWORD &optional MESSAGE-FLAG)

Documentation

Prompt for, add to HyWiki lookups and return a WIKIWORD custom referent.

With optional prefix arg MESSAGE-FLAG non-nil or when called interactively, display a minibuffer message with the referent.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260822.1645/hywiki.el
(defun hywiki-create-referent (wikiword &optional message-flag)
  "Prompt for, add to HyWiki lookups and return a WIKIWORD custom referent.
With optional prefix arg MESSAGE-FLAG non-nil or when called interactively,
display a minibuffer message with the referent."
  (interactive (list nil current-prefix-arg))
  (unless (stringp wikiword)
    (setq wikiword (hywiki-word-read-new "Create/Edit HyWikiWord: ")))
  (setq hkey-value wikiword)
  ;; Prompt for referent type and then create the referent
  (hui:menu-act 'hywiki-referent-menu
		(list (cons 'hywiki-referent-menu
			    (cons (list (format "%s RefType>"
						(if (string-match hywiki-word-suffix-regexp wikiword)
						    (substring wikiword 0 (match-beginning 0))
						  wikiword)))
				  (cdr hywiki-referent-menu)))))
  ;; Ensure the referent returned has any wikiword suffix
  (let ((referent (hywiki-get-referent wikiword)))
    (if referent
	(when (or message-flag (called-interactively-p 'interactive))
	  (message "HyWikiWord '%s' referent: %S" wikiword referent))
      (user-error "(hywiki-create-referent): Referent creation failed: '%s'; ensure HyWikiWord is capitalized and all alpha" wikiword))
    referent))