annotate lisp/cc-mode/cc-mode.el @ 187:b405438285a2 r20-3b20

Import from CVS: tag r20-3b20
author cvs
date Mon, 13 Aug 2007 09:56:28 +0200
parents e121b013d1f0
children 489f57a838ef
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
1 ;;; cc-mode.el --- major mode for editing C, C++, Objective-C, and Java code
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
2
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
3 ;; Copyright (C) 1985,87,92,93,94,95,96,97 Free Software Foundation, Inc.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
4
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
5 ;; Authors: 1992-1997 Barry A. Warsaw
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
6 ;; 1987 Dave Detlefs and Stewart Clamen
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
7 ;; 1985 Richard M. Stallman
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
8 ;; Maintainer: cc-mode-help@python.org
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
9 ;; Created: a long, long, time ago. adapted from the original c-mode.el
187
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 183
diff changeset
10 ;; Version: 5.17
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
11 ;; Keywords: c languages oop
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
12
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
13 ;; NOTE: Read the commentary below for the right way to submit bug reports!
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
14 ;; NOTE: See the accompanying texinfo manual for details on using this mode!
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
15
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
16 ;; This file is part of GNU Emacs.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
17
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
18 ;; GNU Emacs is free software; you can redistribute it and/or modify
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
19 ;; it under the terms of the GNU General Public License as published by
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
20 ;; the Free Software Foundation; either version 2, or (at your option)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
21 ;; any later version.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
22
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
23 ;; GNU Emacs is distributed in the hope that it will be useful,
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
24 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
25 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
26 ;; GNU General Public License for more details.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
27
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
28 ;; You should have received a copy of the GNU General Public License
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
29 ;; along with GNU Emacs; see the file COPYING. If not, write to the
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
30 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
31 ;; Boston, MA 02111-1307, USA.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
32
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
33 ;;; Commentary:
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
34
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
35 ;; This package provides GNU Emacs major modes for editing C, C++,
177
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
36 ;; Objective-C, Java and IDL code. As of the latest Emacs and XEmacs
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
37 ;; releases, it is the default package for editing these languages.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
38 ;; This package is called "CC Mode", and should be spelled exactly
177
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
39 ;; this way. It supports K&R and ANSI C, ANSI C++, Objective-C, Java,
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
40 ;; and CORBA's IDL with a consistent indentation model across all
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
41 ;; modes. This indentation model is intuitive and very flexible, so
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
42 ;; that almost any desired style of indentation can be supported.
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
43 ;; Installation, usage, and programming details are contained in an
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
44 ;; accompanying texinfo manual.
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
45
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
46 ;; CC Mode's immediate ancestors were, c++-mode.el, cplus-md.el, and
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
47 ;; cplus-md1.el..
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
48
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
49 ;; NOTE: This mode does not perform font-locking (a.k.a syntactic
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
50 ;; coloring, keyword highlighting, etc.) for any of the supported
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
51 ;; modes. Typically this is done by a package called font-lock.el
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
52 ;; which I do *not* maintain. You should contact the Emacs
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
53 ;; maintainers for questions about coloring or highlighting in any
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
54 ;; language mode.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
55
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
56 ;; To submit bug reports, type "C-c C-b". These will be sent to
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
57 ;; bug-gnu-emacs@prep.ai.mit.edu as well as cc-mode-help@python.org,
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
58 ;; and I'll read about them there (the former is mirrored as the
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
59 ;; Usenet newsgroup gnu.emacs.bug). Questions can sent to
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
60 ;; help-gnu-emacs@prep.ai.mit.edu (mirrored as gnu.emacs.help) and/or
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
61 ;; cc-mode-help@python.org. Please do not send bugs or questions to
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
62 ;; my personal account.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
63
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
64 ;; Many, many thanks go out to all the folks on the beta test list.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
65 ;; Without their patience, testing, insight, code contributions, and
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
66 ;; encouragement CC Mode would be a far inferior package.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
67
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
68 ;; You can get the latest version of CC Mode, including PostScript
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
69 ;; documentation and separate individual files from:
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
70 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
71 ;; http://www.python.org/ftp/emacs/
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
72
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
73 ;; Or if you don't have access to the World Wide Web, through
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
74 ;; anonymous ftp from:
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
75 ;;
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
76 ;; ftp://ftp.python.org/pub/emacs
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
77
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
78 ;;; Code:
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
79
171
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 165
diff changeset
80 (eval-when-compile
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 165
diff changeset
81 (require 'cc-menus))
929b76928fce Import from CVS: tag r20-3b12
cvs
parents: 165
diff changeset
82 (require 'cc-defs)
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
83
183
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 181
diff changeset
84 (defvar c-buffer-is-cc-mode nil
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 181
diff changeset
85 "Non-nil for all buffers with a `major-mode' derived from CC Mode.
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 181
diff changeset
86 Otherwise, this variable is nil. I.e. this variable is non-nil for
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 181
diff changeset
87 `c-mode', `c++-mode', `objc-mode', `java-mode', `idl-mode', and any
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 181
diff changeset
88 other non-CC Mode mode that calls `c-initialize-cc-mode'
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 181
diff changeset
89 \(e.g. `awk-mode').")
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 181
diff changeset
90 (make-variable-buffer-local 'c-buffer-is-cc-mode)
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 181
diff changeset
91 (put 'c-buffer-is-cc-mode 'permanent-local t)
e121b013d1f0 Import from CVS: tag r20-3b18
cvs
parents: 181
diff changeset
92
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
93
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 171
diff changeset
94 ;; Other modes and packages which depend on CC Mode should do the
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 171
diff changeset
95 ;; following to make sure everything is loaded and available for their
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 171
diff changeset
96 ;; use:
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 171
diff changeset
97 ;;
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 171
diff changeset
98 ;; (require 'cc-mode)
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 171
diff changeset
99 ;; (c-initialize-cc-mode)
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 171
diff changeset
100
177
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
101 ;;;###autoload
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 171
diff changeset
102 (defun c-initialize-cc-mode ()
181
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
103 (setq c-buffer-is-cc-mode t)
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
104 ;; sigh. give in to the pressure, but make really sure all the
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
105 ;; definitions we need are here
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
106 (if (or (not (fboundp 'functionp))
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
107 (not (fboundp 'char-before))
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
108 (not (c-safe (char-after) t)))
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
109 (require 'cc-mode-19))
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 171
diff changeset
110 ;; make sure all necessary components of CC Mode are loaded in.
177
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
111 (let ((initprop 'cc-mode-is-initialized))
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
112 (require 'cc-vars)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
113 (require 'cc-engine)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
114 (require 'cc-langs)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
115 (require 'cc-menus)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
116 (require 'cc-align)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
117 (require 'cc-styles)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
118 (require 'cc-cmds)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
119 ;; run the initialization hook, but only once
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
120 (or (get 'c-initialize-cc-mode initprop)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
121 (progn
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
122 (c-initialize-builtin-style)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
123 (run-hooks 'c-initialization-hook)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
124 (put 'c-initialize-cc-mode initprop t)))
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
125 ))
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 171
diff changeset
126
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 171
diff changeset
127
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
128 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
129 (defun c-mode ()
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
130 "Major mode for editing K&R and ANSI C code.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
131 To submit a problem report, enter `\\[c-submit-bug-report]' from a
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
132 c-mode buffer. This automatically sets up a mail buffer with version
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
133 information already added. You just need to add a description of the
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
134 problem, including a reproducible test case and send the message.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
135
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
136 To see what version of CC Mode you are running, enter `\\[c-version]'.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
137
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
138 The hook variable `c-mode-hook' is run with no args, if that value is
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
139 bound and has a non-nil value. Also the hook `c-mode-common-hook' is
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
140 run first.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
141
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
142 Key bindings:
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
143 \\{c-mode-map}"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
144 (interactive)
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 171
diff changeset
145 (c-initialize-cc-mode)
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
146 (kill-all-local-variables)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
147 (set-syntax-table c-mode-syntax-table)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
148 (setq major-mode 'c-mode
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
149 mode-name "C"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
150 local-abbrev-table c-mode-abbrev-table)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
151 (use-local-map c-mode-map)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
152 (c-common-init)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
153 (setq comment-start "/* "
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
154 comment-end " */"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
155 c-conditional-key c-C-conditional-key
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
156 c-class-key c-C-class-key
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
157 c-baseclass-key nil
181
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 177
diff changeset
158 c-comment-start-regexp c-C++-comment-start-regexp
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
159 imenu-generic-expression cc-imenu-c-generic-expression)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
160 (run-hooks 'c-mode-common-hook)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
161 (run-hooks 'c-mode-hook)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
162 (c-update-modeline))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
163
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
164
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
165 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
166 (defun c++-mode ()
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
167 "Major mode for editing C++ code.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
168 To submit a problem report, enter `\\[c-submit-bug-report]' from a
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
169 c++-mode buffer. This automatically sets up a mail buffer with
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
170 version information already added. You just need to add a description
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
171 of the problem, including a reproducible test case, and send the
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
172 message.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
173
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
174 To see what version of CC Mode you are running, enter `\\[c-version]'.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
175
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
176 The hook variable `c++-mode-hook' is run with no args, if that
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
177 variable is bound and has a non-nil value. Also the hook
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
178 `c-mode-common-hook' is run first.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
179
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
180 Key bindings:
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
181 \\{c++-mode-map}"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
182 (interactive)
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 171
diff changeset
183 (c-initialize-cc-mode)
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
184 (kill-all-local-variables)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
185 (set-syntax-table c++-mode-syntax-table)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
186 (setq major-mode 'c++-mode
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
187 mode-name "C++"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
188 local-abbrev-table c++-mode-abbrev-table)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
189 (use-local-map c++-mode-map)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
190 (c-common-init)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
191 (setq comment-start "// "
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
192 comment-end ""
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
193 c-conditional-key c-C++-conditional-key
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
194 c-comment-start-regexp c-C++-comment-start-regexp
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
195 c-class-key c-C++-class-key
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
196 c-access-key c-C++-access-key
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
197 c-recognize-knr-p nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
198 imenu-generic-expression cc-imenu-c++-generic-expression)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
199 (run-hooks 'c-mode-common-hook)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
200 (run-hooks 'c++-mode-hook)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
201 (c-update-modeline))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
202
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
203
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
204 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
205 (defun objc-mode ()
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
206 "Major mode for editing Objective C code.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
207 To submit a problem report, enter `\\[c-submit-bug-report]' from an
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
208 objc-mode buffer. This automatically sets up a mail buffer with
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
209 version information already added. You just need to add a description
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
210 of the problem, including a reproducible test case, and send the
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
211 message.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
212
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
213 To see what version of CC Mode you are running, enter `\\[c-version]'.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
214
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
215 The hook variable `objc-mode-hook' is run with no args, if that value
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
216 is bound and has a non-nil value. Also the hook `c-mode-common-hook'
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
217 is run first.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
218
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
219 Key bindings:
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
220 \\{objc-mode-map}"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
221 (interactive)
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 171
diff changeset
222 (c-initialize-cc-mode)
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
223 (kill-all-local-variables)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
224 (set-syntax-table objc-mode-syntax-table)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
225 (setq major-mode 'objc-mode
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
226 mode-name "ObjC"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
227 local-abbrev-table objc-mode-abbrev-table)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
228 (use-local-map objc-mode-map)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
229 (c-common-init)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
230 (setq comment-start "// "
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
231 comment-end ""
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
232 c-conditional-key c-C-conditional-key
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
233 c-comment-start-regexp c-C++-comment-start-regexp
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
234 c-class-key c-ObjC-class-key
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
235 c-baseclass-key nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
236 c-access-key c-ObjC-access-key
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
237 c-method-key c-ObjC-method-key)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
238 (run-hooks 'c-mode-common-hook)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
239 (run-hooks 'objc-mode-hook)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
240 (c-update-modeline))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
241
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
242
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
243 ;;;###autoload
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
244 (defun java-mode ()
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
245 "Major mode for editing Java code.
187
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 183
diff changeset
246 To submit a problem report, enter `\\[c-submit-bug-report]' from a
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
247 java-mode buffer. This automatically sets up a mail buffer with
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
248 version information already added. You just need to add a description
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
249 of the problem, including a reproducible test case and send the
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
250 message.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
251
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
252 To see what version of CC Mode you are running, enter `\\[c-version]'.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
253
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
254 The hook variable `java-mode-hook' is run with no args, if that value
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
255 is bound and has a non-nil value. Also the common hook
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
256 `c-mode-common-hook' is run first. Note that this mode automatically
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
257 sets the \"java\" style before calling any hooks so be careful if you
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
258 set styles in `c-mode-common-hook'.
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
259
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
260 Key bindings:
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
261 \\{java-mode-map}"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
262 (interactive)
175
2d532a89d707 Import from CVS: tag r20-3b14
cvs
parents: 171
diff changeset
263 (c-initialize-cc-mode)
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
264 (kill-all-local-variables)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
265 (set-syntax-table java-mode-syntax-table)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
266 (setq major-mode 'java-mode
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
267 mode-name "Java"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
268 local-abbrev-table java-mode-abbrev-table)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
269 (use-local-map java-mode-map)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
270 (c-common-init)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
271 (setq comment-start "// "
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
272 comment-end ""
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
273 c-conditional-key c-Java-conditional-key
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
274 c-comment-start-regexp c-Java-comment-start-regexp
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
275 c-class-key c-Java-class-key
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
276 c-method-key c-Java-method-key
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
277 c-baseclass-key nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
278 c-recognize-knr-p nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
279 c-access-key c-Java-access-key
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
280 ;defun-prompt-regexp c-Java-defun-prompt-regexp
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
281 imenu-generic-expression cc-imenu-java-generic-expression
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
282 )
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
283 (c-set-style "java")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
284 (run-hooks 'c-mode-common-hook)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
285 (run-hooks 'java-mode-hook)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
286 (c-update-modeline))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
287
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
288
177
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
289 ;;;###autoload
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
290 (defun idl-mode ()
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
291 "Major mode for editing CORBA's IDL code.
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
292 To submit a problem report, enter `\\[c-submit-bug-report]' from an
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
293 idl-mode buffer. This automatically sets up a mail buffer with
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
294 version information already added. You just need to add a description
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
295 of the problem, including a reproducible test case, and send the
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
296 message.
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
297
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
298 To see what version of CC Mode you are running, enter `\\[c-version]'.
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
299
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
300 The hook variable `idl-mode-hook' is run with no args, if that
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
301 variable is bound and has a non-nil value. Also the hook
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
302 `c-mode-common-hook' is run first.
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
303
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
304 Key bindings:
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
305 \\{idl-mode-map}"
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
306 (interactive)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
307 (c-initialize-cc-mode)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
308 (kill-all-local-variables)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
309 (set-syntax-table idl-mode-syntax-table)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
310 (setq major-mode 'idl-mode
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
311 mode-name "IDL"
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
312 local-abbrev-table idl-mode-abbrev-table)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
313 (use-local-map idl-mode-map)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
314 (c-common-init)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
315 (setq comment-start "// "
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
316 comment-end ""
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
317 c-conditional-key c-C++-conditional-key
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
318 c-comment-start-regexp c-C++-comment-start-regexp
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
319 c-class-key c-C++-class-key
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
320 c-access-key c-C++-access-key
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
321 c-recognize-knr-p nil)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
322 ;; imenu-generic-expression cc-imenu-c++-generic-expression)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
323 (run-hooks 'c-mode-common-hook)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
324 (run-hooks 'idl-mode-hook)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
325 (c-update-modeline))
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
326
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 175
diff changeset
327
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
328 ;; defuns for submitting bug reports
187
b405438285a2 Import from CVS: tag r20-3b20
cvs
parents: 183
diff changeset
329 (defconst c-version "5.17"
165
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
330 "CC Mode version number.")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
331
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
332 (defconst c-mode-help-address
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
333 "bug-gnu-emacs@prep.ai.mit.edu, cc-mode-help@python.org"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
334 "Address for CC Mode bug reports.")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
335
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
336 (defun c-version ()
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
337 "Echo the current version of CC Mode in the minibuffer."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
338 (interactive)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
339 (message "Using CC Mode version %s" c-version)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
340 (c-keep-region-active))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
341
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
342 ;; Get reporter-submit-bug-report when byte-compiling
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
343 (eval-when-compile
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
344 (require 'reporter))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
345
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
346 (defun c-submit-bug-report ()
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
347 "Submit via mail a bug report on CC Mode."
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
348 (interactive)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
349 (require 'cc-vars)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
350 ;; load in reporter
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
351 (let ((reporter-prompt-for-summary-p t)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
352 (reporter-dont-compact-list '(c-offsets-alist))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
353 (style c-indentation-style)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
354 (hook c-special-indent-hook)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
355 (c-features c-emacs-features))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
356 (and
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
357 (if (y-or-n-p "Do you want to submit a report on CC Mode? ")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
358 t (message "") nil)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
359 (require 'reporter)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
360 (reporter-submit-bug-report
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
361 c-mode-help-address
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
362 (concat "CC Mode " c-version " ("
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
363 (cond ((eq major-mode 'c++-mode) "C++")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
364 ((eq major-mode 'c-mode) "C")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
365 ((eq major-mode 'objc-mode) "ObjC")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
366 ((eq major-mode 'java-mode) "Java")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
367 )
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
368 ")")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
369 (let ((vars (list
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
370 ;; report only the vars that affect indentation
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
371 'c-basic-offset
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
372 'c-offsets-alist
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
373 'c-cleanup-list
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
374 'c-comment-only-line-offset
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
375 'c-backslash-column
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
376 'c-delete-function
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
377 'c-electric-pound-behavior
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
378 'c-hanging-braces-alist
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
379 'c-hanging-colons-alist
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
380 'c-hanging-comment-starter-p
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
381 'c-hanging-comment-ender-p
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
382 'c-indent-comments-syntactically-p
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
383 'c-tab-always-indent
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
384 'c-recognize-knr-p
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
385 'c-label-minimum-indentation
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
386 'defun-prompt-regexp
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
387 'tab-width
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
388 )))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
389 (if (not (boundp 'defun-prompt-regexp))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
390 (delq 'defun-prompt-regexp vars)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
391 vars))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
392 (function
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
393 (lambda ()
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
394 (insert
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
395 "Buffer Style: " style "\n\n"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
396 (if hook
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
397 (concat "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
398 "c-special-indent-hook is set to '"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
399 (format "%s" hook)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
400 ".\nPerhaps this is your problem?\n"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
401 "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
402 "\n")
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
403 (format "c-emacs-features: %s\n" c-features)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
404 )))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
405 nil
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
406 "Dear Barry,"
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
407 ))))
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
408
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
409
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
410 (provide 'cc-mode)
5a88923fcbfe Import from CVS: tag r20-3b9
cvs
parents:
diff changeset
411 ;;; cc-mode.el ends here