Function: hui:menu-item
hui:menu-item is a byte-compiled function defined in hui-mini.el.
Signature
(hui:menu-item KEY DOC-FLAG HELP-STRING-FLAG &optional MENU MENU-ALIST)
Documentation
Return either action or documentation for a Hyperbole minibuffer menu item KEY.
If DOC-FLAG is non-nil, returns the fully formatted documentation unless HELP-STRING-FLAG is non-nil, in which case only the first line of documentation is returned. If both are nil, the action form for the item is returned.
Two additional optional arguments determine the items from which key selects, MENU and MENU-ALIST are Hyperbole minibuffer menu internal constructs. If not given, the top level Hyperbole menu is used.
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hui-mini.el
(defun hui:menu-item (key doc-flag help-string-flag &optional menu menu-alist)
"Return either action or documentation for a Hyperbole minibuffer menu item KEY.
If DOC-FLAG is non-nil, returns the fully formatted documentation unless
HELP-STRING-FLAG is non-nil, in which case only the first line of
documentation is returned. If both are nil, the action form for the
item is returned.
Two additional optional arguments determine the items from which key
selects, MENU and MENU-ALIST are Hyperbole minibuffer menu internal
constructs. If not given, the top level Hyperbole menu is used."
(unless menu-alist
(setq menu-alist (or (cdr (assq (or (and (symbolp menu) menu) 'hyperbole)
hui:menus))
(hypb:error "(hui:menu-item): Invalid menu symbol arg: `%s'"
menu))))
(let ((item-keys (hui:menu-item-keys menu-alist))
sublist)
(when (setq sublist (memq key item-keys))
(setq hui:menu-keys (hui:menu-this-command-keys (downcase (char-to-string key))))
(let* ((label-act-help-list
(nth (- (1+ (length item-keys)) (length sublist))
menu-alist))
(label (car label-act-help-list))
(act-form (cadr label-act-help-list)))
(if (or (eq hargs:reading-type 'hmenu-help)
(and doc-flag
;; Not another menu to display
(not (and (listp act-form) (atom (car act-form)) (atom (cdr act-form))))))
(let* ((help-str (caddr label-act-help-list))
(cmd (if help-str nil (cadr label-act-help-list)))
(doc-str (if help-str nil (and (functionp cmd) (documentation cmd)))))
(and doc-str (string-match "\n" doc-str)
(setq doc-str (substring doc-str 0 (match-beginning 0))))
(setq help-str (or help-str doc-str "No help documentation for this item."))
(if help-string-flag
help-str
(concat (car label-act-help-list) "\n "
help-str "\n Action: "
(prin1-to-string act-form))))
(if (eq act-form #'hui:menu-to-personal-section)
(list #'hui:menu-to-personal-section label)
act-form))))))