comparison lisp/cc-mode/cc-menus.el @ 171:929b76928fce r20-3b12

Import from CVS: tag r20-3b12
author cvs
date Mon, 13 Aug 2007 09:47:52 +0200
parents 5a88923fcbfe
children 2d532a89d707
comparison
equal deleted inserted replaced
170:98a42ee61975 171:929b76928fce
1 ;;; cc-menus.el --- menu and imenu support for CC Mode 1 ;;; cc-menus.el --- imenu support for CC Mode
2 2
3 ;; Copyright (C) 1985,87,92,93,94,95,96,97 Free Software Foundation, Inc. 3 ;; Copyright (C) 1985,87,92,93,94,95,96,97 Free Software Foundation, Inc.
4 4
5 ;; Authors: 1992-1997 Barry A. Warsaw 5 ;; Authors: 1992-1997 Barry A. Warsaw
6 ;; 1987 Dave Detlefs and Stewart Clamen 6 ;; 1987 Dave Detlefs and Stewart Clamen
7 ;; 1985 Richard M. Stallman 7 ;; 1985 Richard M. Stallman
8 ;; Maintainer: cc-mode-help@python.org 8 ;; Maintainer: cc-mode-help@python.org
9 ;; Created: 22-Apr-1997 (split from cc-mode.el) 9 ;; Created: 22-Apr-1997 (split from cc-mode.el)
10 ;; Version: 5.11 10 ;; Version: 5.12
11 ;; Keywords: c languages oop 11 ;; Keywords: c languages oop
12 12
13 ;; This file is part of GNU Emacs. 13 ;; This file is part of GNU Emacs.
14 14
15 ;; GNU Emacs is free software; you can redistribute it and/or modify 15 ;; GNU Emacs is free software; you can redistribute it and/or modify
97 "[,a-zA-Z_1-9\n \t]*{" 97 "[,a-zA-Z_1-9\n \t]*{"
98 )) 6))) 98 )) 6)))
99 "Imenu generic expression for Java mode. See `imenu-generic-expression'.") 99 "Imenu generic expression for Java mode. See `imenu-generic-expression'.")
100 100
101 101
102 ;; menu support for both XEmacs and Emacs. If you don't have easymenu
103 ;; with your version of Emacs, you are incompatible!
104 (require 'easymenu)
105
106 (defvar c-c-menu nil)
107 (defvar c-c++-menu nil)
108 (defvar c-objc-menu nil)
109 (defvar c-java-menu nil)
110
111 (defun c-mode-menu (modestr)
112 (let ((m
113 '(["Comment Out Region" comment-region (mark)]
114 ["Macro Expand Region" c-macro-expand (mark)]
115 ["Backslashify" c-backslash-region (mark)]
116 ["Indent Expression" c-indent-exp
117 (memq (following-char) '(?\( ?\[ ?\{))]
118 ["Indent Line" c-indent-command t]
119 ["Fill Comment Paragraph" c-fill-paragraph t]
120 ["Up Conditional" c-up-conditional t]
121 ["Backward Conditional" c-backward-conditional t]
122 ["Forward Conditional" c-forward-conditional t]
123 ["Backward Statement" c-beginning-of-statement t]
124 ["Forward Statement" c-end-of-statement t]
125 )))
126 (cons modestr m)))
127
128 (eval-when-compile
129 (load-file "./cc-langs.el"))
130
131 (easy-menu-define c-c-menu c-mode-map "C Mode Commands"
132 (c-mode-menu "C"))
133 (easy-menu-define c-c++-menu c++-mode-map "C++ Mode Commands"
134 (c-mode-menu "C++"))
135 (easy-menu-define c-objc-menu objc-mode-map "ObjC Mode Commands"
136 (c-mode-menu "ObjC"))
137 (easy-menu-define c-java-menu java-mode-map "Java Mode Commands"
138 (c-mode-menu "Java"))
139
140
141 (provide 'cc-menus) 102 (provide 'cc-menus)
142 ;;; cc-menus.el ends here 103 ;;; cc-menus.el ends here