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 | 566f69cff23869a95aaa7051d5febffa5f9fcd02 (patch) | |
tree | 15b25180e12daab2b9b53ebbd668c55e0e134839 | |
parent | 625d35526712240e43b08de08e7ce63a239bad0e (diff) | |
download | geiser-566f69cff23869a95aaa7051d5febffa5f9fcd02.tar.gz geiser-566f69cff23869a95aaa7051d5febffa5f9fcd02.tar.bz2 |
Support for minor mode toggling in menus.
-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))) |