diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-06-14 01:00:51 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-06-14 01:00:51 +0200 |
commit | caae0709112c75d7cac72b5e2249b01cbea3d46c (patch) | |
tree | 6f49eb70e3c2f79a60183092efd59c69ea9cdcf9 /elisp | |
parent | e55009c09f5bcfd24fb00a31a2f9570f5c191689 (diff) | |
download | geiser-chez-caae0709112c75d7cac72b5e2249b01cbea3d46c.tar.gz geiser-chez-caae0709112c75d7cac72b5e2249b01cbea3d46c.tar.bz2 |
Support for minor mode toggling in menus.
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))) |