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