Mercurial > emacs
annotate lisp/progmodes/cc-langs.el @ 34395:2f4a4d355834
(time-stamp-old-format-warn): reorder custom
choices to match documentation string.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Sat, 09 Dec 2000 13:22:51 +0000 |
parents | 9e4506dd912e |
children | 32a4317c6aa5 |
rev | line source |
---|---|
18720 | 1 ;;; cc-langs.el --- specific language support for CC Mode |
2 | |
34342 | 3 ;; Copyright (C) 1985,1987,1992,1993,1994,1995,1996,1997,1998,2000 |
4 ;; Free Software Foundation, Inc. | |
18720 | 5 |
30402
cc4564c9cd55
(c-append-paragraph-start): New variable used by
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
6 ;; Authors: 2000- Martin Stjernholm |
cc4564c9cd55
(c-append-paragraph-start): New variable used by
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
7 ;; 1998-1999 Barry A. Warsaw and Martin Stjernholm |
24282 | 8 ;; 1992-1997 Barry A. Warsaw |
18720 | 9 ;; 1987 Dave Detlefs and Stewart Clamen |
10 ;; 1985 Richard M. Stallman | |
24282 | 11 ;; Maintainer: bug-cc-mode@gnu.org |
18720 | 12 ;; Created: 22-Apr-1997 (split from cc-mode.el) |
20141 | 13 ;; Version: See cc-mode.el |
18720 | 14 ;; Keywords: c languages oop |
15 | |
16 ;; This file is part of GNU Emacs. | |
17 | |
18 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
19 ;; it under the terms of the GNU General Public License as published by | |
20 ;; the Free Software Foundation; either version 2, or (at your option) | |
21 ;; any later version. | |
22 | |
23 ;; GNU Emacs is distributed in the hope that it will be useful, | |
24 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
25 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
26 ;; GNU General Public License for more details. | |
27 | |
28 ;; You should have received a copy of the GNU General Public License | |
29 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
30 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
31 ;; Boston, MA 02111-1307, USA. | |
32 | |
26817 | 33 (eval-when-compile |
34 (let ((load-path | |
35 (if (and (boundp 'byte-compile-current-file) | |
36 (stringp byte-compile-current-file)) | |
37 (cons (file-name-directory byte-compile-current-file) | |
38 load-path) | |
39 load-path))) | |
40 (load "cc-defs" nil t))) | |
41 (require 'cc-styles) | |
42 | |
43 ;; Pull in some other packages. | |
44 (eval-when-compile | |
45 (condition-case nil | |
46 ;; Not required and only needed during compilation to shut up | |
47 ;; the compiler. | |
48 (require 'outline) | |
49 (error nil))) | |
50 ;; menu support for both XEmacs and Emacs. If you don't have easymenu | |
51 ;; with your version of Emacs, you are incompatible! | |
52 (require 'easymenu) | |
18842
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
53 |
18720 | 54 |
26817 | 55 (defvar c-buffer-is-cc-mode nil |
56 "Non-nil for all buffers with a `major-mode' derived from CC Mode. | |
57 Otherwise, this variable is nil. I.e. this variable is non-nil for | |
58 `c-mode', `c++-mode', `objc-mode', `java-mode', `idl-mode', | |
59 `pike-mode', and any other non-CC Mode mode that calls | |
60 `c-initialize-cc-mode' (e.g. `awk-mode').") | |
61 (make-variable-buffer-local 'c-buffer-is-cc-mode) | |
62 (put 'c-buffer-is-cc-mode 'permanent-local t) | |
18772 | 63 |
26817 | 64 |
18720 | 65 ;; Regular expressions and other values which must be parameterized on |
66 ;; a per-language basis. | |
67 | |
68 ;; Keywords defining protection levels | |
69 (defconst c-protection-key "\\<\\(public\\|protected\\|private\\)\\>") | |
70 | |
18842
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
71 ;; Regex describing a `symbol' in all languages. We cannot use just |
18720 | 72 ;; `word' syntax class since `_' cannot be in word class. Putting |
73 ;; underscore in word class breaks forward word movement behavior that | |
18842
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
74 ;; users are familiar with. Besides, this runs counter to Emacs |
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
75 ;; convention. |
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
76 ;; |
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
77 ;; I suspect this definition isn't correct in light of Java's |
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
78 ;; definition of a symbol as being Unicode. I know so little about |
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
79 ;; I18N (except how to sound cool and say I18N :-) that I'm willing to |
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
80 ;; punt on this for now. |
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
81 |
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
82 (defconst c-symbol-key "[_a-zA-Z]\\(\\w\\|\\s_\\)*") |
18720 | 83 |
84 | |
85 ;; keywords introducing class definitions. language specific | |
86 (defconst c-C-class-key "\\(struct\\|union\\)") | |
87 (defconst c-C++-class-key "\\(class\\|struct\\|union\\)") | |
26817 | 88 (defconst c-IDL-class-key "\\(interface\\|struct\\|union\\|valuetype\\)") |
24282 | 89 (defconst c-C-extra-toplevel-key "\\(extern\\)") |
90 (defconst c-C++-extra-toplevel-key "\\(extern\\|namespace\\)") | |
91 (defconst c-IDL-extra-toplevel-key "\\(module\\)") | |
18720 | 92 |
93 (defconst c-ObjC-class-key | |
94 (concat | |
95 "@\\(interface\\|implementation\\)\\s +" | |
96 c-symbol-key ;name of the class | |
97 "\\(\\s *:\\s *" c-symbol-key "\\)?" ;maybe followed by the superclass | |
98 "\\(\\s *<[^>]+>\\)?" ;and maybe the adopted protocols list | |
99 )) | |
100 | |
101 (defconst c-Java-class-key | |
102 (concat | |
103 "\\(" c-protection-key "\\s +\\)?" | |
104 "\\(interface\\|class\\)\\s +" | |
105 c-symbol-key ;name of the class | |
24282 | 106 "\\(\\s *extends\\s *" c-symbol-key "\\)?" ;maybe followed by superclass |
18720 | 107 ;;"\\(\\s *implements *[^{]+{\\)?" ;maybe the adopted protocols list |
108 )) | |
109 | |
24282 | 110 (defconst c-Pike-class-key "class") |
111 | |
18720 | 112 (defvar c-class-key c-C-class-key) |
113 (make-variable-buffer-local 'c-class-key) | |
114 | |
20915
c746c93c9c95
(c-postprocess-file-styles): If a file style or file offsets are set,
Richard M. Stallman <rms@gnu.org>
parents:
20141
diff
changeset
|
115 (defvar c-extra-toplevel-key c-C-extra-toplevel-key) |
c746c93c9c95
(c-postprocess-file-styles): If a file style or file offsets are set,
Richard M. Stallman <rms@gnu.org>
parents:
20141
diff
changeset
|
116 (make-variable-buffer-local 'c-extra-toplevel-key) |
c746c93c9c95
(c-postprocess-file-styles): If a file style or file offsets are set,
Richard M. Stallman <rms@gnu.org>
parents:
20141
diff
changeset
|
117 |
26817 | 118 ;; Keywords that can introduce bitfields in the languages that supports that. |
119 (defconst c-C-bitfield-key "\\(char\\|int\\|long\\|signed\\|unsigned\\)") | |
120 | |
121 (defvar c-bitfield-key nil) | |
122 (make-variable-buffer-local 'c-bitfield-key) | |
123 | |
18720 | 124 |
125 ;; regexp describing access protection clauses. language specific | |
126 (defvar c-access-key nil) | |
127 (make-variable-buffer-local 'c-access-key) | |
128 (defconst c-C++-access-key (concat c-protection-key "[ \t]*:")) | |
26817 | 129 (defconst c-IDL-access-key nil) |
18720 | 130 (defconst c-ObjC-access-key (concat "@" c-protection-key)) |
131 (defconst c-Java-access-key nil) | |
24282 | 132 (defconst c-Pike-access-key nil) |
18720 | 133 |
134 | |
135 ;; keywords introducing conditional blocks | |
136 (defconst c-C-conditional-key nil) | |
137 (defconst c-C++-conditional-key nil) | |
26817 | 138 (defconst c-IDL-conditional-key nil) |
139 (defconst c-ObjC-conditional-key nil) | |
18720 | 140 (defconst c-Java-conditional-key nil) |
24282 | 141 (defconst c-Pike-conditional-key nil) |
18720 | 142 |
143 (let ((all-kws "for\\|if\\|do\\|else\\|while\\|switch") | |
144 (exc-kws "\\|try\\|catch") | |
145 (thr-kws "\\|finally\\|synchronized") | |
146 (front "\\b\\(") | |
147 (back "\\)\\b[^_]")) | |
148 (setq c-C-conditional-key (concat front all-kws back) | |
149 c-C++-conditional-key (concat front all-kws exc-kws back) | |
26817 | 150 ;; c-IDL-conditional-key is nil. |
151 c-ObjC-conditional-key c-C-conditional-key | |
24282 | 152 c-Java-conditional-key (concat front all-kws exc-kws thr-kws back) |
153 c-Pike-conditional-key (concat front all-kws "\\|foreach" back))) | |
18720 | 154 |
155 (defvar c-conditional-key c-C-conditional-key) | |
156 (make-variable-buffer-local 'c-conditional-key) | |
157 | |
158 | |
159 ;; keywords describing method definition introductions | |
160 (defvar c-method-key nil) | |
161 (make-variable-buffer-local 'c-method-key) | |
162 | |
163 (defconst c-ObjC-method-key | |
164 (concat | |
165 "^\\s *[+-]\\s *" | |
166 "\\(([^)]*)\\)?" ; return type | |
167 ;; \\s- in objc syntax table does not include \n | |
168 ;; since it is considered the end of //-comments. | |
169 "[ \t\n]*" c-symbol-key)) | |
170 | |
171 | |
172 | |
173 ;; comment starter definitions for various languages. language specific | |
174 (defconst c-C++-comment-start-regexp "/[/*]") | |
26817 | 175 (defconst c-C-comment-start-regexp c-C++-comment-start-regexp) |
176 (defconst c-IDL-comment-start-regexp c-C++-comment-start-regexp) | |
177 (defconst c-ObjC-comment-start-regexp c-C++-comment-start-regexp) | |
178 (defconst c-Pike-comment-start-regexp c-C++-comment-start-regexp) | |
18720 | 179 ;; We need to match all 3 Java style comments |
180 ;; 1) Traditional C block; 2) javadoc /** ...; 3) C++ style | |
181 (defconst c-Java-comment-start-regexp "/\\(/\\|[*][*]?\\)") | |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
182 (defvar c-comment-start-regexp c-C++-comment-start-regexp) |
18720 | 183 (make-variable-buffer-local 'c-comment-start-regexp) |
184 | |
185 | |
186 | |
187 ;; Regexp describing a switch's case or default label for all languages | |
188 (defconst c-switch-label-key "\\(\\(case[( \t]+\\S .*\\)\\|default[ \t]*\\):") | |
189 ;; Regexp describing any label. | |
190 (defconst c-label-key (concat c-symbol-key ":\\([^:]\\|$\\)")) | |
191 | |
192 ;; Regexp describing class inheritance declarations. TBD: this should | |
193 ;; be language specific, and only makes sense for C++ | |
194 (defconst c-inher-key | |
195 (concat "\\(\\<static\\>\\s +\\)?" | |
196 c-C++-class-key "[ \t]+" c-symbol-key | |
197 "\\([ \t]*:[ \t]*\\)\\s *[^;]")) | |
198 | |
199 ;; Regexp describing C++ base classes in a derived class definition. | |
200 ;; TBD: this should be language specific, and only makes sense for C++ | |
201 (defvar c-baseclass-key | |
202 (concat | |
203 ":?[ \t]*\\(virtual[ \t]+\\)?\\(" | |
204 c-protection-key "[ \t]+\\)" c-symbol-key)) | |
205 (make-variable-buffer-local 'c-baseclass-key) | |
206 | |
207 ;; Regexp describing friend declarations in C++ classes. | |
208 (defconst c-C++-friend-key | |
209 "friend[ \t]+\\|template[ \t]*<.+>[ \t]*friend[ \t]+") | |
210 | |
211 ;; Regexp describing Java inheritance and throws clauses. | |
212 (defconst c-Java-special-key "\\(implements\\|extends\\|throws\\)[^_]") | |
213 | |
214 ;; Regexp describing the beginning of a Java top-level definition. | |
215 (defconst c-Java-defun-prompt-regexp | |
216 "^[ \t]*\\(\\(\\(public\\|protected\\|private\\|const\\|abstract\\|synchronized\\|final\\|static\\|threadsafe\\|transient\\|native\\|volatile\\)\\s-+\\)*\\(\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*[][_$.a-zA-Z0-9]+\\|[[a-zA-Z]\\)\\s-*\\)\\s-+\\)\\)?\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*\\s-+\\)\\s-*\\)?\\([_a-zA-Z][^][ \t:;.,{}()=]*\\|\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)\\)\\s-*\\(([^);{}]*)\\)?\\([] \t]*\\)\\(\\s-*\\<throws\\>\\s-*\\(\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)[, \t\n\r\f]*\\)+\\)?\\s-*") | |
217 | |
30402
cc4564c9cd55
(c-append-paragraph-start): New variable used by
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
218 ;; Regexp describing regexp to append to paragraph-start |
cc4564c9cd55
(c-append-paragraph-start): New variable used by
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
219 (defvar c-append-paragraph-start "$") |
cc4564c9cd55
(c-append-paragraph-start): New variable used by
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
220 (make-variable-buffer-local 'c-append-paragraph-start) |
21108
e3c68a6888f9
(c-Java-javadoc-paragraph-start): New variable for use in c-fill-paragraph.
Richard M. Stallman <rms@gnu.org>
parents:
20915
diff
changeset
|
221 (defconst c-Java-javadoc-paragraph-start |
30402
cc4564c9cd55
(c-append-paragraph-start): New variable used by
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
222 (concat "\\(" |
cc4564c9cd55
(c-append-paragraph-start): New variable used by
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
223 "@\\(author\\|deprecated\\|exception\\|param\\|return\\|" |
cc4564c9cd55
(c-append-paragraph-start): New variable used by
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
224 "s\\(e\\(e\\|rial\\(\\|Data\\|Field\\)\\)\\|ince\\)\\|" |
cc4564c9cd55
(c-append-paragraph-start): New variable used by
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
225 "throws\\|version\\)" |
cc4564c9cd55
(c-append-paragraph-start): New variable used by
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
226 "\\|$\\)")) |
21108
e3c68a6888f9
(c-Java-javadoc-paragraph-start): New variable for use in c-fill-paragraph.
Richard M. Stallman <rms@gnu.org>
parents:
20915
diff
changeset
|
227 |
24282 | 228 ;; Regexp that starts lambda constructs. |
229 (defvar c-lambda-key nil) | |
230 (make-variable-buffer-local 'c-lambda-key) | |
231 (defconst c-Pike-lambda-key "\\<lambda\\>") | |
232 | |
233 ;; Regexp that are followed by a statement block in expressions. | |
234 (defvar c-inexpr-block-key nil) | |
235 (make-variable-buffer-local 'c-inexpr-block-key) | |
236 (defconst c-Pike-inexpr-block-key "\\<\\(catch\\|gauge\\)\\>") | |
237 | |
238 ;; Regexp that may be followed by an anonymous class in expressions. | |
239 (defvar c-inexpr-class-key nil) | |
240 (make-variable-buffer-local 'c-inexpr-class-key) | |
241 (defconst c-Java-inexpr-class-key "\\<new\\>") | |
30402
cc4564c9cd55
(c-append-paragraph-start): New variable used by
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
242 (defconst c-Pike-inexpr-class-key "\\<class\\>") |
24282 | 243 |
244 ;; List of open- and close-chars that makes up a pike-style brace | |
245 ;; list, ie for a `([ ])' list there should be a cons (?\[ . ?\]) in | |
246 ;; this list. | |
247 (defvar c-special-brace-lists nil) | |
248 (make-variable-buffer-local 'c-special-brace-lists) | |
249 (defconst c-Pike-special-brace-lists '((?{ . ?}) | |
250 (?\[ . ?\]) | |
251 (?< . ?>))) | |
252 | |
18720 | 253 |
254 | |
255 ;; internal state variables | |
256 | |
257 ;; Internal state of hungry delete key feature | |
258 (defvar c-hungry-delete-key nil) | |
259 (make-variable-buffer-local 'c-hungry-delete-key) | |
260 | |
261 ;; Internal state of auto newline feature. | |
262 (defvar c-auto-newline nil) | |
263 (make-variable-buffer-local 'c-auto-newline) | |
264 | |
265 ;; Internal auto-newline/hungry-delete designation string for mode line. | |
266 (defvar c-auto-hungry-string nil) | |
267 (make-variable-buffer-local 'c-auto-hungry-string) | |
268 | |
269 ;; Non-nil means K&R style argument declarations are valid. | |
270 (defvar c-recognize-knr-p t) | |
271 (make-variable-buffer-local 'c-recognize-knr-p) | |
272 | |
273 | |
274 | |
275 (defun c-common-init () | |
276 ;; Common initializations for all modes. | |
277 ;; these variables should always be buffer local; they do not affect | |
278 ;; indentation style. | |
279 (make-local-variable 'require-final-newline) | |
280 (make-local-variable 'parse-sexp-ignore-comments) | |
281 (make-local-variable 'indent-line-function) | |
282 (make-local-variable 'indent-region-function) | |
26817 | 283 (make-local-variable 'outline-regexp) |
284 (make-local-variable 'outline-level) | |
285 (make-local-variable 'normal-auto-fill-function) | |
18720 | 286 (make-local-variable 'comment-start) |
287 (make-local-variable 'comment-end) | |
288 (make-local-variable 'comment-column) | |
289 (make-local-variable 'comment-start-skip) | |
290 (make-local-variable 'comment-multi-line) | |
26817 | 291 (make-local-variable 'paragraph-start) |
292 (make-local-variable 'paragraph-separate) | |
293 (make-local-variable 'paragraph-ignore-fill-prefix) | |
294 (make-local-variable 'adaptive-fill-mode) | |
18720 | 295 (make-local-variable 'adaptive-fill-regexp) |
296 (make-local-variable 'imenu-generic-expression) ;set in the mode functions | |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
297 ;; X/Emacs 20 only |
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
298 (and (boundp 'comment-line-break-function) |
26817 | 299 (progn |
300 (make-local-variable 'comment-line-break-function) | |
301 (setq comment-line-break-function | |
302 'c-indent-new-comment-line))) | |
18720 | 303 ;; now set their values |
26817 | 304 (setq require-final-newline t |
18720 | 305 parse-sexp-ignore-comments t |
306 indent-line-function 'c-indent-line | |
307 indent-region-function 'c-indent-region | |
308 outline-regexp "[^#\n\^M]" | |
309 outline-level 'c-outline-level | |
26817 | 310 normal-auto-fill-function 'c-do-auto-fill |
18720 | 311 comment-column 32 |
26817 | 312 comment-start-skip "/\\*+ *\\|//+ *" |
313 comment-multi-line t) | |
314 ;; now set the mode style based on c-default-style | |
315 (let ((style (if (stringp c-default-style) | |
316 (if (c-major-mode-is 'java-mode) | |
317 "java" | |
318 c-default-style) | |
319 (or (cdr (assq major-mode c-default-style)) | |
320 (cdr (assq 'other c-default-style)) | |
321 "gnu")))) | |
322 ;; Override style variables if `c-old-style-variable-behavior' is | |
323 ;; set. Also override if we are using global style variables, | |
324 ;; have already initialized a style once, and are switching to a | |
325 ;; different style. (It's doubtful whether this is desirable, but | |
326 ;; the whole situation with nonlocal style variables is a bit | |
327 ;; awkward. It's at least the most compatible way with the old | |
328 ;; style init procedure.) | |
329 (c-set-style style (not (or c-old-style-variable-behavior | |
330 (and (not c-style-variables-are-local-p) | |
331 c-indentation-style | |
332 (not (string-equal c-indentation-style | |
333 style))))))) | |
334 ;; Fix things up for paragraph recognition and filling inside | |
335 ;; comments by using c-comment-prefix-regexp in the relevant places. | |
336 ;; We use adaptive filling for this to make it possible to use | |
337 ;; filladapt or some other fancy package. | |
338 (let ((comment-line-prefix | |
339 (concat "[ \t]*\\(" c-comment-prefix-regexp "\\)?[ \t]*"))) | |
30402
cc4564c9cd55
(c-append-paragraph-start): New variable used by
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
340 (setq paragraph-start (concat comment-line-prefix |
cc4564c9cd55
(c-append-paragraph-start): New variable used by
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
341 c-append-paragraph-start |
cc4564c9cd55
(c-append-paragraph-start): New variable used by
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
342 "\\|" |
26817 | 343 page-delimiter) |
30402
cc4564c9cd55
(c-append-paragraph-start): New variable used by
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
344 paragraph-separate (concat comment-line-prefix "$" |
cc4564c9cd55
(c-append-paragraph-start): New variable used by
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
345 "\\|" |
cc4564c9cd55
(c-append-paragraph-start): New variable used by
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
346 page-delimiter) |
26817 | 347 paragraph-ignore-fill-prefix t |
348 adaptive-fill-mode t | |
349 adaptive-fill-regexp | |
350 (concat comment-line-prefix | |
351 (if adaptive-fill-regexp | |
352 (concat "\\(" adaptive-fill-regexp "\\)") | |
353 ""))) | |
354 (when (boundp 'adaptive-fill-first-line-regexp) | |
355 ;; XEmacs (20.x) adaptive fill mode doesn't have this. | |
356 (make-local-variable 'adaptive-fill-first-line-regexp) | |
357 (setq adaptive-fill-first-line-regexp | |
358 (concat "\\`" comment-line-prefix | |
359 ;; Maybe we should incorporate the old value here, | |
360 ;; but then we have to do all sorts of kludges to | |
361 ;; deal with the \` and \' it probably contains. | |
362 "\\'")))) | |
18720 | 363 ;; we have to do something special for c-offsets-alist so that the |
364 ;; buffer local value has its own alist structure. | |
365 (setq c-offsets-alist (copy-alist c-offsets-alist)) | |
366 ;; setup the comment indent variable in a Emacs version portable way | |
367 ;; ignore any byte compiler warnings you might get here | |
368 (make-local-variable 'comment-indent-function) | |
369 (setq comment-indent-function 'c-comment-indent) | |
370 ;; add menus to menubar | |
371 (easy-menu-add (c-mode-menu mode-name)) | |
372 ;; put auto-hungry designators onto minor-mode-alist, but only once | |
373 (or (assq 'c-auto-hungry-string minor-mode-alist) | |
374 (setq minor-mode-alist | |
375 (cons '(c-auto-hungry-string c-auto-hungry-string) | |
24282 | 376 minor-mode-alist))) |
377 ) | |
378 | |
18720 | 379 |
380 (defun c-postprocess-file-styles () | |
381 "Function that post processes relevant file local variables. | |
382 Currently, this function simply applies any style and offset settings | |
383 found in the file's Local Variable list. It first applies any style | |
384 setting found in `c-file-style', then it applies any offset settings | |
20915
c746c93c9c95
(c-postprocess-file-styles): If a file style or file offsets are set,
Richard M. Stallman <rms@gnu.org>
parents:
20141
diff
changeset
|
385 it finds in `c-file-offsets'. |
c746c93c9c95
(c-postprocess-file-styles): If a file style or file offsets are set,
Richard M. Stallman <rms@gnu.org>
parents:
20141
diff
changeset
|
386 |
c746c93c9c95
(c-postprocess-file-styles): If a file style or file offsets are set,
Richard M. Stallman <rms@gnu.org>
parents:
20141
diff
changeset
|
387 Note that the style variables are always made local to the buffer." |
18720 | 388 ;; apply file styles and offsets |
20915
c746c93c9c95
(c-postprocess-file-styles): If a file style or file offsets are set,
Richard M. Stallman <rms@gnu.org>
parents:
20141
diff
changeset
|
389 (if (or c-file-style c-file-offsets) |
c746c93c9c95
(c-postprocess-file-styles): If a file style or file offsets are set,
Richard M. Stallman <rms@gnu.org>
parents:
20141
diff
changeset
|
390 (c-make-styles-buffer-local t)) |
18720 | 391 (and c-file-style |
392 (c-set-style c-file-style)) | |
393 (and c-file-offsets | |
394 (mapcar | |
395 (function | |
396 (lambda (langentry) | |
397 (let ((langelem (car langentry)) | |
398 (offset (cdr langentry))) | |
399 (c-set-offset langelem offset) | |
400 ))) | |
401 c-file-offsets))) | |
402 | |
403 (add-hook 'hack-local-variables-hook 'c-postprocess-file-styles) | |
404 | |
405 | |
24282 | 406 (defvar c-mode-base-map () |
407 "Keymap shared by all CC Mode related modes.") | |
408 | |
18720 | 409 ;; Common routines |
18842
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
410 (defun c-make-inherited-keymap () |
18720 | 411 (let ((map (make-sparse-keymap))) |
412 (cond | |
413 ;; XEmacs 19 & 20 | |
414 ((fboundp 'set-keymap-parents) | |
415 (set-keymap-parents map c-mode-base-map)) | |
416 ;; Emacs 19 | |
417 ((fboundp 'set-keymap-parent) | |
418 (set-keymap-parent map c-mode-base-map)) | |
419 ;; incompatible | |
420 (t (error "CC Mode is incompatible with this version of Emacs"))) | |
421 map)) | |
422 | |
423 (defun c-populate-syntax-table (table) | |
424 ;; Populate the syntax TABLE | |
425 ;; DO NOT TRY TO SET _ (UNDERSCORE) TO WORD CLASS! | |
426 (modify-syntax-entry ?_ "_" table) | |
427 (modify-syntax-entry ?\\ "\\" table) | |
428 (modify-syntax-entry ?+ "." table) | |
429 (modify-syntax-entry ?- "." table) | |
430 (modify-syntax-entry ?= "." table) | |
431 (modify-syntax-entry ?% "." table) | |
432 (modify-syntax-entry ?< "." table) | |
433 (modify-syntax-entry ?> "." table) | |
434 (modify-syntax-entry ?& "." table) | |
435 (modify-syntax-entry ?| "." table) | |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
436 (modify-syntax-entry ?\' "\"" table) |
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
437 ;; Set up block and line oriented comments. The new C standard |
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
438 ;; mandates both comment styles even in C, so since all languages |
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
439 ;; now require dual comments, we make this the default. |
18720 | 440 (cond |
441 ;; XEmacs 19 & 20 | |
442 ((memq '8-bit c-emacs-features) | |
443 (modify-syntax-entry ?/ ". 1456" table) | |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
444 (modify-syntax-entry ?* ". 23" table)) |
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
445 ;; Emacs 19 & 20 |
18720 | 446 ((memq '1-bit c-emacs-features) |
447 (modify-syntax-entry ?/ ". 124b" table) | |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
448 (modify-syntax-entry ?* ". 23" table)) |
18720 | 449 ;; incompatible |
450 (t (error "CC Mode is incompatible with this version of Emacs")) | |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
451 ) |
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
452 (modify-syntax-entry ?\n "> b" table) |
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
453 ;; Give CR the same syntax as newline, for selective-display |
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
454 (modify-syntax-entry ?\^m "> b" table)) |
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
455 |
18720 | 456 |
457 (if c-mode-base-map | |
458 nil | |
459 ;; TBD: should we even worry about naming this keymap. My vote: no, | |
460 ;; because Emacs and XEmacs do it differently. | |
461 (setq c-mode-base-map (make-sparse-keymap)) | |
462 ;; put standard keybindings into MAP | |
463 ;; the following mappings correspond more or less directly to BOCM | |
464 (define-key c-mode-base-map "{" 'c-electric-brace) | |
465 (define-key c-mode-base-map "}" 'c-electric-brace) | |
466 (define-key c-mode-base-map ";" 'c-electric-semi&comma) | |
467 (define-key c-mode-base-map "#" 'c-electric-pound) | |
468 (define-key c-mode-base-map ":" 'c-electric-colon) | |
24282 | 469 (define-key c-mode-base-map "(" 'c-electric-paren) |
470 (define-key c-mode-base-map ")" 'c-electric-paren) | |
20915
c746c93c9c95
(c-postprocess-file-styles): If a file style or file offsets are set,
Richard M. Stallman <rms@gnu.org>
parents:
20141
diff
changeset
|
471 ;; Separate M-BS from C-M-h. The former should remain |
c746c93c9c95
(c-postprocess-file-styles): If a file style or file offsets are set,
Richard M. Stallman <rms@gnu.org>
parents:
20141
diff
changeset
|
472 ;; backward-kill-word. |
c746c93c9c95
(c-postprocess-file-styles): If a file style or file offsets are set,
Richard M. Stallman <rms@gnu.org>
parents:
20141
diff
changeset
|
473 (define-key c-mode-base-map [(control meta h)] 'c-mark-function) |
18720 | 474 (define-key c-mode-base-map "\e\C-q" 'c-indent-exp) |
26817 | 475 (substitute-key-definition 'backward-sentence |
476 'c-beginning-of-statement | |
477 c-mode-base-map global-map) | |
478 (substitute-key-definition 'forward-sentence | |
479 'c-end-of-statement | |
480 c-mode-base-map global-map) | |
481 (substitute-key-definition 'indent-new-comment-line | |
482 'c-indent-new-comment-line | |
483 c-mode-base-map global-map) | |
20915
c746c93c9c95
(c-postprocess-file-styles): If a file style or file offsets are set,
Richard M. Stallman <rms@gnu.org>
parents:
20141
diff
changeset
|
484 ;; RMS says don't make these the default. |
c746c93c9c95
(c-postprocess-file-styles): If a file style or file offsets are set,
Richard M. Stallman <rms@gnu.org>
parents:
20141
diff
changeset
|
485 ;; (define-key c-mode-base-map "\e\C-a" 'c-beginning-of-defun) |
c746c93c9c95
(c-postprocess-file-styles): If a file style or file offsets are set,
Richard M. Stallman <rms@gnu.org>
parents:
20141
diff
changeset
|
486 ;; (define-key c-mode-base-map "\e\C-e" 'c-end-of-defun) |
18720 | 487 (define-key c-mode-base-map "\C-c\C-n" 'c-forward-conditional) |
488 (define-key c-mode-base-map "\C-c\C-p" 'c-backward-conditional) | |
489 (define-key c-mode-base-map "\C-c\C-u" 'c-up-conditional) | |
26817 | 490 (substitute-key-definition 'indent-for-tab-command |
491 'c-indent-command | |
492 c-mode-base-map global-map) | |
493 ;; It doesn't suffice to put c-fill-paragraph on | |
494 ;; fill-paragraph-function due to the way it works. | |
495 (substitute-key-definition 'fill-paragraph 'c-fill-paragraph | |
496 c-mode-base-map global-map) | |
497 ;; In XEmacs the default fill function is called | |
498 ;; fill-paragraph-or-region. | |
499 (substitute-key-definition 'fill-paragraph-or-region 'c-fill-paragraph | |
500 c-mode-base-map global-map) | |
18720 | 501 ;; Caution! Enter here at your own risk. We are trying to support |
502 ;; several behaviors and it gets disgusting. :-( | |
503 ;; | |
26817 | 504 (if (boundp 'delete-key-deletes-forward) |
505 (progn | |
506 ;; In XEmacs 20 it is possible to sanely define both backward | |
507 ;; and forward deletion behavior under X separately (TTYs are | |
508 ;; forever beyond hope, but who cares? XEmacs 20 does the | |
509 ;; right thing with these too). | |
510 (define-key c-mode-base-map [delete] 'c-electric-delete) | |
511 (define-key c-mode-base-map [backspace] 'c-electric-backspace)) | |
512 ;; In XEmacs 19, Emacs 19, and Emacs 20, we use this to bind | |
513 ;; backwards deletion behavior to DEL, which both Delete and | |
514 ;; Backspace get translated to. There's no way to separate this | |
515 ;; behavior in a clean way, so deal with it! Besides, it's been | |
516 ;; this way since the dawn of BOCM. | |
517 (define-key c-mode-base-map "\177" 'c-electric-backspace)) | |
18720 | 518 ;; these are new keybindings, with no counterpart to BOCM |
519 (define-key c-mode-base-map "," 'c-electric-semi&comma) | |
520 (define-key c-mode-base-map "*" 'c-electric-star) | |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
521 (define-key c-mode-base-map "/" 'c-electric-slash) |
18720 | 522 (define-key c-mode-base-map "\C-c\C-q" 'c-indent-defun) |
523 (define-key c-mode-base-map "\C-c\C-\\" 'c-backslash-region) | |
524 ;; TBD: where if anywhere, to put c-backward|forward-into-nomenclature | |
525 (define-key c-mode-base-map "\C-c\C-a" 'c-toggle-auto-state) | |
526 (define-key c-mode-base-map "\C-c\C-b" 'c-submit-bug-report) | |
527 (define-key c-mode-base-map "\C-c\C-c" 'comment-region) | |
528 (define-key c-mode-base-map "\C-c\C-d" 'c-toggle-hungry-state) | |
529 (define-key c-mode-base-map "\C-c\C-o" 'c-set-offset) | |
530 (define-key c-mode-base-map "\C-c\C-s" 'c-show-syntactic-information) | |
531 (define-key c-mode-base-map "\C-c\C-t" 'c-toggle-auto-hungry-state) | |
532 (define-key c-mode-base-map "\C-c." 'c-set-style) | |
533 ;; conflicts with OOBR | |
534 ;;(define-key c-mode-base-map "\C-c\C-v" 'c-version) | |
535 ) | |
536 | |
537 (defvar c-c-menu nil) | |
538 (defvar c-c++-menu nil) | |
539 (defvar c-objc-menu nil) | |
540 (defvar c-java-menu nil) | |
24282 | 541 (defvar c-pike-menu nil) |
18720 | 542 |
543 (defun c-mode-menu (modestr) | |
544 (let ((m | |
24282 | 545 '(["Comment Out Region" comment-region (c-region-is-active-p)] |
18842
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
546 ["Uncomment Region" |
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
547 (comment-region (region-beginning) (region-end) '(4)) |
24282 | 548 (c-region-is-active-p)] |
18842
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
549 ["Fill Comment Paragraph" c-fill-paragraph t] |
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
550 "---" |
18720 | 551 ["Indent Expression" c-indent-exp |
552 (memq (char-after) '(?\( ?\[ ?\{))] | |
24282 | 553 ["Indent Line or Region" c-indent-line-or-region t] |
18720 | 554 ["Up Conditional" c-up-conditional t] |
555 ["Backward Conditional" c-backward-conditional t] | |
556 ["Forward Conditional" c-forward-conditional t] | |
557 ["Backward Statement" c-beginning-of-statement t] | |
558 ["Forward Statement" c-end-of-statement t] | |
18842
72c2475ece1c
Require 'cc-defs for the definition of c-emacs-features.
Richard M. Stallman <rms@gnu.org>
parents:
18772
diff
changeset
|
559 "---" |
24282 | 560 ["Macro Expand Region" c-macro-expand (c-region-is-active-p)] |
561 ["Backslashify" c-backslash-region (c-region-is-active-p)] | |
18720 | 562 ))) |
563 (cons modestr m))) | |
564 | |
565 | |
566 | |
567 ;; Support for C | |
568 | |
569 (defvar c-mode-abbrev-table nil | |
19250 | 570 "Abbreviation table used in c-mode buffers.") |
18720 | 571 (define-abbrev-table 'c-mode-abbrev-table ()) |
572 | |
573 (defvar c-mode-map () | |
574 "Keymap used in c-mode buffers.") | |
575 (if c-mode-map | |
576 nil | |
577 (setq c-mode-map (c-make-inherited-keymap)) | |
578 ;; add bindings which are only useful for C | |
19805
e804ac04eec1
(c-mode-base-map): Don't define C-c C-e here.
Richard M. Stallman <rms@gnu.org>
parents:
19381
diff
changeset
|
579 (define-key c-mode-map "\C-c\C-e" 'c-macro-expand) |
18720 | 580 ) |
581 | |
582 ;;;###autoload | |
583 (defvar c-mode-syntax-table nil | |
584 "Syntax table used in c-mode buffers.") | |
585 (if c-mode-syntax-table | |
586 () | |
587 (setq c-mode-syntax-table (make-syntax-table)) | |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
588 (c-populate-syntax-table c-mode-syntax-table)) |
18720 | 589 |
590 (easy-menu-define c-c-menu c-mode-map "C Mode Commands" | |
591 (c-mode-menu "C")) | |
592 | |
593 | |
594 ;; Support for C++ | |
595 | |
596 (defvar c++-mode-abbrev-table nil | |
19250 | 597 "Abbreviation table used in c++-mode buffers.") |
18720 | 598 (define-abbrev-table 'c++-mode-abbrev-table ()) |
599 | |
600 (defvar c++-mode-map () | |
601 "Keymap used in c++-mode buffers.") | |
602 (if c++-mode-map | |
603 nil | |
604 (setq c++-mode-map (c-make-inherited-keymap)) | |
605 ;; add bindings which are only useful for C++ | |
19805
e804ac04eec1
(c-mode-base-map): Don't define C-c C-e here.
Richard M. Stallman <rms@gnu.org>
parents:
19381
diff
changeset
|
606 (define-key c++-mode-map "\C-c\C-e" 'c-macro-expand) |
e804ac04eec1
(c-mode-base-map): Don't define C-c C-e here.
Richard M. Stallman <rms@gnu.org>
parents:
19381
diff
changeset
|
607 (define-key c++-mode-map "\C-c:" 'c-scope-operator) |
e804ac04eec1
(c-mode-base-map): Don't define C-c C-e here.
Richard M. Stallman <rms@gnu.org>
parents:
19381
diff
changeset
|
608 (define-key c++-mode-map "<" 'c-electric-lt-gt) |
e804ac04eec1
(c-mode-base-map): Don't define C-c C-e here.
Richard M. Stallman <rms@gnu.org>
parents:
19381
diff
changeset
|
609 (define-key c++-mode-map ">" 'c-electric-lt-gt)) |
18720 | 610 |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
611 ;;;###autoload |
18720 | 612 (defvar c++-mode-syntax-table nil |
613 "Syntax table used in c++-mode buffers.") | |
614 (if c++-mode-syntax-table | |
615 () | |
616 (setq c++-mode-syntax-table (make-syntax-table)) | |
617 (c-populate-syntax-table c++-mode-syntax-table) | |
618 ;; TBD: does it make sense for colon to be symbol class in C++? | |
619 ;; I'm not so sure, since c-label-key is busted on lines like: | |
620 ;; Foo::bar( i ); | |
621 ;; maybe c-label-key should be fixed instead of commenting this out, | |
622 ;; but it also bothers me that this only seems appropriate for C++ | |
623 ;; and not C. | |
624 ;;(modify-syntax-entry ?: "_" c++-mode-syntax-table) | |
625 ) | |
626 | |
26817 | 627 (defvar c++-template-syntax-table nil |
628 "A variant of `c++-mode-syntax-table' that defines `<' and `>' as | |
629 parenthesis characters. Used temporarily when template argument lists | |
630 are parsed.") | |
631 (if c++-template-syntax-table | |
632 () | |
633 (setq c++-template-syntax-table | |
634 (copy-syntax-table c++-mode-syntax-table)) | |
635 (modify-syntax-entry ?< "(>" c++-template-syntax-table) | |
636 (modify-syntax-entry ?> ")<" c++-template-syntax-table)) | |
637 | |
18720 | 638 (easy-menu-define c-c++-menu c++-mode-map "C++ Mode Commands" |
639 (c-mode-menu "C++")) | |
640 | |
641 | |
642 ;; Support for Objective-C | |
643 | |
644 (defvar objc-mode-abbrev-table nil | |
19250 | 645 "Abbreviation table used in objc-mode buffers.") |
18720 | 646 (define-abbrev-table 'objc-mode-abbrev-table ()) |
647 | |
648 (defvar objc-mode-map () | |
649 "Keymap used in objc-mode buffers.") | |
650 (if objc-mode-map | |
651 nil | |
652 (setq objc-mode-map (c-make-inherited-keymap)) | |
653 ;; add bindings which are only useful for Objective-C | |
19805
e804ac04eec1
(c-mode-base-map): Don't define C-c C-e here.
Richard M. Stallman <rms@gnu.org>
parents:
19381
diff
changeset
|
654 (define-key objc-mode-map "\C-c\C-e" 'c-macro-expand)) |
18720 | 655 |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
656 ;;;###autoload |
18720 | 657 (defvar objc-mode-syntax-table nil |
658 "Syntax table used in objc-mode buffers.") | |
659 (if objc-mode-syntax-table | |
660 () | |
661 (setq objc-mode-syntax-table (make-syntax-table)) | |
662 (c-populate-syntax-table objc-mode-syntax-table) | |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
663 ;; add extra Objective-C only syntax |
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
664 (modify-syntax-entry ?@ "_" objc-mode-syntax-table)) |
18720 | 665 |
666 (easy-menu-define c-objc-menu objc-mode-map "ObjC Mode Commands" | |
667 (c-mode-menu "ObjC")) | |
668 | |
669 | |
670 ;; Support for Java | |
671 | |
672 (defvar java-mode-abbrev-table nil | |
19250 | 673 "Abbreviation table used in java-mode buffers.") |
18720 | 674 (define-abbrev-table 'java-mode-abbrev-table ()) |
675 | |
676 (defvar java-mode-map () | |
677 "Keymap used in java-mode buffers.") | |
678 (if java-mode-map | |
679 nil | |
680 (setq java-mode-map (c-make-inherited-keymap)) | |
681 ;; add bindings which are only useful for Java | |
19805
e804ac04eec1
(c-mode-base-map): Don't define C-c C-e here.
Richard M. Stallman <rms@gnu.org>
parents:
19381
diff
changeset
|
682 ) |
18720 | 683 |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
684 ;;;###autoload |
18720 | 685 (defvar java-mode-syntax-table nil |
686 "Syntax table used in java-mode buffers.") | |
687 (if java-mode-syntax-table | |
688 () | |
689 (setq java-mode-syntax-table (make-syntax-table)) | |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
690 (c-populate-syntax-table java-mode-syntax-table)) |
18720 | 691 |
692 (easy-menu-define c-java-menu java-mode-map "Java Mode Commands" | |
693 (c-mode-menu "Java")) | |
694 | |
695 | |
19250 | 696 ;; Support for CORBA's IDL language |
697 | |
698 (defvar idl-mode-abbrev-table nil | |
699 "Abbreviation table used in idl-mode buffers.") | |
700 (define-abbrev-table 'idl-mode-abbrev-table ()) | |
701 | |
702 (defvar idl-mode-map () | |
703 "Keymap used in idl-mode buffers.") | |
704 (if idl-mode-map | |
705 nil | |
706 (setq idl-mode-map (c-make-inherited-keymap)) | |
19805
e804ac04eec1
(c-mode-base-map): Don't define C-c C-e here.
Richard M. Stallman <rms@gnu.org>
parents:
19381
diff
changeset
|
707 ;; add bindings which are only useful for IDL |
e804ac04eec1
(c-mode-base-map): Don't define C-c C-e here.
Richard M. Stallman <rms@gnu.org>
parents:
19381
diff
changeset
|
708 ) |
19250 | 709 |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
710 ;;;###autoload |
19250 | 711 (defvar idl-mode-syntax-table nil |
712 "Syntax table used in idl-mode buffers.") | |
713 (if idl-mode-syntax-table | |
714 nil | |
715 (setq idl-mode-syntax-table (make-syntax-table)) | |
19300
b07fa43938cc
(c-mode-base-map, c++-mode-map):
Richard M. Stallman <rms@gnu.org>
parents:
19250
diff
changeset
|
716 (c-populate-syntax-table idl-mode-syntax-table)) |
19250 | 717 |
718 (easy-menu-define c-idl-menu idl-mode-map "IDL Mode Commands" | |
719 (c-mode-menu "IDL")) | |
720 | |
24282 | 721 |
722 ;; Support for Pike | |
723 | |
724 (defvar pike-mode-abbrev-table nil | |
725 "Abbreviation table used in pike-mode buffers.") | |
726 (define-abbrev-table 'pike-mode-abbrev-table ()) | |
727 | |
728 (defvar pike-mode-map () | |
729 "Keymap used in pike-mode buffers.") | |
730 (if pike-mode-map | |
731 nil | |
732 (setq pike-mode-map (c-make-inherited-keymap)) | |
733 ;; additional bindings | |
734 (define-key pike-mode-map "\C-c\C-e" 'c-macro-expand)) | |
735 | |
736 ;;;###autoload | |
737 (defvar pike-mode-syntax-table nil | |
738 "Syntax table used in pike-mode buffers.") | |
739 (if pike-mode-syntax-table | |
740 () | |
741 (setq pike-mode-syntax-table (make-syntax-table)) | |
742 (c-populate-syntax-table pike-mode-syntax-table) | |
743 (modify-syntax-entry ?@ "." pike-mode-syntax-table)) | |
744 | |
745 (easy-menu-define c-pike-menu pike-mode-map "Pike Mode Commands" | |
746 (c-mode-menu "Pike")) | |
747 | |
19250 | 748 |
749 | |
18720 | 750 (provide 'cc-langs) |
751 ;;; cc-langs.el ends here |