annotate lisp/progmodes/cc-mode.el @ 19221:d125603385f7

(cyrillic-language-alist): Fix punctuation.
author Richard M. Stallman <rms@gnu.org>
date Fri, 08 Aug 1997 06:40:52 +0000
parents dd7615d21a97
children 2bda7e07f25d
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
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3 ;; Copyright (C) 1985,87,92,93,94,95,96,97 Free Software Foundation, Inc.
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
18847
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
10 ;; Version: 5.13
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 ;; Keywords: c languages oop
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; 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
14 ;; NOTE: See the accompanying texinfo manual for details on using this mode!
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;; This file is part of GNU Emacs.
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 ;; GNU Emacs is free software; you can redistribute it and/or modify
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19 ;; 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
20 ;; the Free Software Foundation; either version 2, or (at your option)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 ;; any later version.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 ;; GNU Emacs is distributed in the hope that it will be useful,
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26 ;; GNU General Public License for more details.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 ;; You should have received a copy of the GNU General Public License
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 ;; 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
30 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 ;; Boston, MA 02111-1307, USA.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 ;;; Commentary:
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 ;; This package provides GNU Emacs major modes for editing C, C++,
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36 ;; Objective-C, and Java code. As of the latest Emacs and XEmacs
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 ;; releases, it is the default package for editing these languages.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 ;; This package is called "CC Mode", and should be spelled exactly
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39 ;; this way. It supports K&R and ANSI C, ANSI C++, Objective-C, and
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40 ;; Java, with a consistent indentation model across all modes. This
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41 ;; indentation model is intuitive and very flexible, so that almost
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42 ;; any desired style of indentation can be supported. Installation,
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
43 ;; usage, and programming details are contained in an accompanying
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44 ;; texinfo manual.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
46 ;; 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
47 ;; cplus-md1.el..
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 ;; NOTE: This mode does not perform font-locking (a.k.a syntactic
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50 ;; coloring, keyword highlighting, etc.) for any of the supported
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51 ;; modes. Typically this is done by a package called font-lock.el
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 ;; which I do *not* maintain. You should contact the Emacs
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53 ;; maintainers for questions about coloring or highlighting in any
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 ;; language mode.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56 ;; 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
57 ;; 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
58 ;; 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
59 ;; Usenet newsgroup gnu.emacs.bug). Questions can sent to
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 ;; 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
61 ;; 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
62 ;; my personal account.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 ;; YOU CAN IGNORE ALL BYTE-COMPILER WARNINGS. They are the result of
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 ;; the cross-Emacsen support. GNU Emacs 19 (from the FSF), GNU XEmacs
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 ;; 19 (formerly Lucid Emacs), and GNU Emacs 18 all do things
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67 ;; differently and there's no way to shut the byte-compiler up at the
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 ;; necessary granularity. Let me say this again: YOU CAN IGNORE ALL
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 ;; BYTE-COMPILER WARNINGS (you'd be surprised at how many people don't
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 ;; follow this advice :-).
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 ;; 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
73 ;; Without their patience, testing, insight, code contributions, and
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74 ;; encouragement CC Mode would be a far inferior package.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76 ;; You can get the latest version of CC Mode, including PostScript
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 ;; documentation and separate individual files from:
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78 ;;
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 ;; http://www.python.org/ftp/emacs/
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 ;; 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
82 ;; anonymous ftp from:
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 ;;
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 ;; ftp://ftp.python.org/pub/emacs
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 ;;; Code:
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 (eval-when-compile
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 (require 'cc-menus))
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 (require 'cc-defs)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92
18847
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
93 ;; 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
94 ;; 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
95 ;; use:
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
96 ;;
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
97 ;; (require 'cc-mode)
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
98 ;; (c-initialize-cc-mode)
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
99
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
100 (defun c-initialize-cc-mode ()
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
101 ;; make sure all necessary components of CC Mode are loaded in.
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
102 (require 'cc-vars)
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
103 (require 'cc-engine)
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
104 (require 'cc-langs)
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
105 (require 'cc-menus)
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
106 (require 'cc-align)
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
107 (require 'cc-styles)
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
108 (require 'cc-cmds))
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
109
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
110
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
111
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112 ;;;###autoload
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113 (defun c-mode ()
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114 "Major mode for editing K&R and ANSI C code.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 To submit a problem report, enter `\\[c-submit-bug-report]' from a
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
116 c-mode buffer. This automatically sets up a mail buffer with version
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
117 information already added. You just need to add a description of the
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 problem, including a reproducible test case and send the message.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120 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
121
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122 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
123 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
124 run first.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 Key bindings:
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 \\{c-mode-map}"
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
128 (interactive)
18847
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
129 (c-initialize-cc-mode)
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130 (kill-all-local-variables)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 (set-syntax-table c-mode-syntax-table)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132 (setq major-mode 'c-mode
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133 mode-name "C"
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 local-abbrev-table c-mode-abbrev-table)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 (use-local-map c-mode-map)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136 (c-common-init)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137 (setq comment-start "/* "
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 comment-end " */"
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139 comment-multi-line t
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
140 c-conditional-key c-C-conditional-key
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141 c-class-key c-C-class-key
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142 c-baseclass-key nil
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143 c-comment-start-regexp c-C-comment-start-regexp
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144 imenu-generic-expression cc-imenu-c-generic-expression)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
145 (run-hooks 'c-mode-common-hook)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146 (run-hooks 'c-mode-hook)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147 (c-update-modeline))
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
148
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
149
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150 ;;;###autoload
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
151 (defun c++-mode ()
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
152 "Major mode for editing C++ code.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153 To submit a problem report, enter `\\[c-submit-bug-report]' from a
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
154 c++-mode buffer. This automatically sets up a mail buffer with
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
155 version information already added. You just need to add a description
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
156 of the problem, including a reproducible test case, and send the
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 message.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159 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
160
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161 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
162 variable is bound and has a non-nil value. Also the hook
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 `c-mode-common-hook' is run first.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165 Key bindings:
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 \\{c++-mode-map}"
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 (interactive)
18847
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
168 (c-initialize-cc-mode)
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 (kill-all-local-variables)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170 (set-syntax-table c++-mode-syntax-table)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
171 (setq major-mode 'c++-mode
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172 mode-name "C++"
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
173 local-abbrev-table c++-mode-abbrev-table)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
174 (use-local-map c++-mode-map)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
175 (c-common-init)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
176 (setq comment-start "// "
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
177 comment-end ""
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
178 comment-multi-line nil
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
179 c-conditional-key c-C++-conditional-key
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
180 c-comment-start-regexp c-C++-comment-start-regexp
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
181 c-class-key c-C++-class-key
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
182 c-access-key c-C++-access-key
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
183 c-double-slash-is-comments-p t
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184 c-recognize-knr-p nil
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
185 imenu-generic-expression cc-imenu-c++-generic-expression)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186 (run-hooks 'c-mode-common-hook)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
187 (run-hooks 'c++-mode-hook)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
188 (c-update-modeline))
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191 ;;;###autoload
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
192 (defun objc-mode ()
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
193 "Major mode for editing Objective C code.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
194 To submit a problem report, enter `\\[c-submit-bug-report]' from an
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195 objc-mode buffer. This automatically sets up a mail buffer with
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
196 version information already added. You just need to add a description
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
197 of the problem, including a reproducible test case, and send the
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
198 message.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
199
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
200 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
201
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
202 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
203 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
204 is run first.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
205
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206 Key bindings:
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 \\{objc-mode-map}"
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
208 (interactive)
18847
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
209 (c-initialize-cc-mode)
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210 (kill-all-local-variables)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211 (set-syntax-table objc-mode-syntax-table)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212 (setq major-mode 'objc-mode
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213 mode-name "ObjC"
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 local-abbrev-table objc-mode-abbrev-table)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
215 (use-local-map objc-mode-map)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
216 (c-common-init)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217 (setq comment-start "// "
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
218 comment-end ""
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 comment-multi-line nil
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220 c-conditional-key c-C-conditional-key
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221 c-comment-start-regexp c-C++-comment-start-regexp
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
222 c-class-key c-ObjC-class-key
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
223 c-baseclass-key nil
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
224 c-access-key c-ObjC-access-key
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
225 c-double-slash-is-comments-p t
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
226 c-method-key c-ObjC-method-key)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
227 (run-hooks 'c-mode-common-hook)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
228 (run-hooks 'objc-mode-hook)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
229 (c-update-modeline))
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
230
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
231
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
232 ;;;###autoload
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
233 (defun java-mode ()
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
234 "Major mode for editing Java code.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
235 To submit a problem report, enter `\\[c-submit-bug-report]' from an
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
236 java-mode buffer. This automatically sets up a mail buffer with
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
237 version information already added. You just need to add a description
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
238 of the problem, including a reproducible test case and send the
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
239 message.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
240
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
241 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
242
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 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
244 is bound and has a non-nil value. Also the common hook
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
245 `c-mode-common-hook' is run first. Note that this mode automatically
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246 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
247 set styles in `c-mode-common-hook'.
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
248
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
249 Key bindings:
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
250 \\{java-mode-map}"
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
251 (interactive)
18847
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
252 (c-initialize-cc-mode)
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253 (kill-all-local-variables)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
254 (set-syntax-table java-mode-syntax-table)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
255 (setq major-mode 'java-mode
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
256 mode-name "Java"
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
257 local-abbrev-table java-mode-abbrev-table)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
258 (use-local-map java-mode-map)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
259 (c-common-init)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
260 (setq comment-start "// "
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
261 comment-end ""
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
262 comment-multi-line nil
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
263 c-conditional-key c-Java-conditional-key
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
264 c-comment-start-regexp c-Java-comment-start-regexp
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
265 c-class-key c-Java-class-key
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
266 c-method-key c-Java-method-key
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
267 c-double-slash-is-comments-p t
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
268 c-baseclass-key nil
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
269 c-recognize-knr-p nil
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
270 c-access-key c-Java-access-key
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
271 ;defun-prompt-regexp c-Java-defun-prompt-regexp
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
272 imenu-generic-expression cc-imenu-java-generic-expression
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
273 )
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
274 (c-set-style "java")
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
275 (run-hooks 'c-mode-common-hook)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
276 (run-hooks 'java-mode-hook)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
277 (c-update-modeline))
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
278
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
279
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
280 ;; defuns for submitting bug reports
18847
dd7615d21a97 (c-initialize-cc-mode): New function.
Richard M. Stallman <rms@gnu.org>
parents: 18720
diff changeset
281 (defconst c-version "5.13"
18720
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
282 "CC Mode version number.")
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
283
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
284 (defconst c-mode-help-address
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
285 "bug-gnu-emacs@prep.ai.mit.edu, cc-mode-help@python.org"
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
286 "Address for CC Mode bug reports.")
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
287
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
288 (defun c-version ()
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
289 "Echo the current version of CC Mode in the minibuffer."
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
290 (interactive)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
291 (message "Using CC Mode version %s" c-version)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
292 (c-keep-region-active))
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
293
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
294 ;; Get reporter-submit-bug-report when byte-compiling
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
295 (eval-when-compile
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
296 (require 'reporter))
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
297
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
298 (defun c-submit-bug-report ()
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
299 "Submit via mail a bug report on CC Mode."
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
300 (interactive)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
301 (require 'cc-vars)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
302 ;; load in reporter
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
303 (let ((reporter-prompt-for-summary-p t)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
304 (reporter-dont-compact-list '(c-offsets-alist))
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
305 (style c-indentation-style)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
306 (hook c-special-indent-hook)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
307 (c-features c-emacs-features))
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
308 (and
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
309 (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
310 t (message "") nil)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
311 (require 'reporter)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
312 (reporter-submit-bug-report
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
313 c-mode-help-address
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
314 (concat "CC Mode " c-version " ("
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
315 (cond ((eq major-mode 'c++-mode) "C++")
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
316 ((eq major-mode 'c-mode) "C")
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
317 ((eq major-mode 'objc-mode) "ObjC")
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
318 ((eq major-mode 'java-mode) "Java")
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
319 )
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
320 ")")
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
321 (let ((vars (list
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
322 ;; report only the vars that affect indentation
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
323 'c-basic-offset
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
324 'c-offsets-alist
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
325 'c-cleanup-list
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
326 'c-comment-only-line-offset
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
327 'c-backslash-column
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
328 'c-delete-function
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
329 'c-electric-pound-behavior
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
330 'c-hanging-braces-alist
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
331 'c-hanging-colons-alist
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
332 'c-hanging-comment-starter-p
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
333 'c-hanging-comment-ender-p
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
334 'c-indent-comments-syntactically-p
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
335 'c-tab-always-indent
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
336 'c-recognize-knr-p
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
337 'c-label-minimum-indentation
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
338 'defun-prompt-regexp
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
339 'tab-width
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
340 )))
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
341 (if (not (boundp 'defun-prompt-regexp))
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
342 (delq 'defun-prompt-regexp vars)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
343 vars))
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
344 (function
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
345 (lambda ()
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
346 (insert
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
347 "Buffer Style: " style "\n\n"
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
348 (if hook
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
349 (concat "\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
350 "c-special-indent-hook is set to '"
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
351 (format "%s" hook)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
352 ".\nPerhaps this is your problem?\n"
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
353 "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n")
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
354 "\n")
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
355 (format "c-emacs-features: %s\n" c-features)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
356 )))
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
357 nil
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
358 "Dear Barry,"
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
359 ))))
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
360
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
361
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
362 (provide 'cc-mode)
fc6d08b9bbe2 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
363 ;;; cc-mode.el ends here