Function: hywiki-word-read-new

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

Signature

(hywiki-word-read-new &optional PROMPT INITIAL)

Documentation

Prompt with completion for and return an existing or new HyWikiWord.

If point is on one, press RET immediately to use that one. Ensure that any name conforms to hywiki-word-regexp.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260822.1645/hywiki.el
(defun hywiki-word-read-new (&optional prompt initial)
  "Prompt with completion for and return an existing or new HyWikiWord.
If point is on one, press RET immediately to use that one.  Ensure
that any name conforms to `hywiki-word-regexp'."
  (let ((completion-ignore-case t)
        (valid-p (lambda (input)
                   (let ((case-fold-search nil))
                     (string-match-p (concat "\\`" hywiki-word-regexp "\\'") input))))
        (collection (hywiki-get-referent-hasht)))
    (completing-read
     (if (stringp prompt) prompt "HyWiki Word: ")
     (lambda (input pred action)
       (if (eq action 'lambda)
           ;; Check that input matches `hyrolo-word-regexp'.
           ;; If so, RET will exit the minibuffer.
           (funcall valid-p input)
         ;; Otherwise, complete over `collection'
         (complete-with-action action collection input pred)))
     nil t initial nil (hywiki-word-at-point))))