Skip to content

Commit

Permalink
menu bar: radio styling + help text
Browse files Browse the repository at this point in the history
  • Loading branch information
jinnovation committed Apr 12, 2024
1 parent 71336c9 commit 3d77417
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions kele.el
Original file line number Diff line number Diff line change
Expand Up @@ -1738,15 +1738,20 @@ Similar to `kele-dispatch'."

(defun kele--update-contexts-menu ()
"Fill in the context-switch sub-menu with candidate contexts."
(easy-menu-add-item
kele-menu-map
'("Configuration")
(append '("Switch context to...")
(mapcar (lambda (ctx)
(vector ctx (lambda ()
(interactive)
(kele-context-switch ctx))))
(kele-context-names)))))
(let ((ctx-current (kele-current-context-name :wait nil)))
(easy-menu-add-item
kele-menu-map
'("Configuration")
(append '("Switch context to...")
(mapcar (lambda (ctx)
(vector ctx
(lambda ()
(interactive)
(kele-context-switch ctx))
:help (format "Switch to context `%s'" ctx)
:style 'radio
:selected (string-equal ctx ctx-current)))
(kele-context-names))))))

(provide 'kele)

Expand Down

0 comments on commit 3d77417

Please sign in to comment.