summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-01-02 21:51:47 +0000
committerRichard M. Stallman <rms@gnu.org>1994-01-02 21:51:47 +0000
commit885020c53542b16df9d7f340f88699052d04e41d (patch)
treee1f124feb83d78f7f8821079a53cefb40199f179 /lisp
parentc3a3ebc910aca2f1fb0c6bb5ccf2b6747a1baa1b (diff)
downloademacs-885020c53542b16df9d7f340f88699052d04e41d.tar.gz
(c-mode-map): Add menu bar menu.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/c-mode.el58
1 files changed, 39 insertions, 19 deletions
diff --git a/lisp/progmodes/c-mode.el b/lisp/progmodes/c-mode.el
index ebab0c77130..3728b128401 100644
--- a/lisp/progmodes/c-mode.el
+++ b/lisp/progmodes/c-mode.el
@@ -33,26 +33,46 @@
"Abbrev table in use in C mode.")
(define-abbrev-table 'c-mode-abbrev-table ())
-(defvar c-mode-map ()
+(defvar c-mode-map (make-sparse-keymap)
"Keymap used in C mode.")
-(if c-mode-map
- ()
- (setq c-mode-map (make-sparse-keymap))
- (define-key c-mode-map "{" 'electric-c-brace)
- (define-key c-mode-map "}" 'electric-c-brace)
- (define-key c-mode-map ";" 'electric-c-semi)
- (define-key c-mode-map "#" 'electric-c-sharp-sign)
- (define-key c-mode-map ":" 'electric-c-terminator)
- (define-key c-mode-map "\e\C-h" 'mark-c-function)
- (define-key c-mode-map "\e\C-q" 'indent-c-exp)
- (define-key c-mode-map "\ea" 'c-beginning-of-statement)
- (define-key c-mode-map "\ee" 'c-end-of-statement)
- (define-key c-mode-map "\eq" 'c-fill-paragraph)
- (define-key c-mode-map "\C-c\C-n" 'c-forward-conditional)
- (define-key c-mode-map "\C-c\C-p" 'c-backward-conditional)
- (define-key c-mode-map "\C-c\C-u" 'c-up-conditional)
- (define-key c-mode-map "\177" 'backward-delete-char-untabify)
- (define-key c-mode-map "\t" 'c-indent-command))
+
+(define-key c-mode-map "{" 'electric-c-brace)
+(define-key c-mode-map "}" 'electric-c-brace)
+(define-key c-mode-map ";" 'electric-c-semi)
+(define-key c-mode-map "#" 'electric-c-sharp-sign)
+(define-key c-mode-map ":" 'electric-c-terminator)
+(define-key c-mode-map "\e\C-h" 'mark-c-function)
+(define-key c-mode-map "\e\C-q" 'indent-c-exp)
+(define-key c-mode-map "\ea" 'c-beginning-of-statement)
+(define-key c-mode-map "\ee" 'c-end-of-statement)
+(define-key c-mode-map "\eq" 'c-fill-paragraph)
+(define-key c-mode-map "\C-c\C-n" 'c-forward-conditional)
+(define-key c-mode-map "\C-c\C-p" 'c-backward-conditional)
+(define-key c-mode-map "\C-c\C-u" 'c-up-conditional)
+(define-key c-mode-map "\177" 'backward-delete-char-untabify)
+(define-key c-mode-map "\t" 'c-indent-command))
+
+(define-key c-mode-map [menu-bar] (make-sparse-keymap))
+
+(define-key c-mode-map [menu-bar c]
+ (cons "C" (make-sparse-keymap "C")))
+
+(define-key c-mode-map [menu-bar c indent-exp]
+ '("Indent Expression" . indent-c-exp))
+(define-key c-mode-map [menu-bar c indent-line]
+ '("Indent Line" . c-indent-command))
+(define-key c-mode-map [menu-bar c fill]
+ '("Fill Comment Paragraph" . c-fill-paragraph))
+(define-key c-mode-map [menu-bar c up]
+ '("Up Conditional" . c-up-conditional))
+(define-key c-mode-map [menu-bar c backward]
+ '("Backward Conditional" . c-backward-conditional))
+(define-key c-mode-map [menu-bar c forward]
+ '("Forward Conditional" . c-forward-conditional))
+(define-key c-mode-map [menu-bar c backward-stmt]
+ '("Backward Statement" . c-beginning-of-statement))
+(define-key c-mode-map [menu-bar c forward-stmt]
+ '("Forward Statement" . c-end-of-statement))
;; cmacexp is lame because it uses no preprocessor symbols.
;; It isn't very extensible either -- hardcodes /lib/cpp.