From 3d7741728a3d9b95120eed7313266ef69ebb52fb Mon Sep 17 00:00:00 2001 From: Jonathan Jin Date: Fri, 12 Apr 2024 09:15:40 -0400 Subject: [PATCH] menu bar: radio styling + help text --- kele.el | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/kele.el b/kele.el index 5682886..97b7d0b 100644 --- a/kele.el +++ b/kele.el @@ -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)