Function: hui:menu-read-from-minibuffer

hui:menu-read-from-minibuffer is a byte-compiled function defined in hui-mini.el.

Signature

(hui:menu-read-from-minibuffer PROMPT &optional INITIAL-CONTENTS KEYMAP READ HIST DEFAULT-VALUE INHERIT-INPUT-METHOD)

Documentation

Hyperbole minibuffer menu replacement for read-from-minibuffer.

Allows custom handling of menu lines before selecting an item.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hui-mini.el
(defun hui:menu-read-from-minibuffer (prompt &optional initial-contents keymap read
					     hist default-value inherit-input-method)
  "Hyperbole minibuffer menu replacement for `read-from-minibuffer'.
Allows custom handling of menu lines before selecting an item."
  (when (and (stringp initial-contents)
	     (string-prefix-p "HyWiki Mode" initial-contents))
    (let* ((hywiki-mode-options (cddr (assq 'cust-hywiki-mode hui:menus)))
	   (hywiki-mode-option-lookups (mapcar (lambda (option)
					 (cons (car (last (nth 1 option)))
					       (car option)))
				       hywiki-mode-options))
	   (hywiki-mode-current-name (cdr (assq hywiki-mode hywiki-mode-option-lookups))))
      (when (and (stringp hywiki-mode-current-name) (stringp initial-contents))
	(setq initial-contents (replace-regexp-in-string (regexp-quote hywiki-mode-current-name)
                                                         (concat "==" hywiki-mode-current-name "==")
                                                         initial-contents)))))

  (when (and (stringp initial-contents)
	     (string-prefix-p "Org M-RET" initial-contents))
    (let* ((org-m-ret-options (cddr (assq 'cust-org hui:menus)))
	   (org-option-lookups (mapcar (lambda (option)
					 (cons (car (last (nth 1 option)))
					       (car option)))
				       org-m-ret-options))
	   (org-current-name (cdr (assq hsys-org-enable-smart-keys org-option-lookups))))
      (when (and (stringp org-current-name) (stringp initial-contents))
	(setq initial-contents (replace-regexp-in-string (regexp-quote org-current-name)
                                                         (concat "==" org-current-name "==")
                                                         initial-contents)))))
  (setq initial-contents (hui:menu-maybe-highlight-item-keys initial-contents))
  (read-from-minibuffer prompt initial-contents keymap read
			hist default-value inherit-input-method))