annotate lisp/progmodes/cc-mode.el @ 23276:912ae6c6787d

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