Mercurial > emacs
annotate lisp/progmodes/cc-vars.el @ 50739:fbec4e6f73c8
(ada-stmt-add-to-ada-menu): Moved to ada-mode.el.
(ada-template-map): Merged with the keymap handling in ada-mode.el.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Tue, 29 Apr 2003 23:44:43 +0000 |
parents | 252629d76098 |
children | bc91cbf50c24 |
rev | line source |
---|---|
18720 | 1 ;;; cc-vars.el --- user customization variables for CC Mode |
2 | |
36920 | 3 ;; Copyright (C) 1985,1987,1992-2001 Free Software Foundation, Inc. |
18720 | 4 |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
5 ;; Authors: 2000- Martin Stjernholm |
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
6 ;; 1998-1999 Barry A. Warsaw and Martin Stjernholm |
24282 | 7 ;; 1992-1997 Barry A. Warsaw |
18720 | 8 ;; 1987 Dave Detlefs and Stewart Clamen |
9 ;; 1985 Richard M. Stallman | |
24282 | 10 ;; Maintainer: bug-cc-mode@gnu.org |
18720 | 11 ;; Created: 22-Apr-1997 (split from cc-mode.el) |
20144
56d81cc7b4f5
(c-progress-interval): Document new semantics
Karl Heuer <kwzh@gnu.org>
parents:
20140
diff
changeset
|
12 ;; Version: See cc-mode.el |
18720 | 13 ;; Keywords: c languages oop |
14 | |
15 ;; This file is part of GNU Emacs. | |
16 | |
17 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
18 ;; it under the terms of the GNU General Public License as published by | |
19 ;; the Free Software Foundation; either version 2, or (at your option) | |
20 ;; any later version. | |
21 | |
22 ;; GNU Emacs is distributed in the hope that it will be useful, | |
23 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
24 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
25 ;; GNU General Public License for more details. | |
26 | |
27 ;; You should have received a copy of the GNU General Public License | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
28 ;; along with GNU Emacs; see the file COPYING. If not, write to |
36920 | 29 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18720 | 30 ;; Boston, MA 02111-1307, USA. |
31 | |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36920
diff
changeset
|
32 ;;; Commentary: |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36920
diff
changeset
|
33 |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36920
diff
changeset
|
34 ;;; Code: |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36920
diff
changeset
|
35 |
24282 | 36 (eval-when-compile |
26817 | 37 (let ((load-path |
36920 | 38 (if (and (boundp 'byte-compile-dest-file) |
39 (stringp byte-compile-dest-file)) | |
40 (cons (file-name-directory byte-compile-dest-file) load-path) | |
26817 | 41 load-path))) |
36920 | 42 (require 'cc-bytecomp))) |
43 | |
44 (cc-require 'cc-defs) | |
45 | |
46 ;; Silence the compiler. | |
47 (cc-bytecomp-defun get-char-table) ; XEmacs 20+ | |
48 (cc-bytecomp-defun char-table-range) ; Emacs 19+ | |
48398 | 49 (cc-bytecomp-defun char-table-p) ; Emacs 19+, XEmacs 20+ |
24282 | 50 |
36920 | 51 ;; Pull in custom if it exists and is recent enough (the one in Emacs |
52 ;; 19.34 isn't). | |
48656
546d8af61357
Simply require wid-edit and custom in eval-when-compile.
Richard M. Stallman <rms@gnu.org>
parents:
48398
diff
changeset
|
53 (eval-when-compile |
546d8af61357
Simply require wid-edit and custom in eval-when-compile.
Richard M. Stallman <rms@gnu.org>
parents:
48398
diff
changeset
|
54 (require 'custom) |
546d8af61357
Simply require wid-edit and custom in eval-when-compile.
Richard M. Stallman <rms@gnu.org>
parents:
48398
diff
changeset
|
55 (require 'wid-edit)) |
18720 | 56 |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
57 (cc-eval-when-compile |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
58 ;; Need the function form of `backquote', which isn't standardized |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
59 ;; between Emacsen. It's called `bq-process' in XEmacs, and |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
60 ;; `backquote-process' in Emacs. `backquote-process' returns a |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
61 ;; slightly more convoluted form, so let `bq-process' be the norm. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
62 (if (fboundp 'backquote-process) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
63 (cc-bytecomp-defmacro bq-process (form) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
64 `(cdr (backquote-process ,form))))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
65 |
18720 | 66 |
26817 | 67 ;;; Helpers |
18720 | 68 |
24282 | 69 ;; This widget will show up in newer versions of the Custom library |
70 (or (get 'other 'widget-type) | |
71 (define-widget 'other 'sexp | |
72 "Matches everything, but doesn't let the user edit the value. | |
73 Useful as last item in a `choice' widget." | |
74 :tag "Other" | |
75 :format "%t%n" | |
76 :value 'other)) | |
77 | |
26817 | 78 (define-widget 'c-const-symbol 'item |
79 "An uneditable lisp symbol." | |
80 :value nil | |
81 :tag "Symbol" | |
82 :format "%t: %v\n%d" | |
83 :match (lambda (widget value) (symbolp value)) | |
84 :value-to-internal | |
85 (lambda (widget value) | |
86 (let ((s (if (symbolp value) | |
87 (symbol-name value) | |
88 value)) | |
89 (l (widget-get widget :size))) | |
90 (if l | |
91 (setq s (concat s (make-string (- l (length s)) ?\ )))) | |
92 s)) | |
93 :value-to-external | |
94 (lambda (widget value) | |
95 (if (stringp value) | |
96 (intern (progn | |
97 (string-match "\\`[^ ]*" value) | |
98 (match-string 0 value))) | |
99 value))) | |
100 | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
101 (define-widget 'c-integer-or-nil 'sexp |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
102 "An integer or the value nil." |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
103 :value nil |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
104 :tag "Optional integer" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
105 :match (lambda (widget value) (or (integerp value) (null value)))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
106 |
26817 | 107 (defvar c-style-variables |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
108 '(c-basic-offset c-comment-only-line-offset c-indent-comment-alist |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
109 c-indent-comments-syntactically-p c-block-comment-prefix |
26817 | 110 c-comment-prefix-regexp c-cleanup-list c-hanging-braces-alist |
111 c-hanging-colons-alist c-hanging-semi&comma-criteria c-backslash-column | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
112 c-backslash-max-column c-special-indent-hook c-label-minimum-indentation |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
113 c-offsets-alist) |
26817 | 114 "List of the style variables.") |
115 | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
116 (defvar c-fallback-style nil) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
117 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
118 (defsubst c-set-stylevar-fallback (name val) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
119 (put name 'c-stylevar-fallback val) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
120 (setq c-fallback-style (cons (cons name val) c-fallback-style))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
121 |
26817 | 122 (defmacro defcustom-c-stylevar (name val doc &rest args) |
123 "Defines a style variable." | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
124 `(let ((-value- ,val)) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
125 (c-set-stylevar-fallback ',name -value-) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
126 (custom-declare-variable |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
127 ',name ''set-from-style |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
128 ,(concat doc " |
26817 | 129 |
130 This is a style variable. Apart from the valid values described | |
131 above, it can be set to the symbol `set-from-style'. In that case, it | |
132 takes its value from the style system (see `c-default-style' and | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
133 `c-style-alist') when a CC Mode buffer is initialized. Otherwise, |
26817 | 134 the value set here overrides the style system (there is a variable |
135 `c-old-style-variable-behavior' that changes this, though).") | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
136 ,@(plist-put |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
137 args ':type |
49857
252629d76098
Revert last change.
Juanma Barranquero <lekktu@gmail.com>
parents:
49853
diff
changeset
|
138 `(` (radio |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
139 (const :tag "Use style settings" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
140 set-from-style) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
141 ,(, (let ((type (eval (plist-get args ':type)))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
142 (unless (consp type) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
143 (setq type (list type))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
144 (unless (c-safe (plist-get (cdr type) ':value)) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
145 (setcdr type (append '(:value (, -value-)) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
146 (cdr type)))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
147 (unless (c-safe (plist-get (cdr type) ':tag)) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
148 (setcdr type (append '(:tag "Override style settings") |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
149 (cdr type)))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
150 (bq-process type))))))))) |
26817 | 151 |
152 (defun c-valid-offset (offset) | |
153 "Return non-nil iff OFFSET is a valid offset for a syntactic symbol. | |
154 See `c-offsets-alist'." | |
155 (or (eq offset '+) | |
156 (eq offset '-) | |
157 (eq offset '++) | |
158 (eq offset '--) | |
159 (eq offset '*) | |
160 (eq offset '/) | |
161 (integerp offset) | |
162 (functionp offset) | |
163 (and (symbolp offset) | |
164 (or (boundp offset) | |
165 (fboundp offset))) | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
166 (and (vectorp offset) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
167 (= (length offset) 1) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
168 (integerp (elt offset 0))) |
26817 | 169 (progn |
170 (while (and (consp offset) | |
171 (c-valid-offset (car offset))) | |
172 (setq offset (cdr offset))) | |
173 (null offset)))) | |
174 | |
175 | |
176 | |
177 ;;; User variables | |
178 | |
179 (defcustom c-strict-syntax-p nil | |
180 "*If non-nil, all syntactic symbols must be found in `c-offsets-alist'. | |
181 If the syntactic symbol for a particular line does not match a symbol | |
182 in the offsets alist, or if no non-nil offset value can be determined | |
183 for a symbol, an error is generated, otherwise no error is reported | |
184 and the syntactic symbol is ignored. | |
185 | |
186 This variable is considered obsolete; it doesn't work well with lineup | |
187 functions that return nil to support the feature of using lists on | |
188 syntactic symbols in `c-offsets-alist'. Please keep it set to nil." | |
189 :type 'boolean | |
190 :group 'c) | |
191 | |
192 (defcustom c-echo-syntactic-information-p nil | |
193 "*If non-nil, syntactic info is echoed when the line is indented." | |
194 :type 'boolean | |
195 :group 'c) | |
196 | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
197 (defcustom c-report-syntactic-errors nil |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
198 "*If non-nil, certain syntactic errors are reported with a ding |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
199 and a message, for example when an \"else\" is indented for which |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
200 there's no corresponding \"if\". |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
201 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
202 Note however that CC Mode doesn't make any special effort to check for |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
203 syntactic errors; that's the job of the compiler. The reason it can |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
204 report cases like the one above is that it can't find the correct |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
205 anchoring position to indent the line in that case." |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
206 :type 'boolean |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
207 :group 'c) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
208 |
26817 | 209 (defcustom-c-stylevar c-basic-offset 4 |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
210 "*Amount of basic offset used by + and - symbols in `c-offsets-alist'. |
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
211 Also used as the indentation step when `c-syntactic-indentation' is |
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
212 nil." |
26817 | 213 :type 'integer |
214 :group 'c) | |
215 | |
18720 | 216 (defcustom c-tab-always-indent t |
217 "*Controls the operation of the TAB key. | |
218 If t, hitting TAB always just indents the current line. If nil, | |
219 hitting TAB indents the current line if point is at the left margin or | |
220 in the line's indentation, otherwise it insert a `real' tab character | |
24282 | 221 \(see note\). If the symbol `other', then tab is inserted only within |
222 literals -- defined as comments and strings -- and inside preprocessor | |
223 directives, but the line is always reindented. | |
18720 | 224 |
225 Note: The value of `indent-tabs-mode' will determine whether a real | |
26817 | 226 tab character will be inserted, or the equivalent number of spaces. |
18720 | 227 When inserting a tab, actually the function stored in the variable |
228 `c-insert-tab-function' is called. | |
229 | |
230 Note: indentation of lines containing only comments is also controlled | |
231 by the `c-comment-only-line-offset' variable." | |
232 :type '(radio | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
233 (const :tag "TAB key always indents, never inserts TAB" t) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
234 (const :tag "TAB key indents in left margin, otherwise inserts TAB" nil) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
235 (other :tag "TAB key inserts TAB in literals, otherwise indents" other)) |
18720 | 236 :group 'c) |
237 | |
238 (defcustom c-insert-tab-function 'insert-tab | |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
239 "*Function used when inserting a tab for \\[c-indent-command]. |
18720 | 240 Only used when `c-tab-always-indent' indicates a `real' tab character |
241 should be inserted. Value must be a function taking no arguments." | |
242 :type 'function | |
243 :group 'c) | |
244 | |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
245 (defcustom c-syntactic-indentation t |
36920 | 246 "*Whether the indentation should be controlled by the syntactic context. |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
247 |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
248 If t, the indentation functions indent according to the syntactic |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
249 context, using the style settings specified by `c-offsets-alist'. |
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
250 |
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
251 If nil, every line is just indented to the same level as the previous |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
252 one, and the \\[c-indent-command] command adjusts the indentation in |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
253 steps specified by `c-basic-offset'. The indentation style has no |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
254 effect in this mode, nor any of the indentation associated variables, |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
255 e.g. `c-special-indent-hook'." |
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
256 :type 'boolean |
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
257 :group 'c) |
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
258 |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
259 (defcustom c-syntactic-indentation-in-macros t |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
260 "*Enable syntactic analysis inside macros. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
261 If this is nil, all lines inside macro definitions are analyzed as |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
262 `cpp-macro-cont'. Otherwise they are analyzed syntactically, just |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
263 like normal code, and `cpp-define-intro' is used to create the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
264 additional indentation of the bodies of \"#define\" macros. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
265 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
266 Having this enabled simplifies editing of large multiline macros, but |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
267 it might complicate editing if CC Mode doesn't recognize the context |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
268 of the macro content. The default context inside the macro is the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
269 same as the top level, so if it contains \"bare\" statements they |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
270 might be indented wrongly, although there are special cases that |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
271 handles this in most cases. If this problem occurs, it's usually |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
272 countered easily by surrounding the statements by a block \(or even |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
273 better with the \"do { ... } while \(0)\" trick)." |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
274 :type 'boolean |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
275 :group 'c) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
276 |
26817 | 277 (defcustom-c-stylevar c-comment-only-line-offset 0 |
18720 | 278 "*Extra offset for line which contains only the start of a comment. |
279 Can contain an integer or a cons cell of the form: | |
280 | |
281 (NON-ANCHORED-OFFSET . ANCHORED-OFFSET) | |
282 | |
283 Where NON-ANCHORED-OFFSET is the amount of offset given to | |
284 non-column-zero anchored comment-only lines, and ANCHORED-OFFSET is | |
285 the amount of offset to give column-zero anchored comment-only lines. | |
26817 | 286 Just an integer as value is equivalent to (<val> . -1000). |
287 | |
288 Note that this variable only has effect when the `c-lineup-comment' | |
289 lineup function is used on the `comment-intro' syntactic symbol (the | |
290 default)." | |
291 :type '(choice (integer :tag "Non-anchored offset" 0) | |
18720 | 292 (cons :tag "Non-anchored & anchored offset" |
293 :value (0 . 0) | |
294 (integer :tag "Non-anchored offset") | |
295 (integer :tag "Anchored offset"))) | |
296 :group 'c) | |
297 | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
298 (defcustom-c-stylevar c-indent-comment-alist |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
299 '((anchored-comment . (column . 0)) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
300 (end-block . (space . 1)) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
301 (cpp-end-block . (space . 2))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
302 "*Specifies how \\[indent-for-comment] calculates the comment start column. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
303 This is an association list that contains entries of the form: |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
304 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
305 (LINE-TYPE . INDENT-SPEC) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
306 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
307 LINE-TYPE specifies a type of line as described below, and INDENT-SPEC |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
308 says what \\[indent-for-comment] should do when used on that type of line. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
309 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
310 The recognized values for LINE-TYPE are: |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
311 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
312 empty-line -- The line is empty. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
313 anchored-comment -- The line contains a comment that starts in column 0. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
314 end-block -- The line contains a solitary block closing brace. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
315 cpp-end-block -- The line contains a preprocessor directive that |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
316 closes a block, i.e. either \"#endif\" or \"#else\". |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
317 other -- The line does not match any other entry |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
318 currently on the list. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
319 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
320 An INDENT-SPEC is a cons cell of the form: |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
321 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
322 (ACTION . VALUE) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
323 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
324 ACTION says how \\[indent-for-comment] should align the comment, and |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
325 VALUE is interpreted depending on ACTION. ACTION can be any of the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
326 following: |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
327 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
328 space -- Put VALUE spaces between the end of the line and the start |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
329 of the comment. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
330 column -- Start the comment at the column VALUE. If the line is |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
331 longer than that, the comment is preceded by a single |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
332 space. If VALUE is nil, `comment-column' is used. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
333 align -- Align the comment with one on the previous line, if there |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
334 is any. If the line is too long, the comment is preceded |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
335 by a single space. If there isn't a comment start on the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
336 previous line, the behavior is specified by VALUE, which |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
337 in turn is interpreted as an INDENT-SPEC. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
338 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
339 If a LINE-TYPE is missing, then \\[indent-for-comment] indents the comment |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
340 according to `comment-column'. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
341 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
342 Note that a non-nil value on `c-indent-comments-syntactically-p' |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
343 overrides this variable, so empty lines are indentented syntactically |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
344 in that case, i.e. as if \\[c-indent-command] was used instead." |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
345 :type |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
346 (let ((space '(cons :tag "space" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
347 :format "%v" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
348 :value (space . 1) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
349 (const :format "space " space) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
350 (integer :format "%v"))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
351 (column '(cons :tag "column" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
352 :format "%v" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
353 (const :format "column " column) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
354 (c-integer-or-nil :format "%v")))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
355 `(set ,@(mapcar |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
356 (lambda (elt) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
357 `(cons :format "%v" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
358 (c-const-symbol :format "%v: " |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
359 :size 20 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
360 :value ,elt) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
361 (choice |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
362 :format "%[Choice%] %v" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
363 :value (column . nil) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
364 ,space |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
365 ,column |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
366 (cons :tag "align" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
367 :format "%v" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
368 (const :format "align " align) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
369 (choice |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
370 :format "%[Choice%] %v" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
371 :value (column . nil) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
372 ,space |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
373 ,column))))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
374 '(empty-line anchored-comment end-block cpp-end-block other)))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
375 :group 'c) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
376 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
377 (defcustom-c-stylevar c-indent-comments-syntactically-p nil |
26817 | 378 "*Specifies how \\[indent-for-comment] should handle comment-only lines. |
18720 | 379 When this variable is non-nil, comment-only lines are indented |
26817 | 380 according to syntactic analysis via `c-offsets-alist'. Otherwise, the |
381 comment is indented as if it was preceded by code. Note that this | |
382 variable does not affect how the normal line indentation treats | |
383 comment-only lines." | |
18720 | 384 :type 'boolean |
385 :group 'c) | |
386 | |
36920 | 387 (make-obsolete-variable 'c-comment-continuation-stars |
388 'c-block-comment-prefix) | |
389 | |
390 ;; Although c-comment-continuation-stars is obsolete, we look at it in | |
391 ;; some places in CC Mode anyway, so make the compiler ignore it | |
392 ;; during our compilation. | |
393 (cc-bytecomp-obsolete-var c-comment-continuation-stars) | |
394 (cc-bytecomp-defvar c-comment-continuation-stars) | |
395 | |
26817 | 396 (defcustom-c-stylevar c-block-comment-prefix |
397 (if (boundp 'c-comment-continuation-stars) | |
398 c-comment-continuation-stars | |
399 "* ") | |
400 "*Specifies the line prefix of continued C-style block comments. | |
19298
4a99e63dc4a9
(c-buffer-is-cc-mode): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19255
diff
changeset
|
401 You should set this variable to the literal string that gets inserted |
4a99e63dc4a9
(c-buffer-is-cc-mode): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19255
diff
changeset
|
402 at the front of continued block style comment lines. This should |
26817 | 403 either be the empty string, or some characters without preceding |
404 spaces. To adjust the alignment under the comment starter, put an | |
405 appropriate value on the `c' syntactic symbol (see the | |
406 `c-offsets-alist' variable). | |
407 | |
408 It's only used when a one-line block comment is broken into two or | |
409 more lines for the first time; otherwise the appropriate prefix is | |
410 adapted from the comment. This variable is not used for C++ line | |
411 style comments." | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
412 :type 'string |
19298
4a99e63dc4a9
(c-buffer-is-cc-mode): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19255
diff
changeset
|
413 :group 'c) |
4a99e63dc4a9
(c-buffer-is-cc-mode): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19255
diff
changeset
|
414 |
36920 | 415 (defcustom-c-stylevar c-comment-prefix-regexp |
416 '((pike-mode . "//+!?\\|\\**") | |
417 (other . "//+\\|\\**")) | |
26817 | 418 "*Regexp to match the line prefix inside comments. |
419 This regexp is used to recognize the fill prefix inside comments for | |
420 correct paragraph filling and other things. | |
421 | |
36920 | 422 If this variable is a string, it will be used in all CC Mode major |
423 modes. It can also be an association list, to associate specific | |
424 regexps to specific major modes. The symbol for the major mode is | |
425 looked up in the association list, and its value is used as the line | |
426 prefix regexp. If it's not found, then the symbol `other' is looked | |
427 up and its value is used instead. | |
428 | |
429 The regexp should match the prefix used in both C++ style line | |
430 comments and C style block comments, but it does not need to match a | |
431 block comment starter. In other words, it should at least match | |
432 \"//\" for line comments and the string in `c-block-comment-prefix', | |
433 which is sometimes inserted by CC Mode inside block comments. It | |
434 should not match any surrounding whitespace. | |
26817 | 435 |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
436 Note that CC Mode uses this variable to set many other variables that |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
437 handles the paragraph filling. That's done at mode initialization or |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
438 when you switch to a style which sets this variable. Thus, if you |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
439 change it in some other way, e.g. interactively in a CC Mode buffer, |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
440 you will need to do \\[c-mode] (or whatever mode you're currently |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
441 using) to reinitialize. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
442 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
443 Note also that when CC Mode starts up, the other variables are |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
444 modified before the mode hooks are run. If you change this variable |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
445 in a mode hook, you can call `c-setup-paragraph-variables' afterwards |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
446 to redo it." |
36920 | 447 :type '(radio |
448 (regexp :tag "Regexp for all modes") | |
449 (list | |
450 :tag "Mode-specific regexps" | |
451 (set | |
452 :inline t :format "%v" | |
453 (cons :format "%v" | |
454 (const :format "C " c-mode) (regexp :format "%v")) | |
455 (cons :format "%v" | |
456 (const :format "C++ " c++-mode) (regexp :format "%v")) | |
457 (cons :format "%v" | |
458 (const :format "ObjC " objc-mode) (regexp :format "%v")) | |
459 (cons :format "%v" | |
460 (const :format "Java " java-mode) (regexp :format "%v")) | |
461 (cons :format "%v" | |
462 (const :format "IDL " idl-mode) (regexp :format "%v")) | |
463 (cons :format "%v" | |
464 (const :format "Pike " pike-mode) (regexp :format "%v"))) | |
465 (cons :format " %v" | |
466 (const :format "Other " other) (regexp :format "%v")))) | |
26817 | 467 :group 'c) |
468 | |
469 (defcustom c-ignore-auto-fill '(string cpp code) | |
470 "*List of contexts in which automatic filling never occurs. | |
471 If Auto Fill mode is active, it will be temporarily disabled if point | |
472 is in any context on this list. It's e.g. useful to enable Auto Fill | |
473 in comments only, but not in strings or normal code. The valid | |
474 contexts are: | |
475 | |
476 string -- inside a string or character literal | |
477 c -- inside a C style block comment | |
478 c++ -- inside a C++ style line comment | |
479 cpp -- inside a preprocessor directive | |
480 code -- anywhere else, i.e. in normal code" | |
481 :type '(set | |
482 (const :tag "String literals" string) | |
483 (const :tag "C style block comments" c) | |
484 (const :tag "C++ style line comments" c++) | |
485 (const :tag "Preprocessor directives" cpp) | |
486 (const :tag "Normal code" code)) | |
487 :group 'c) | |
488 | |
489 (defcustom-c-stylevar c-cleanup-list '(scope-operator) | |
18720 | 490 "*List of various C/C++/ObjC constructs to \"clean up\". |
36920 | 491 The following clean ups only take place when the auto-newline feature |
492 is turned on, as evidenced by the `/a' or `/ah' appearing next to the | |
493 mode name: | |
18720 | 494 |
36920 | 495 brace-else-brace -- Clean up \"} else {\" constructs by placing |
496 entire construct on a single line. This clean | |
497 up only takes place when there is nothing but | |
18720 | 498 white space between the braces and the `else'. |
26817 | 499 Clean up occurs when the open brace after the |
18720 | 500 `else' is typed. |
36920 | 501 brace-elseif-brace -- Similar to brace-else-brace, but clean up |
502 \"} else if (...) {\" constructs. Clean up | |
503 occurs after the open parenthesis and the open | |
504 brace. | |
505 brace-catch-brace -- Similar to brace-elseif-brace, but clean up | |
506 \"} catch (...) {\" constructs. | |
507 empty-defun-braces -- Clean up empty defun braces by placing the | |
18720 | 508 braces on the same line. Clean up occurs when |
509 the defun closing brace is typed. | |
36920 | 510 defun-close-semi -- Clean up the terminating semi-colon on defuns |
18720 | 511 by placing the semi-colon on the same line as |
512 the closing brace. Clean up occurs when the | |
513 semi-colon is typed. | |
36920 | 514 list-close-comma -- Clean up commas following braces in array |
18720 | 515 and aggregate initializers. Clean up occurs |
516 when the comma is typed. | |
36920 | 517 scope-operator -- Clean up double colons which may designate |
18720 | 518 a C++ scope operator split across multiple |
36920 | 519 lines. Note that certain C++ constructs can |
18720 | 520 generate ambiguous situations. This clean up |
521 only takes place when there is nothing but | |
36920 | 522 whitespace between colons. Clean up occurs |
523 when the second colon is typed. | |
524 | |
525 The following clean ups always take place when they are on this list, | |
526 regardless of the auto-newline feature, since they typically don't | |
527 involve auto-newline inserted newlines: | |
528 | |
529 space-before-funcall -- Insert exactly one space before the opening | |
530 parenthesis of a function call. Clean up | |
531 occurs when the opening parenthesis is typed. | |
532 compact-empty-funcall -- Clean up any space before the function call | |
533 opening parenthesis if and only if the | |
534 argument list is empty. This is typically | |
535 useful together with `space-before-funcall' to | |
536 get the style \"foo (bar)\" and \"foo()\". | |
537 Clean up occurs when the closing parenthesis | |
538 is typed." | |
18720 | 539 :type '(set |
36920 | 540 (const :tag "Put \"} else {\" on one line" |
541 brace-else-brace) | |
542 (const :tag "Put \"} else if (...) {\" on one line" | |
543 brace-elseif-brace) | |
544 (const :tag "Put \"} catch (...) {\" on one line" | |
545 brace-catch-brace) | |
546 (const :tag "Put empty defun braces on one line" | |
547 empty-defun-braces) | |
548 (const :tag "Put \"};\" ending defuns on one line" | |
549 defun-close-semi) | |
550 (const :tag "Put \"},\" in aggregates on one line" | |
551 list-close-comma) | |
552 (const :tag "Put C++ style \"::\" on one line" | |
553 scope-operator) | |
554 (const :tag "Put a space before funcall parens, e.g. \"foo (bar)\"" | |
555 space-before-funcall) | |
556 (const :tag "Remove space before empty funcalls, e.g. \"foo()\"" | |
557 compact-empty-funcall)) | |
18720 | 558 :group 'c) |
559 | |
26817 | 560 (defcustom-c-stylevar c-hanging-braces-alist '((brace-list-open) |
561 (brace-entry-open) | |
562 (substatement-open after) | |
563 (block-close . c-snug-do-while) | |
564 (extern-lang-open after) | |
565 (inexpr-class-open after) | |
566 (inexpr-class-close before)) | |
567 "*Controls the insertion of newlines before and after braces | |
568 when the auto-newline feature is active. This variable contains an | |
569 association list with elements of the following form: | |
570 \(SYNTACTIC-SYMBOL . ACTION). | |
18720 | 571 |
572 When a brace (either opening or closing) is inserted, the syntactic | |
573 context it defines is looked up in this list, and if found, the | |
574 associated ACTION is used to determine where newlines are inserted. | |
575 If the context is not found, the default is to insert a newline both | |
576 before and after the brace. | |
577 | |
578 SYNTACTIC-SYMBOL can be any of: defun-open, defun-close, class-open, | |
579 class-close, inline-open, inline-close, block-open, block-close, | |
580 substatement-open, statement-case-open, extern-lang-open, | |
581 extern-lang-close, brace-list-open, brace-list-close, | |
26817 | 582 brace-list-intro, brace-entry-open, namespace-open, namespace-close, |
583 inexpr-class-open, or inexpr-class-close. See `c-offsets-alist' for | |
584 details, except for inexpr-class-open and inexpr-class-close, which | |
585 doesn't have any corresponding symbols there. Those two symbols are | |
586 used for the opening and closing braces, respectively, of anonymous | |
587 inner classes in Java. | |
18720 | 588 |
589 ACTION can be either a function symbol or a list containing any | |
590 combination of the symbols `before' or `after'. If the list is empty, | |
591 no newlines are inserted either before or after the brace. | |
592 | |
593 When ACTION is a function symbol, the function is called with a two | |
594 arguments: the syntactic symbol for the brace and the buffer position | |
595 at which the brace was inserted. The function must return a list as | |
596 described in the preceding paragraph. Note that during the call to | |
597 the function, the variable `c-syntactic-context' is set to the entire | |
598 syntactic context for the brace line." | |
26817 | 599 :type |
600 `(set ,@(mapcar | |
601 (lambda (elt) | |
602 `(cons :format "%v" | |
603 (c-const-symbol :format "%v: " | |
604 :size 20 | |
605 :value ,elt) | |
606 (choice :format "%[Choice%] %v" | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
607 :value (before after) |
26817 | 608 (set :menu-tag "Before/after" |
609 :format "Newline %v brace\n" | |
610 (const :format "%v, " before) | |
611 (const :format "%v" after)) | |
612 (function :menu-tag "Function" | |
613 :format "Run function: %v" | |
614 :value c-)))) | |
615 '(defun-open defun-close | |
616 class-open class-close | |
617 inline-open inline-close | |
618 block-open block-close | |
619 substatement-open statement-case-open | |
620 extern-lang-open extern-lang-close | |
621 brace-list-open brace-list-close | |
622 brace-list-intro brace-entry-open | |
623 namespace-open namespace-close | |
624 inexpr-class-open inexpr-class-close))) | |
625 :group 'c) | |
18720 | 626 |
26817 | 627 (defcustom-c-stylevar c-hanging-colons-alist nil |
18720 | 628 "*Controls the insertion of newlines before and after certain colons. |
629 This variable contains an association list with elements of the | |
630 following form: (SYNTACTIC-SYMBOL . ACTION). | |
631 | |
632 SYNTACTIC-SYMBOL can be any of: case-label, label, access-label, | |
633 member-init-intro, or inher-intro. | |
634 | |
635 See the variable `c-hanging-braces-alist' for the semantics of this | |
636 variable. Note however that making ACTION a function symbol is | |
637 currently not supported for this variable." | |
26817 | 638 :type |
639 `(set ,@(mapcar | |
640 (lambda (elt) | |
641 `(cons :format "%v" | |
642 (c-const-symbol :format "%v: " | |
643 :size 20 | |
644 :value ,elt) | |
645 (set :format "Newline %v brace\n" | |
646 (const :format "%v, " before) | |
647 (const :format "%v" after)))) | |
648 '(case-label label access-label member-init-intro inher-intro))) | |
18720 | 649 :group 'c) |
650 | |
26817 | 651 (defcustom-c-stylevar c-hanging-semi&comma-criteria |
652 '(c-semi&comma-inside-parenlist) | |
18720 | 653 "*List of functions that decide whether to insert a newline or not. |
654 The functions in this list are called, in order, whenever the | |
655 auto-newline minor mode is activated (as evidenced by a `/a' or `/ah' | |
656 string in the mode line), and a semicolon or comma is typed (see | |
657 `c-electric-semi&comma'). Each function in this list is called with | |
658 no arguments, and should return one of the following values: | |
659 | |
660 nil -- no determination made, continue checking | |
661 'stop -- do not insert a newline, and stop checking | |
662 (anything else) -- insert a newline, and stop checking | |
663 | |
664 If every function in the list is called with no determination made, | |
665 then no newline is inserted." | |
666 :type '(repeat function) | |
667 :group 'c) | |
668 | |
26817 | 669 (defcustom-c-stylevar c-backslash-column 48 |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
670 "*Minimum alignment column for line continuation backslashes. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
671 This is used by the functions that automatically insert or align the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
672 line continuation backslashes in multiline macros. If any line in the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
673 macro exceeds this column then the next tab stop from that line is |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
674 used as alignment column instead." |
18720 | 675 :type 'integer |
676 :group 'c) | |
677 | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
678 (defcustom-c-stylevar c-backslash-max-column 72 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
679 "*Maximum alignment column for line continuation backslashes. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
680 This is used by the functions that automatically insert or align the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
681 line continuation backslashes in multiline macros. If any line in the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
682 macro exceeds this column then the backslashes for the other lines |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
683 will be aligned at this column." |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
684 :type 'integer |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
685 :group 'c) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
686 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
687 (defcustom c-auto-align-backslashes t |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
688 "*Align automatically inserted line continuation backslashes. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
689 When line continuation backslashes are inserted automatically for line |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
690 breaks in multiline macros, e.g. by \\[c-context-line-break], they are |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
691 aligned with the other backslashes in the same macro if this flag is |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
692 set. Otherwise the inserted backslashes are preceded by a single |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
693 space." |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
694 :type 'boolean |
18720 | 695 :group 'c) |
696 | |
697 (defcustom c-backspace-function 'backward-delete-char-untabify | |
698 "*Function called by `c-electric-backspace' when deleting backwards." | |
699 :type 'function | |
700 :group 'c) | |
701 | |
702 (defcustom c-delete-function 'delete-char | |
703 "*Function called by `c-electric-delete' when deleting forwards." | |
704 :type 'function | |
705 :group 'c) | |
706 | |
49496
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
707 (defcustom c-require-final-newline |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
708 ;; C and C++ mandates that all nonempty files should end with a |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
709 ;; newline. Objective-C refers to C for all things it doesn't |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
710 ;; specify, so the same holds there. The other languages does not |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
711 ;; require it (at least not explicitly in a normative text). |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
712 '((c-mode . t) |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
713 (c++-mode . t) |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
714 (objc-mode . t)) |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
715 "*Controls whether a final newline is ensured when the file is saved. |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
716 The value is an association list that for each language mode specifies |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
717 the value to give to `require-final-newline' at mode initialization; |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
718 see that variable for details about the value. If a language isn't |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
719 present on the association list, CC Mode won't set |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
720 `require-final-newline' in buffers for that language." |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
721 :type `(set (cons :format "%v" |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
722 (const :format "C " c-mode) |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
723 (symbol :format "%v" :value ,require-final-newline)) |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
724 (cons :format "%v" |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
725 (const :format "C++ " c++-mode) |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
726 (symbol :format "%v" :value ,require-final-newline)) |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
727 (cons :format "%v" |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
728 (const :format "ObjC " objc-mode) |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
729 (symbol :format "%v" :value ,require-final-newline)) |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
730 (cons :format "%v" |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
731 (const :format "Java " java-mode) |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
732 (symbol :format "%v" :value ,require-final-newline)) |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
733 (cons :format "%v" |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
734 (const :format "IDL " idl-mode) |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
735 (symbol :format "%v" :value ,require-final-newline)) |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
736 (cons :format "%v" |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
737 (const :format "Pike " pike-mode) |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
738 (symbol :format "%v" :value ,require-final-newline))) |
49470
13365bab7fce
(c-require-final-newline): Added a variable to make the initialization of
Martin Stjernholm <mast@lysator.liu.se>
parents:
48656
diff
changeset
|
739 :group 'c) |
13365bab7fce
(c-require-final-newline): Added a variable to make the initialization of
Martin Stjernholm <mast@lysator.liu.se>
parents:
48656
diff
changeset
|
740 |
18720 | 741 (defcustom c-electric-pound-behavior nil |
742 "*List of behaviors for electric pound insertion. | |
743 Only currently supported behavior is `alignleft'." | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
744 :type '(set (const alignleft)) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
745 :group 'c) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
746 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
747 (defcustom c-special-indent-hook nil |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
748 "*Hook for user defined special indentation adjustments. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
749 This hook gets called after a line is indented by the mode." |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
750 :type 'hook |
18720 | 751 :group 'c) |
752 | |
26817 | 753 (defcustom-c-stylevar c-label-minimum-indentation 1 |
18720 | 754 "*Minimum indentation for lines inside of top-level constructs. |
755 This variable typically only affects code using the `gnu' style, which | |
756 mandates a minimum of one space in front of every line inside | |
757 top-level constructs. Specifically, the function | |
758 `c-gnu-impose-minimum' on your `c-special-indent-hook' is what | |
759 enforces this." | |
760 :type 'integer | |
761 :group 'c) | |
762 | |
763 (defcustom c-progress-interval 5 | |
764 "*Interval used to update progress status during long re-indentation. | |
765 If a number, percentage complete gets updated after each interval of | |
20144
56d81cc7b4f5
(c-progress-interval): Document new semantics
Karl Heuer <kwzh@gnu.org>
parents:
20140
diff
changeset
|
766 that many seconds. To inhibit all messages during indentation, set |
56d81cc7b4f5
(c-progress-interval): Document new semantics
Karl Heuer <kwzh@gnu.org>
parents:
20140
diff
changeset
|
767 this variable to nil." |
18720 | 768 :type 'integer |
769 :group 'c) | |
770 | |
36920 | 771 (defcustom c-default-style '((java-mode . "java") (other . "gnu")) |
24282 | 772 "*Style which gets installed by default when a file is visited. |
20919
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
773 |
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
774 The value of this variable can be any style defined in |
24282 | 775 `c-style-alist', including styles you add. The value can also be an |
776 association list of major mode symbols to style names. | |
777 | |
778 When the value is a string, all CC Mode major modes will install this | |
36920 | 779 style by default. |
20919
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
780 |
26817 | 781 When the value is an alist, the major mode symbol is looked up in it |
782 and the associated style is installed. If the major mode is not | |
783 listed in the alist, then the symbol `other' is looked up in it, and | |
784 if found, the style in that entry is used. If `other' is not found in | |
785 the alist, then \"gnu\" style is used. | |
786 | |
787 The default style gets installed before your mode hooks run, so you | |
788 can always override the use of `c-default-style' by making calls to | |
36920 | 789 `c-set-style' in the appropriate mode hook." |
26817 | 790 :type '(radio |
36920 | 791 (string :tag "Style in all modes") |
792 (set :tag "Mode-specific styles" | |
793 (cons :format "%v" | |
794 (const :format "C " c-mode) (string :format "%v")) | |
795 (cons :format "%v" | |
796 (const :format "C++ " c++-mode) (string :format "%v")) | |
797 (cons :format "%v" | |
798 (const :format "ObjC " objc-mode) (string :format "%v")) | |
799 (cons :format "%v" | |
800 (const :format "Java " java-mode) (string :format "%v")) | |
801 (cons :format "%v" | |
802 (const :format "IDL " idl-mode) (string :format "%v")) | |
803 (cons :format "%v" | |
804 (const :format "Pike " pike-mode) (string :format "%v")) | |
805 (cons :format "%v" | |
806 (const :format "Other " other) (string :format "%v")))) | |
26817 | 807 :group 'c) |
20919
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
808 |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
809 ;; *) At the start of a statement or declaration means in more detail: |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
810 ;; At the closest preceding statement/declaration that starts at boi |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
811 ;; and doesn't have a label or comment at that position. If there's |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
812 ;; no such statement within the same block, then back up to the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
813 ;; surrounding block or statement, add the appropriate |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
814 ;; statement-block-intro, defun-block-intro or substatement syntax |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
815 ;; symbol and continue searching. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
816 (c-set-stylevar-fallback 'c-offsets-alist |
26817 | 817 '((string . c-lineup-dont-change) |
818 ;; Relpos: Beg of previous line. | |
819 (c . c-lineup-C-comments) | |
820 ;; Relpos: Beg of the comment. | |
821 (defun-open . 0) | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
822 ;; Relpos: When inside a class: Boi at the func decl start. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
823 ;; When at top level: Bol at the func decl start. When inside |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
824 ;; a code block (only possible in Pike): At the func decl |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
825 ;; start(*). |
26817 | 826 (defun-close . 0) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
827 ;; Relpos: At the defun block open if it's at boi, otherwise |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
828 ;; boi at the func decl start. |
26817 | 829 (defun-block-intro . +) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
830 ;; Relpos: At the block open(*). |
26817 | 831 (class-open . 0) |
832 ;; Relpos: Boi at the class decl start. | |
833 (class-close . 0) | |
834 ;; Relpos: Boi at the class decl start. | |
835 (inline-open . +) | |
836 ;; Relpos: None for functions (inclass got the relpos then), | |
837 ;; boi at the lambda start for lambdas. | |
838 (inline-close . 0) | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
839 ;; Relpos: Inexpr functions: At the lambda block open if it's |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
840 ;; at boi, else at the statement(*) at boi of the start of the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
841 ;; lambda construct. Otherwise: At the inline block open if |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
842 ;; it's at boi, otherwise boi at the func decl start. |
26817 | 843 (func-decl-cont . +) |
844 ;; Relpos: Boi at the func decl start. | |
845 (knr-argdecl-intro . +) | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
846 ;; Relpos: Boi at the topmost intro line. |
26817 | 847 (knr-argdecl . 0) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
848 ;; Relpos: At the beginning of the first K&R argdecl. |
26817 | 849 (topmost-intro . 0) |
850 ;; Relpos: Bol at the last line of previous construct. | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
851 (topmost-intro-cont . c-lineup-topmost-intro-cont) |
26817 | 852 ;; Relpos: Boi at the topmost intro line. |
853 (member-init-intro . +) | |
854 ;; Relpos: Boi at the func decl arglist open. | |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
855 (member-init-cont . c-lineup-multi-inher) |
26817 | 856 ;; Relpos: Beg of the first member init. |
857 (inher-intro . +) | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
858 ;; Relpos: Boi at the class decl start. |
26817 | 859 (inher-cont . c-lineup-multi-inher) |
860 ;; Relpos: Java: At the implements/extends keyword start. | |
861 ;; Otherwise: At the inher start colon, or boi at the class | |
862 ;; decl start if the first inherit clause hangs and it's not a | |
863 ;; func-local inherit clause (when does that occur?). | |
864 (block-open . 0) | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
865 ;; Relpos: Inexpr statement: At the statement(*) at boi of the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
866 ;; start of the inexpr construct. Otherwise: None. |
26817 | 867 (block-close . 0) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
868 ;; Relpos: Inexpr statement: At the inexpr block open if it's |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
869 ;; at boi, else at the statement(*) at boi of the start of the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
870 ;; inexpr construct. Block hanging on a case/default label: At |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
871 ;; the closest preceding label that starts at boi. Otherwise: |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
872 ;; At the block open(*). |
26817 | 873 (brace-list-open . 0) |
874 ;; Relpos: Boi at the brace list decl start, but a starting | |
875 ;; "typedef" token is ignored. | |
876 (brace-list-close . 0) | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
877 ;; Relpos: At the brace list decl start(*). |
26817 | 878 (brace-list-intro . +) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
879 ;; Relpos: At the brace list decl start(*). |
26817 | 880 (brace-list-entry . 0) |
881 ;; Relpos: At the first non-ws char after the open paren if the | |
882 ;; first token is on the same line, otherwise boi at that | |
883 ;; token. | |
884 (brace-entry-open . 0) | |
885 ;; Relpos: Same as brace-list-entry. | |
886 (statement . 0) | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
887 ;; Relpos: After a `;' in the condition clause of a for |
26817 | 888 ;; statement: At the first token after the starting paren. |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
889 ;; Otherwise: At the preceding statement(*). |
26817 | 890 (statement-cont . +) |
891 ;; Relpos: After the first token in the condition clause of a | |
892 ;; for statement: At the first token after the starting paren. | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
893 ;; Otherwise: At the containing statement(*). |
26817 | 894 (statement-block-intro . +) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
895 ;; Relpos: In inexpr statement block: At the inexpr block open |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
896 ;; if it's at boi, else at the statement(*) at boi of the start |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
897 ;; of the inexpr construct. In a block hanging on a |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
898 ;; case/default label: At the closest preceding label that |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
899 ;; starts at boi. Otherwise: At the start of the containing |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
900 ;; block(*). |
26817 | 901 (statement-case-intro . +) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
902 ;; Relpos: At the case/default label(*). |
26817 | 903 (statement-case-open . 0) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
904 ;; Relpos: At the case/default label(*). |
26817 | 905 (substatement . +) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
906 ;; Relpos: At the containing statement(*). |
26817 | 907 (substatement-open . +) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
908 ;; Relpos: At the containing statement(*). |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
909 (substatement-label . 2) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
910 ;; Relpos: At the containing statement(*). |
26817 | 911 (case-label . 0) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
912 ;; Relpos: At the start of the switch block(*). |
26817 | 913 (access-label . -) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
914 ;; Relpos: Same as inclass. |
26817 | 915 (label . 2) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
916 ;; Relpos: At the start of the containing block(*). |
26817 | 917 (do-while-closure . 0) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
918 ;; Relpos: At the corresponding while statement(*). |
26817 | 919 (else-clause . 0) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
920 ;; Relpos: At the corresponding if statement(*). |
26817 | 921 (catch-clause . 0) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
922 ;; Relpos: At the previous try or catch statement clause(*). |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
923 (comment-intro . (c-lineup-knr-region-comment c-lineup-comment)) |
26817 | 924 ;; Relpos: None. |
925 (arglist-intro . +) | |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
926 ;; Relpos: Boi at the open paren, or at the first non-ws after |
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
927 ;; the open paren of the surrounding sexp, whichever is later. |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
928 (arglist-cont . (c-lineup-gcc-asm-reg 0)) |
26817 | 929 ;; Relpos: At the first token after the open paren. |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
930 (arglist-cont-nonempty . (c-lineup-gcc-asm-reg c-lineup-arglist)) |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
931 ;; Relpos: Boi at the open paren, or at the first non-ws after |
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
932 ;; the open paren of the surrounding sexp, whichever is later. |
26817 | 933 (arglist-close . +) |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
934 ;; Relpos: Boi at the open paren, or at the first non-ws after |
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
935 ;; the open paren of the surrounding sexp, whichever is later. |
26817 | 936 (stream-op . c-lineup-streamop) |
937 ;; Relpos: Boi at the first stream op in the statement. | |
938 (inclass . +) | |
939 ;; Relpos: At the class open brace if it's at boi, otherwise | |
940 ;; boi at the class decl start. | |
36920 | 941 (cpp-macro . [0]) |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
942 ;; Relpos: None. |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
943 (cpp-macro-cont . +) |
26817 | 944 ;; Relpos: At the macro start (always at boi). |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
945 (cpp-define-intro . (c-lineup-cpp-define +)) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
946 ;; Relpos: None. |
26817 | 947 (friend . 0) |
948 ;; Relpos: None. | |
36920 | 949 (objc-method-intro . [0]) |
26817 | 950 ;; Relpos: Boi. |
951 (objc-method-args-cont . c-lineup-ObjC-method-args) | |
952 ;; Relpos: At the method start (always at boi). | |
953 (objc-method-call-cont . c-lineup-ObjC-method-call) | |
954 ;; Relpos: At the open bracket. | |
955 (extern-lang-open . 0) | |
956 ;; Relpos: Boi at the extern keyword. | |
957 (extern-lang-close . 0) | |
958 ;; Relpos: Boi at the corresponding extern keyword. | |
959 (inextern-lang . +) | |
960 ;; Relpos: At the extern block open brace if it's at boi, | |
961 ;; otherwise boi at the extern keyword. | |
962 (namespace-open . 0) | |
963 ;; Relpos: Boi at the namespace keyword. | |
964 (namespace-close . 0) | |
965 ;; Relpos: Boi at the corresponding namespace keyword. | |
966 (innamespace . +) | |
967 ;; Relpos: At the namespace block open brace if it's at boi, | |
968 ;; otherwise boi at the namespace keyword. | |
969 (template-args-cont . (c-lineup-template-args +)) | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
970 ;; Relpos: Boi at the decl start. This might be changed; the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
971 ;; logical position is clearly the opening '<'. |
26817 | 972 (inlambda . c-lineup-inexpr-block) |
973 ;; Relpos: None. | |
974 (lambda-intro-cont . +) | |
975 ;; Relpos: Boi at the lambda start. | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
976 (inexpr-statement . +) |
26817 | 977 ;; Relpos: None. |
978 (inexpr-class . +) | |
979 ;; Relpos: None. | |
980 )) | |
981 (defcustom c-offsets-alist nil | |
982 "Association list of syntactic element symbols and indentation offsets. | |
983 As described below, each cons cell in this list has the form: | |
24282 | 984 |
26817 | 985 (SYNTACTIC-SYMBOL . OFFSET) |
986 | |
987 When a line is indented, CC Mode first determines the syntactic | |
988 context of it by generating a list of symbols called syntactic | |
989 elements. This list can contain more than one syntactic element and | |
990 the global variable `c-syntactic-context' contains the context list | |
991 for the line being indented. Each element in this list is actually a | |
992 cons cell of the syntactic symbol and a buffer position. This buffer | |
993 position is called the relative indent point for the line. Some | |
994 syntactic symbols may not have a relative indent point associated with | |
995 them. | |
996 | |
997 After the syntactic context list for a line is generated, CC Mode | |
998 calculates the absolute indentation for the line by looking at each | |
999 syntactic element in the list. It compares the syntactic element | |
1000 against the SYNTACTIC-SYMBOL's in `c-offsets-alist'. When it finds a | |
1001 match, it adds the OFFSET to the column of the relative indent point. | |
1002 The sum of this calculation for each element in the syntactic list is | |
1003 the absolute offset for line being indented. | |
1004 | |
1005 If the syntactic element does not match any in the `c-offsets-alist', | |
36920 | 1006 the element is ignored. |
1007 | |
1008 If OFFSET is nil, the syntactic element is ignored in the offset | |
1009 calculation. | |
1010 | |
1011 If OFFSET is an integer, it's added to the relative indent. | |
1012 | |
1013 If OFFSET is one of the symbols `+', `-', `++', `--', `*', or `/', a | |
1014 positive or negative multiple of `c-basic-offset' is added; 1, -1, 2, | |
1015 -2, 0.5, and -0.5, respectively. | |
26817 | 1016 |
49479
12025f034e10
(c-offsets-alist): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
49470
diff
changeset
|
1017 If OFFSET is a vector, its first element, which must be an integer, |
36920 | 1018 is used as an absolute indentation column. This overrides all |
1019 relative offsets. If there are several syntactic elements which | |
1020 evaluates to absolute indentation columns, the first one takes | |
1021 precedence. You can see in which order CC Mode combines the syntactic | |
1022 elements in a certain context by using \\[c-show-syntactic-information] on the line. | |
26817 | 1023 |
36920 | 1024 If OFFSET is a function, it's called with a single argument |
1025 containing the cons of the syntactic element symbol and the relative | |
1026 indent point. The return value from the function is then | |
1027 reinterpreted as an OFFSET value. | |
1028 | |
1029 If OFFSET is a list, it's recursively evaluated using the semantics | |
1030 described above. The first element of the list to return a non-nil | |
1031 value succeeds. If none of the elements returns a non-nil value, the | |
1032 syntactic element is ignored. | |
26817 | 1033 |
1034 `c-offsets-alist' is a style variable. This means that the offsets on | |
1035 this variable are normally taken from the style system in CC Mode | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1036 \(see `c-default-style' and `c-style-alist'). However, any offsets |
26817 | 1037 put explicitly on this list will override the style system when a CC |
1038 Mode buffer is initialized \(there is a variable | |
1039 `c-old-style-variable-behavior' that changes this, though). | |
1040 | |
1041 Here is the current list of valid syntactic element symbols: | |
1042 | |
1043 string -- Inside multi-line string. | |
1044 c -- Inside a multi-line C style block comment. | |
1045 defun-open -- Brace that opens a function definition. | |
1046 defun-close -- Brace that closes a function definition. | |
1047 defun-block-intro -- The first line in a top-level defun. | |
1048 class-open -- Brace that opens a class definition. | |
1049 class-close -- Brace that closes a class definition. | |
1050 inline-open -- Brace that opens an in-class inline method. | |
1051 inline-close -- Brace that closes an in-class inline method. | |
1052 func-decl-cont -- The region between a function definition's | |
1053 argument list and the function opening brace | |
1054 (excluding K&R argument declarations). In C, you | |
1055 cannot put anything but whitespace and comments | |
1056 between them; in C++ and Java, throws declarations | |
1057 and other things can appear in this context. | |
1058 knr-argdecl-intro -- First line of a K&R C argument declaration. | |
1059 knr-argdecl -- Subsequent lines in a K&R C argument declaration. | |
1060 topmost-intro -- The first line in a topmost construct definition. | |
1061 topmost-intro-cont -- Topmost definition continuation lines. | |
1062 member-init-intro -- First line in a member initialization list. | |
1063 member-init-cont -- Subsequent member initialization list lines. | |
1064 inher-intro -- First line of a multiple inheritance list. | |
1065 inher-cont -- Subsequent multiple inheritance lines. | |
1066 block-open -- Statement block open brace. | |
1067 block-close -- Statement block close brace. | |
1068 brace-list-open -- Open brace of an enum or static array list. | |
1069 brace-list-close -- Close brace of an enum or static array list. | |
1070 brace-list-intro -- First line in an enum or static array list. | |
1071 brace-list-entry -- Subsequent lines in an enum or static array list. | |
1072 brace-entry-open -- Subsequent lines in an enum or static array | |
1073 list that start with an open brace. | |
1074 statement -- A C (or like) statement. | |
1075 statement-cont -- A continuation of a C (or like) statement. | |
1076 statement-block-intro -- The first line in a new statement block. | |
1077 statement-case-intro -- The first line in a case \"block\". | |
1078 statement-case-open -- The first line in a case block starting with brace. | |
1079 substatement -- The first line after an if/while/for/do/else. | |
1080 substatement-open -- The brace that opens a substatement block. | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1081 substatement-label -- Labelled line after an if/while/for/do/else. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1082 case-label -- A \"case\" or \"default\" label. |
26817 | 1083 access-label -- C++ private/protected/public access label. |
1084 label -- Any ordinary label. | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1085 do-while-closure -- The \"while\" that ends a do/while construct. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1086 else-clause -- The \"else\" of an if/else construct. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1087 catch-clause -- The \"catch\" or \"finally\" of a try/catch construct. |
26817 | 1088 comment-intro -- A line containing only a comment introduction. |
1089 arglist-intro -- The first line in an argument list. | |
1090 arglist-cont -- Subsequent argument list lines when no | |
1091 arguments follow on the same line as the | |
1092 arglist opening paren. | |
1093 arglist-cont-nonempty -- Subsequent argument list lines when at | |
1094 least one argument follows on the same | |
1095 line as the arglist opening paren. | |
1096 arglist-close -- The solo close paren of an argument list. | |
1097 stream-op -- Lines continuing a stream operator construct. | |
1098 inclass -- The construct is nested inside a class definition. | |
1099 Used together with e.g. `topmost-intro'. | |
1100 cpp-macro -- The start of a C preprocessor macro definition. | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1101 cpp-macro-cont -- Inside a multi-line C preprocessor macro definition. |
26817 | 1102 friend -- A C++ friend declaration. |
1103 objc-method-intro -- The first line of an Objective-C method definition. | |
1104 objc-method-args-cont -- Lines continuing an Objective-C method definition. | |
1105 objc-method-call-cont -- Lines continuing an Objective-C method call. | |
1106 extern-lang-open -- Brace that opens an external language block. | |
1107 extern-lang-close -- Brace that closes an external language block. | |
1108 inextern-lang -- Analogous to the `inclass' syntactic symbol, | |
1109 but used inside extern constructs. | |
1110 namespace-open -- Brace that opens a C++ namespace block. | |
1111 namespace-close -- Brace that closes a C++ namespace block. | |
1112 innamespace -- Analogous to the `inextern-lang' syntactic | |
1113 symbol, but used inside C++ namespace constructs. | |
1114 template-args-cont -- C++ template argument list continuations. | |
1115 inlambda -- In the header or body of a lambda function. | |
1116 lambda-intro-cont -- Continuation of the header of a lambda function. | |
1117 inexpr-statement -- The statement is inside an expression. | |
1118 inexpr-class -- The class is inside an expression. Used e.g. for | |
1119 Java anonymous classes." | |
1120 :type | |
1121 `(set :format "%{%t%}: | |
1122 Override style setting | |
1123 | Syntax Offset | |
1124 %v" | |
1125 ,@(mapcar | |
1126 (lambda (elt) | |
1127 `(cons :format "%v" | |
1128 :value ,elt | |
1129 (c-const-symbol :format "%v: " | |
1130 :size 25) | |
1131 (sexp :format "%v" | |
1132 :validate | |
1133 (lambda (widget) | |
1134 (unless (c-valid-offset (widget-value widget)) | |
1135 (widget-put widget :error "Invalid offset") | |
1136 widget))))) | |
1137 (get 'c-offsets-alist 'c-stylevar-fallback))) | |
18720 | 1138 :group 'c) |
1139 | |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
1140 (defcustom c-style-variables-are-local-p t |
18720 | 1141 "*Whether style variables should be buffer local by default. |
1142 If non-nil, then all indentation style related variables will be made | |
1143 buffer local by default. If nil, they will remain global. Variables | |
1144 are made buffer local when this file is loaded, and once buffer | |
1145 localized, they cannot be made global again. | |
1146 | |
1147 The list of variables to buffer localize are: | |
1148 c-offsets-alist | |
1149 c-basic-offset | |
1150 c-comment-only-line-offset | |
26817 | 1151 c-block-comment-prefix |
1152 c-comment-prefix-regexp | |
18720 | 1153 c-cleanup-list |
1154 c-hanging-braces-alist | |
1155 c-hanging-colons-alist | |
26817 | 1156 c-hanging-semi&comma-criteria |
18720 | 1157 c-backslash-column |
1158 c-label-minimum-indentation | |
1159 c-special-indent-hook | |
1160 c-indentation-style" | |
1161 :type 'boolean | |
1162 :group 'c) | |
1163 | |
1164 (defcustom c-mode-hook nil | |
1165 "*Hook called by `c-mode'." | |
26817 | 1166 :type 'hook |
18720 | 1167 :group 'c) |
1168 | |
1169 (defcustom c++-mode-hook nil | |
1170 "*Hook called by `c++-mode'." | |
1171 :type 'hook | |
1172 :group 'c) | |
1173 | |
1174 (defcustom objc-mode-hook nil | |
1175 "*Hook called by `objc-mode'." | |
1176 :type 'hook | |
1177 :group 'c) | |
1178 | |
1179 (defcustom java-mode-hook nil | |
1180 "*Hook called by `java-mode'." | |
1181 :type 'hook | |
1182 :group 'c) | |
1183 | |
19255
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1184 (defcustom idl-mode-hook nil |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1185 "*Hook called by `idl-mode'." |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1186 :type 'hook |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1187 :group 'c) |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1188 |
26817 | 1189 (defcustom pike-mode-hook nil |
1190 "*Hook called by `pike-mode'." | |
1191 :type 'hook | |
1192 :group 'c) | |
1193 | |
18720 | 1194 (defcustom c-mode-common-hook nil |
1195 "*Hook called by all CC Mode modes for common initializations." | |
1196 :type '(hook :format "%{CC Mode Common Hook%}:\n%v") | |
1197 :group 'c) | |
1198 | |
19255
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1199 (defcustom c-initialization-hook nil |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1200 "*Hook called when the CC Mode package gets initialized. |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1201 This hook is only run once per Emacs session and can be used as a |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1202 `load-hook' or in place of using `eval-after-load'." |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1203 :type 'hook |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1204 :group 'c) |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1205 |
24282 | 1206 (defcustom c-enable-xemacs-performance-kludge-p nil |
20919
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
1207 "*Enables a XEmacs only hack that may improve speed for some coding styles. |
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
1208 For styles that hang top-level opening braces (as is common with JDK |
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
1209 Java coding styles) this can improve performance between 3 and 60 |
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
1210 times for core indentation functions (e.g. `c-parse-state'). For |
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
1211 styles that conform to the Emacs recommendation of putting these |
24282 | 1212 braces in column zero, this can degrade performance about as much. |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1213 This variable only has effect in XEmacs." |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1214 :type 'boolean |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1215 :group 'c) |
18720 | 1216 |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1217 (defvar c-old-style-variable-behavior nil |
26817 | 1218 "*Enables the old style variable behavior when non-nil. |
1219 | |
1220 Normally the values of the style variables will override the style | |
1221 settings specified by the variables `c-default-style' and | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1222 `c-style-alist'. However, in CC Mode 5.25 and earlier, it was the |
26817 | 1223 other way around, meaning that changes made to the style variables |
1224 from e.g. Customize would not take effect unless special precautions | |
1225 were taken. That was confusing, especially for novice users. | |
1226 | |
1227 It's believed that despite this change, the new behavior will still | |
1228 produce the same results for most old CC Mode configurations, since | |
1229 all style variables are per default set in a special non-override | |
1230 state. Set this variable only if your configuration has stopped | |
1231 working due to this change.") | |
1232 | |
1233 | |
18720 | 1234 |
1235 ;; Non-customizable variables, still part of the interface to CC Mode | |
1236 (defvar c-file-style nil | |
1237 "Variable interface for setting style via File Local Variables. | |
1238 In a file's Local Variable section, you can set this variable to a | |
1239 string suitable for `c-set-style'. When the file is visited, CC Mode | |
1240 will set the style of the file to this value automatically. | |
1241 | |
1242 Note that file style settings are applied before file offset settings | |
1243 as designated in the variable `c-file-offsets'.") | |
26817 | 1244 (make-variable-buffer-local 'c-file-style) |
18720 | 1245 |
1246 (defvar c-file-offsets nil | |
1247 "Variable interface for setting offsets via File Local Variables. | |
1248 In a file's Local Variable section, you can set this variable to an | |
1249 association list similar to the values allowed in `c-offsets-alist'. | |
1250 When the file is visited, CC Mode will institute these offset settings | |
1251 automatically. | |
1252 | |
1253 Note that file offset settings are applied after file style settings | |
1254 as designated in the variable `c-file-style'.") | |
26817 | 1255 (make-variable-buffer-local 'c-file-offsets) |
18720 | 1256 |
1257 (defvar c-syntactic-context nil | |
36920 | 1258 "Variable containing syntactic analysis list during indentation. |
1259 This is always bound dynamically. It should never be set statically | |
39834
0f64721b0bb8
*** empty log message ***
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
38422
diff
changeset
|
1260 \(e.g. with `setq').") |
18720 | 1261 |
26817 | 1262 (defvar c-indentation-style nil |
36920 | 1263 "Name of the currently installed style. |
1264 Don't change this directly; call `c-set-style' instead.") | |
18720 | 1265 |
36920 | 1266 (defvar c-current-comment-prefix nil |
1267 "The current comment prefix regexp. | |
1268 Set from `c-comment-prefix-regexp' at mode initialization.") | |
1269 (make-variable-buffer-local 'c-current-comment-prefix) | |
19298
4a99e63dc4a9
(c-buffer-is-cc-mode): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19255
diff
changeset
|
1270 |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1271 (defvar c-buffer-is-cc-mode nil |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1272 "Non-nil for all buffers with a major mode derived from CC Mode. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1273 Otherwise, this variable is nil. I.e. this variable is non-nil for |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1274 `c-mode', `c++-mode', `objc-mode', `java-mode', `idl-mode', |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1275 `pike-mode', and any other non-CC Mode mode that calls |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1276 `c-initialize-cc-mode' (e.g. `awk-mode'). The value is the mode |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1277 symbol itself (i.e. `c-mode' etc) of the original CC Mode mode, or |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1278 just t if it's not known.") |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1279 (make-variable-buffer-local 'c-buffer-is-cc-mode) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1280 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1281 ;; Have to make `c-buffer-is-cc-mode' permanently local so that it |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1282 ;; survives the initialization of the derived mode. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1283 (put 'c-buffer-is-cc-mode 'permanent-local t) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1284 |
18720 | 1285 |
21105
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1286 ;; Figure out what features this Emacs has |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1287 ;;;###autoload |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1288 (defconst c-emacs-features |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1289 (let ((infodock-p (boundp 'infodock-version)) |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1290 (comments |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1291 ;; XEmacs 19 and beyond use 8-bit modify-syntax-entry flags. |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1292 ;; Emacs 19 uses a 1-bit flag. We will have to set up our |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1293 ;; syntax tables differently to handle this. |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1294 (let ((table (copy-syntax-table)) |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1295 entry) |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1296 (modify-syntax-entry ?a ". 12345678" table) |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1297 (cond |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1298 ;; XEmacs 19, and beyond Emacs 19.34 |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1299 ((arrayp table) |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1300 (setq entry (aref table ?a)) |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1301 ;; In Emacs, table entries are cons cells |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1302 (if (consp entry) (setq entry (car entry)))) |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1303 ;; XEmacs 20 |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1304 ((fboundp 'get-char-table) (setq entry (get-char-table ?a table))) |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1305 ;; before and including Emacs 19.34 |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1306 ((and (fboundp 'char-table-p) |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1307 (char-table-p table)) |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1308 (setq entry (car (char-table-range table [?a])))) |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1309 ;; incompatible |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1310 (t (error "CC Mode is incompatible with this version of Emacs"))) |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1311 (if (= (logand (lsh entry -16) 255) 255) |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1312 '8-bit |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1313 '1-bit)))) |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1314 (if infodock-p |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1315 (list comments 'infodock) |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1316 (list comments))) |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1317 "A list of features extant in the Emacs you are using. |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1318 There are many flavors of Emacs out there, each with different |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1319 features supporting those needed by CC Mode. Here's the current |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1320 supported list, along with the values for this variable: |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1321 |
26817 | 1322 XEmacs 19, 20, 21: (8-bit) |
1323 Emacs 19, 20: (1-bit) | |
21105
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1324 |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1325 Infodock (based on XEmacs) has an additional symbol on this list: |
21111
dad4e4facdc0
(c-emacs-features): Var moved from cc-defs.el.
Richard M. Stallman <rms@gnu.org>
parents:
21105
diff
changeset
|
1326 `infodock'.") |
21105
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1327 |
b40ae72a5b26
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20919
diff
changeset
|
1328 |
36920 | 1329 (cc-provide 'cc-vars) |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36920
diff
changeset
|
1330 |
18720 | 1331 ;;; cc-vars.el ends here |