Function: hui:menu-maybe-highlight-item-keys

hui:menu-maybe-highlight-item-keys is a byte-compiled function defined in hui-mini.el.

Signature

(hui:menu-maybe-highlight-item-keys MENU-STR)

Documentation

Maybe highlight the first capital letter of each MENU-STR item.

Highlight if customization variable hui:menu-highlight-flag is non-nil and the display supports underlined faces. Return the potentially modified MENU-STR.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hui-mini.el
(defun hui:menu-maybe-highlight-item-keys (menu-str)
  "Maybe highlight the first capital letter of each MENU-STR item.
Highlight if customization variable `hui:menu-highlight-flag' is
non-nil and the display supports underlined faces.  Return the
potentially modified MENU-STR."
  (if (and hui:menu-highlight-flag
           (display-supports-face-attributes-p
            '(:underline t) (window-frame)))
      (let ((after-menu-name-flag)
	    (after-word-capital-letter-flag)
	    (pos 0))
	(mapc (lambda (c)
		(cond ((= c ?>)
		       (setq after-menu-name-flag t))
		      ((= c ?\ )
		       (setq after-word-capital-letter-flag nil))
		      ((and after-menu-name-flag
			    (not after-word-capital-letter-flag)
			    (<= ?A c) (>= ?Z c))
		       (put-text-property pos (1+ pos)
					  'face 'read-multiple-choice-face
					  menu-str)
		       (setq after-word-capital-letter-flag t)))
		(setq pos (1+ pos)))
	      menu-str)
	menu-str)
    menu-str))