diff options
Diffstat (limited to 'elisp')
-rw-r--r-- | elisp/geiser-menu.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/elisp/geiser-menu.el b/elisp/geiser-menu.el index 25c4630..b279de2 100644 --- a/elisp/geiser-menu.el +++ b/elisp/geiser-menu.el @@ -98,6 +98,11 @@ ((,title nil (lambda () (interactive) (customize-group ',group)))) ,visible)) +(defmacro geiser-menu--mode-toggle (title bindings mode keymap visible) + `(geiser-menu--add-items ,keymap + ((,title ,bindings ,mode :button (:toggle . (and (boundp ',mode) ,mode)))) + ,visible)) + (defmacro geiser-menu--defmenu (keymap visible &rest keys) (let ((fs)) (dolist (kd keys) @@ -114,6 +119,12 @@ ,(nth 2 kd) ,keymap ,visible)) + ((eq 'mode (car kd)) + `(geiser-menu--mode-toggle ,(nth 1 kd) + ,(nth 2 kd) + ,(nth 3 kd) + ,keymap + ,visible)) (t (error "Bad form: %s" kd))) fs))) `(progn ,@fs))) |