summaryrefslogtreecommitdiff
path: root/lisp/progmodes/scheme.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-02-26 16:23:45 +0100
committerStefan Kangas <stefan@marxist.se>2021-02-26 16:51:19 +0100
commitffdb0a2d8e64980d63b7c1c6c71ac6e2d26b4fb2 (patch)
treed481fdfd4f55ff585c0411f8b6db10b118b1c104 /lisp/progmodes/scheme.el
parent47f2a39f427f2e7bfd3de371316e3a2c47841340 (diff)
downloademacs-ffdb0a2d8e64980d63b7c1c6c71ac6e2d26b4fb2.tar.gz
Convert some more progmode menus to easy-menu-define
* lisp/progmodes/dcl-mode.el (dcl-mode-map): * lisp/progmodes/icon.el (icon-mode-map): * lisp/progmodes/scheme.el (scheme-mode-map): Move menu definitions from here... * lisp/progmodes/dcl-mode.el (dcl-mode-menu): * lisp/progmodes/icon.el (icon-mode-menu) * lisp/progmodes/scheme.el (scheme-mode-menu): ...to here, and use easy-menu-define. * lisp/progmodes/icon.el (icon-mode-map, icon-mode-syntax-table): Simplify.
Diffstat (limited to 'lisp/progmodes/scheme.el')
-rw-r--r--lisp/progmodes/scheme.el33
1 files changed, 17 insertions, 16 deletions
diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el
index a899de7e594..72ac2d95a21 100644
--- a/lisp/progmodes/scheme.el
+++ b/lisp/progmodes/scheme.el
@@ -162,25 +162,26 @@
(defvar scheme-mode-line-process "")
(defvar scheme-mode-map
- (let ((smap (make-sparse-keymap))
- (map (make-sparse-keymap "Scheme")))
- (set-keymap-parent smap lisp-mode-shared-map)
- (define-key smap [menu-bar scheme] (cons "Scheme" map))
- (define-key map [run-scheme] '("Run Inferior Scheme" . run-scheme))
- (define-key map [uncomment-region]
- '("Uncomment Out Region" . (lambda (beg end)
- (interactive "r")
- (comment-region beg end '(4)))))
- (define-key map [comment-region] '("Comment Out Region" . comment-region))
- (define-key map [indent-region] '("Indent Region" . indent-region))
- (define-key map [indent-line] '("Indent Line" . lisp-indent-line))
- (put 'comment-region 'menu-enable 'mark-active)
- (put 'uncomment-region 'menu-enable 'mark-active)
- (put 'indent-region 'menu-enable 'mark-active)
- smap)
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map lisp-mode-shared-map)
+ map)
"Keymap for Scheme mode.
All commands in `lisp-mode-shared-map' are inherited by this map.")
+(easy-menu-define scheme-mode-menu scheme-mode-map
+ "Menu for Scheme mode."
+ '("Scheme"
+ ["Indent Line" lisp-indent-line]
+ ["Indent Region" indent-region
+ :enable mark-active]
+ ["Comment Out Region" comment-region
+ :enable mark-active]
+ ["Uncomment Out Region" (lambda (beg end)
+ (interactive "r")
+ (comment-region beg end '(4)))
+ :enable mark-active]
+ ["Run Inferior Scheme" run-scheme]))
+
;; Used by cmuscheme
(defun scheme-mode-commands (map)
;;(define-key map "\t" 'indent-for-tab-command) ; default