Spelling fixes.
[emacs.git] / lisp / progmodes / cc-vars.el
blob549f94387d2fc9e566a8b9e8cfe29aa6bbcfab0f
1 ;;; cc-vars.el --- user customization variables for CC Mode
3 ;; Copyright (C) 1985, 1987, 1992-2011 Free Software Foundation, Inc.
5 ;; Authors: 2002- Alan Mackenzie
6 ;; 1998- Martin Stjernholm
7 ;; 1992-1999 Barry A. Warsaw
8 ;; 1987 Dave Detlefs
9 ;; 1987 Stewart Clamen
10 ;; 1985 Richard M. Stallman
11 ;; Maintainer: bug-cc-mode@gnu.org
12 ;; Created: 22-Apr-1997 (split from cc-mode.el)
13 ;; Keywords: c languages
14 ;; Package: cc-mode
16 ;; This file is part of GNU Emacs.
18 ;; GNU Emacs is free software: you can redistribute it and/or modify
19 ;; it under the terms of the GNU General Public License as published by
20 ;; the Free Software Foundation, either version 3 of the License, or
21 ;; (at your option) any later version.
23 ;; GNU Emacs is distributed in the hope that it will be useful,
24 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ;; GNU General Public License for more details.
28 ;; You should have received a copy of the GNU General Public License
29 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
31 ;;; Commentary:
33 ;;; Code:
35 (eval-when-compile
36 (let ((load-path
37 (if (and (boundp 'byte-compile-dest-file)
38 (stringp byte-compile-dest-file))
39 (cons (file-name-directory byte-compile-dest-file) load-path)
40 load-path)))
41 (load "cc-bytecomp" nil t)))
43 (cc-require 'cc-defs)
45 ;; Silence the compiler.
46 (cc-bytecomp-defun get-char-table) ; XEmacs
48 (cc-eval-when-compile
49 (require 'custom)
50 (require 'widget))
52 (cc-eval-when-compile
53 ;; Need the function form of `backquote', which isn't standardized
54 ;; between Emacsen. It's called `bq-process' in XEmacs, and
55 ;; `backquote-process' in Emacs. `backquote-process' returns a
56 ;; slightly more convoluted form, so let `bq-process' be the norm.
57 (if (fboundp 'backquote-process)
58 (cc-bytecomp-defmacro bq-process (form)
59 `(cdr (backquote-process ,form)))))
62 ;;; Helpers
64 ;; This widget exists in newer versions of the Custom library
65 (or (get 'other 'widget-type)
66 (define-widget 'other 'sexp
67 "Matches everything, but doesn't let the user edit the value.
68 Useful as last item in a `choice' widget."
69 :tag "Other"
70 :format "%t%n"
71 :value 'other))
73 ;; The next defun will supersede c-const-symbol.
74 (eval-and-compile
75 (defun c-constant-symbol (sym len)
76 "Create an uneditable symbol for customization buffers.
77 SYM is the name of the symbol, LEN the length of the field (in
78 characters) the symbol will be displayed in. LEN must be big
79 enough.
81 This returns a (const ....) structure, suitable for embedding
82 within a customization type."
83 (or (symbolp sym) (error "c-constant-symbol: %s is not a symbol" sym))
84 (let* ((name (symbol-name sym))
85 (l (length name))
86 (disp (concat name ":" (make-string (- len l 1) ?\ ))))
87 `(const
88 :size ,len
89 :format ,disp
90 :value ,sym))))
92 (define-widget 'c-const-symbol 'item
93 "An uneditable lisp symbol. This is obsolete -
94 use c-constant-symbol instead."
95 :value nil
96 :tag "Symbol"
97 :format "%t: %v\n%d"
98 :match (lambda (widget value) (symbolp value))
99 :value-to-internal
100 (lambda (widget value)
101 (let ((s (if (symbolp value)
102 (symbol-name value)
103 value))
104 (l (widget-get widget :size)))
105 (if l
106 (setq s (concat s (make-string (- l (length s)) ?\ ))))
108 :value-to-external
109 (lambda (widget value)
110 (if (stringp value)
111 (intern (progn
112 (string-match "\\`[^ ]*" value)
113 (match-string 0 value)))
114 value)))
116 (define-widget 'c-integer-or-nil 'sexp
117 "An integer or the value nil."
118 :value nil
119 :tag "Optional integer"
120 :match (lambda (widget value) (or (integerp value) (null value))))
122 (define-widget 'c-symbol-list 'sexp
123 "A single symbol or a list of symbols."
124 :tag "Symbols separated by spaces"
125 :validate 'widget-field-validate
126 :match
127 (lambda (widget value)
128 (or (symbolp value)
129 (catch 'ok
130 (while (listp value)
131 (unless (symbolp (car value))
132 (throw 'ok nil))
133 (setq value (cdr value)))
134 (null value))))
135 :value-to-internal
136 (lambda (widget value)
137 (cond ((null value)
139 ((symbolp value)
140 (symbol-name value))
141 ((consp value)
142 (mapconcat (lambda (symbol)
143 (symbol-name symbol))
144 value
145 " "))
147 value)))
148 :value-to-external
149 (lambda (widget value)
150 (if (stringp value)
151 (let (list end)
152 (while (string-match "\\S +" value end)
153 (setq list (cons (intern (match-string 0 value)) list)
154 end (match-end 0)))
155 (if (and list (not (cdr list)))
156 (car list)
157 (nreverse list)))
158 value)))
160 (defvar c-style-variables
161 '(c-basic-offset c-comment-only-line-offset c-indent-comment-alist
162 c-indent-comments-syntactically-p c-block-comment-prefix
163 c-comment-prefix-regexp c-doc-comment-style c-cleanup-list
164 c-hanging-braces-alist c-hanging-colons-alist
165 c-hanging-semi&comma-criteria c-backslash-column c-backslash-max-column
166 c-special-indent-hook c-label-minimum-indentation c-offsets-alist)
167 "List of the style variables.")
169 (defvar c-fallback-style nil)
171 (defsubst c-set-stylevar-fallback (name val)
172 (put name 'c-stylevar-fallback val)
173 (setq c-fallback-style (cons (cons name val) c-fallback-style)))
175 (defmacro defcustom-c-stylevar (name val doc &rest args)
176 "Define a style variable NAME with VAL and DOC.
177 More precisely, convert the given `:type FOO', mined out of ARGS,
178 to an aggregate `:type (radio STYLE (PREAMBLE FOO))', append some
179 some boilerplate documentation to DOC, arrange for the fallback
180 value of NAME to be VAL, and call `custom-declare-variable' to
181 do the rest of the work.
183 STYLE stands for the choice where the value is taken from some
184 style setting. PREAMBLE is optionally prepended to FOO; that is,
185 if FOO contains :tag or :value, the respective two-element list
186 component is ignored."
187 (declare (debug (symbolp form stringp &rest)))
188 (let* ((expanded-doc (concat doc "
190 This is a style variable. Apart from the valid values described
191 above, it can be set to the symbol `set-from-style'. In that case,
192 it takes its value from the style system (see `c-default-style' and
193 `c-style-alist') when a CC Mode buffer is initialized. Otherwise,
194 the value set here overrides the style system (there is a variable
195 `c-old-style-variable-behavior' that changes this, though)."))
196 (typ (eval (plist-get args :type)))
197 (type (if (consp typ) typ (list typ)))
198 (head (car type))
199 (tail (cdr type))
200 (newt (append (unless (plist-get tail :tag)
201 '(:tag "Override style settings"))
202 (unless (plist-get tail :value)
203 `(:value ,(eval val)))
204 tail))
205 (aggregate `'(radio
206 (const :tag "Use style settings" set-from-style)
207 ,(cons head newt))))
208 `(progn
209 (c-set-stylevar-fallback ',name ,val)
210 (custom-declare-variable
211 ',name ''set-from-style
212 ,expanded-doc
213 ,@(plist-put args :type aggregate)))))
215 (defun c-valid-offset (offset)
216 "Return non-nil if OFFSET is a valid offset for a syntactic symbol.
217 See `c-offsets-alist'."
218 (or (eq offset '+)
219 (eq offset '-)
220 (eq offset '++)
221 (eq offset '--)
222 (eq offset '*)
223 (eq offset '/)
224 (integerp offset)
225 (functionp offset)
226 (and (symbolp offset) (boundp offset))
227 (and (vectorp offset)
228 (= (length offset) 1)
229 (integerp (elt offset 0)))
230 (and (consp offset)
231 (not (eq (car offset) 'quote)) ; Detect misquoted lists.
232 (progn
233 (when (memq (car offset) '(first min max add))
234 (setq offset (cdr offset)))
235 (while (and (consp offset)
236 (c-valid-offset (car offset)))
237 (setq offset (cdr offset)))
238 (null offset)))))
242 ;;; User variables
244 (defcustom c-strict-syntax-p nil
245 "*If non-nil, all syntactic symbols must be found in `c-offsets-alist'.
246 If the syntactic symbol for a particular line does not match a symbol
247 in the offsets alist, or if no non-nil offset value can be determined
248 for a symbol, an error is generated, otherwise no error is reported
249 and the syntactic symbol is ignored.
251 This variable is considered obsolete; it doesn't work well with lineup
252 functions that return nil to support the feature of using lists on
253 syntactic symbols in `c-offsets-alist'. Please keep it set to nil."
254 :type 'boolean
255 :group 'c)
257 (defcustom c-echo-syntactic-information-p nil
258 "*If non-nil, syntactic info is echoed when the line is indented."
259 :type 'boolean
260 :group 'c)
262 (defcustom c-report-syntactic-errors nil
263 "*If non-nil, certain syntactic errors are reported with a ding
264 and a message, for example when an \"else\" is indented for which
265 there's no corresponding \"if\".
267 Note however that CC Mode doesn't make any special effort to check for
268 syntactic errors; that's the job of the compiler. The reason it can
269 report cases like the one above is that it can't find the correct
270 anchoring position to indent the line in that case."
271 :type 'boolean
272 :group 'c)
274 (defcustom-c-stylevar c-basic-offset 4
275 "*Amount of basic offset used by + and - symbols in `c-offsets-alist'.
276 Also used as the indentation step when `c-syntactic-indentation' is
277 nil."
278 :type 'integer
279 :group 'c)
280 ;;;###autoload(put 'c-basic-offset 'safe-local-variable 'integerp)
282 (defcustom c-tab-always-indent t
283 "*Controls the operation of the TAB key.
284 If t, hitting TAB always just indents the current line. If nil, hitting
285 TAB indents the current line if point is at the left margin or in the
286 line's indentation, otherwise it calls `c-insert-tab-function' to
287 insert a `real' tab character. If some other value (neither nil nor t),
288 then inserts a tab only within literals (comments and strings), but
289 always reindents the line.
291 Note: the variable `c-comment-only-line-offset' also controls the
292 indentation of lines containing only comments."
293 :type '(radio
294 (const :tag "TAB key always indents, never inserts TAB" t)
295 (const :tag "TAB key indents in left margin, otherwise inserts TAB" nil)
296 (other :tag "TAB key inserts TAB in literals, otherwise indents" other))
297 :group 'c)
299 (defcustom c-insert-tab-function 'insert-tab
300 "*Function used when inserting a tab for \\[c-indent-command].
301 Only used when `c-tab-always-indent' indicates a `real' tab character
302 should be inserted. Value must be a function taking no arguments.
303 The default, `insert-tab', inserts either a tab or the equivalent
304 number of spaces depending on the value of `indent-tabs-mode'."
305 :type 'function
306 :group 'c)
308 (defcustom c-syntactic-indentation t
309 "*Whether the indentation should be controlled by the syntactic context.
311 If t, the indentation functions indent according to the syntactic
312 context, using the style settings specified by `c-offsets-alist'.
314 If nil, every line is just indented to the same level as the previous
315 one, and the \\[c-indent-command] command adjusts the indentation in
316 steps specified by `c-basic-offset'. The indentation style has no
317 effect in this mode, nor any of the indentation associated variables,
318 e.g. `c-special-indent-hook'."
319 :type 'boolean
320 :group 'c)
321 (make-variable-buffer-local 'c-syntactic-indentation)
322 (put 'c-syntactic-indentation 'safe-local-variable 'booleanp)
324 (defcustom c-syntactic-indentation-in-macros t
325 "*Enable syntactic analysis inside macros.
326 If this is nil, all lines inside macro definitions are analyzed as
327 `cpp-macro-cont'. Otherwise they are analyzed syntactically, just
328 like normal code, and `cpp-define-intro' is used to create the
329 additional indentation of the bodies of \"#define\" macros.
331 Having this enabled simplifies editing of large multiline macros, but
332 it might complicate editing if CC Mode doesn't recognize the context
333 of the macro content. The default context inside the macro is the
334 same as the top level, so if it contains \"bare\" statements they
335 might be indented wrongly, although there are special cases that
336 handle this in most cases. If this problem occurs, it's usually
337 countered easily by surrounding the statements by a block \(or even
338 better with the \"do { ... } while \(0)\" trick)."
339 :type 'boolean
340 :group 'c)
341 (put 'c-syntactic-indentation-in-macros 'safe-local-variable 'booleanp)
343 (defcustom c-defun-tactic 'go-outward
344 "*Whether functions are recognized inside, e.g., a class.
345 This is used by `c-beginning-of-defun' and like functions.
347 Its value is one of:
348 t -- Functions are recognized only at the top level.
349 go-outward -- Nested functions are also recognized. Should a function
350 command hit the beginning/end of a nested scope, it will
351 carry on at the less nested level."
352 :type '(radio
353 (const :tag "Functions are at the top-level" t)
354 (const :tag "Functions are also recognized inside declaration scopes" go-outward))
355 :group 'c)
357 (defcustom-c-stylevar c-comment-only-line-offset 0
358 "*Extra offset for line which contains only the start of a comment.
359 Can contain an integer or a cons cell of the form:
361 (NON-ANCHORED-OFFSET . ANCHORED-OFFSET)
363 Where NON-ANCHORED-OFFSET is the amount of offset given to
364 non-column-zero anchored comment-only lines, and ANCHORED-OFFSET is
365 the amount of offset to give column-zero anchored comment-only lines.
366 Just an integer as value is equivalent to (<val> . -1000).
368 Note that this variable only has effect when the `c-lineup-comment'
369 lineup function is used on the `comment-intro' syntactic symbol (the
370 default)."
371 :type '(choice (integer :tag "Non-anchored offset" 0)
372 (cons :tag "Non-anchored & anchored offset"
373 :value (0 . 0)
374 (integer :tag "Non-anchored offset")
375 (integer :tag "Anchored offset")))
376 :group 'c)
378 (defcustom-c-stylevar c-indent-comment-alist
379 '((anchored-comment . (column . 0))
380 (end-block . (space . 1))
381 (cpp-end-block . (space . 2)))
382 "*Specifies how \\[indent-for-comment] calculates the comment start column.
383 This is an association list that contains entries of the form:
385 (LINE-TYPE . INDENT-SPEC)
387 LINE-TYPE specifies a type of line as described below, and INDENT-SPEC
388 says what \\[indent-for-comment] should do when used on that type of line.
390 The recognized values for LINE-TYPE are:
392 empty-line -- The line is empty.
393 anchored-comment -- The line contains a comment that starts in column 0.
394 end-block -- The line contains a solitary block closing brace.
395 cpp-end-block -- The line contains a preprocessor directive that
396 closes a block, i.e. either \"#endif\" or \"#else\".
397 other -- The line does not match any other entry
398 currently on the list.
400 An INDENT-SPEC is a cons cell of the form:
402 (ACTION . VALUE)
404 ACTION says how \\[indent-for-comment] should align the comment, and
405 VALUE is interpreted depending on ACTION. ACTION can be any of the
406 following:
408 space -- Put VALUE spaces between the end of the line and the start
409 of the comment.
410 column -- Start the comment at the column VALUE. If the line is
411 longer than that, the comment is preceded by a single
412 space. If VALUE is nil, `comment-column' is used.
413 align -- Align the comment with one on the previous line, if there
414 is any. If the line is too long, the comment is preceded
415 by a single space. If there isn't a comment start on the
416 previous line, the behavior is specified by VALUE, which
417 in turn is interpreted as an INDENT-SPEC.
419 If a LINE-TYPE is missing, then \\[indent-for-comment] indents the comment
420 according to `comment-column'.
422 Note that a non-nil value on `c-indent-comments-syntactically-p'
423 overrides this variable, so empty lines are indented syntactically
424 in that case, i.e. as if \\[c-indent-command] was used instead."
425 :type
426 (let ((space '(cons :tag "space"
427 :format "%v"
428 :value (space . 1)
429 (const :format "space " space)
430 (integer :format "%v")))
431 (column '(cons :tag "column"
432 :format "%v"
433 (const :format "column " column)
434 (c-integer-or-nil :format "%v"))))
435 `(set ,@(mapcar
436 (lambda (elt)
437 `(cons :format "%v"
438 ,(c-constant-symbol elt 20)
439 (choice
440 :format "%[Choice%] %v"
441 :value (column . nil)
442 ,space
443 ,column
444 (cons :tag "align"
445 :format "%v"
446 (const :format "align " align)
447 (choice
448 :format "%[Choice%] %v"
449 :value (column . nil)
450 ,space
451 ,column)))))
452 '(empty-line anchored-comment end-block cpp-end-block other))))
453 :group 'c)
455 (defcustom-c-stylevar c-indent-comments-syntactically-p nil
456 "*Specifies how \\[indent-for-comment] should handle comment-only lines.
457 When this variable is non-nil, comment-only lines are indented
458 according to syntactic analysis via `c-offsets-alist'. Otherwise, the
459 comment is indented as if it was preceded by code. Note that this
460 variable does not affect how the normal line indentation treats
461 comment-only lines."
462 :type 'boolean
463 :group 'c)
465 (make-obsolete-variable 'c-comment-continuation-stars
466 'c-block-comment-prefix "21.1")
468 ;; Although c-comment-continuation-stars is obsolete, we look at it in
469 ;; some places in CC Mode anyway, so make the compiler ignore it
470 ;; during our compilation.
471 ;; [This is unclean; better to use `symbol-value'. --ttn]
472 ;;(cc-bytecomp-obsolete-var c-comment-continuation-stars)
473 ;;(cc-bytecomp-defvar c-comment-continuation-stars)
475 (defcustom-c-stylevar c-block-comment-prefix
476 (if (boundp 'c-comment-continuation-stars)
477 (symbol-value 'c-comment-continuation-stars)
478 "* ")
479 "*Specifies the line prefix of continued C-style block comments.
480 You should set this variable to the literal string that gets inserted
481 at the front of continued block style comment lines. This should
482 either be the empty string, or some characters without preceding
483 spaces. To adjust the alignment under the comment starter, put an
484 appropriate value on the `c' syntactic symbol (see the
485 `c-offsets-alist' variable).
487 It's only used when a one-line block comment is broken into two or
488 more lines for the first time; otherwise the appropriate prefix is
489 adapted from the comment. This variable is not used for C++ line
490 style comments."
491 :type 'string
492 :group 'c)
494 (defcustom-c-stylevar c-comment-prefix-regexp
495 '((pike-mode . "//+!?\\|\\**")
496 (awk-mode . "#+")
497 (other . "//+\\|\\**"))
498 "*Regexp to match the line prefix inside comments.
499 This regexp is used to recognize the fill prefix inside comments for
500 correct paragraph filling and other things.
502 If this variable is a string, it will be used in all CC Mode major
503 modes. It can also be an association list, to associate specific
504 regexps to specific major modes. The symbol for the major mode is
505 looked up in the association list, and its value is used as the line
506 prefix regexp. If it's not found, then the symbol `other' is looked
507 up and its value is used instead.
509 The regexp should match the prefix used in both C++ style line
510 comments and C style block comments, but it does not need to match a
511 block comment starter. In other words, it should at least match
512 \"//\" for line comments and the string in `c-block-comment-prefix',
513 which is sometimes inserted by CC Mode inside block comments. It
514 should not match any surrounding whitespace.
516 Note that CC Mode uses this variable to set many other variables that
517 handle the paragraph filling. That's done at mode initialization or
518 when you switch to a style which sets this variable. Thus, if you
519 change it in some other way, e.g. interactively in a CC Mode buffer,
520 you will need to do \\[c-setup-paragraph-variables] afterwards so that
521 the other variables are updated with the new value.
523 Note also that when CC Mode starts up, all variables are initialized
524 before the mode hooks are run. It's therefore necessary to make a
525 call to `c-setup-paragraph-variables' explicitly if you change this
526 variable in a mode hook."
527 :type '(radio
528 (regexp :tag "Regexp for all modes")
529 (list
530 :tag "Mode-specific regexps"
531 (set
532 :inline t :format "%v"
533 (cons :format "%v"
534 (const :format "C " c-mode) (regexp :format "%v"))
535 (cons :format "%v"
536 (const :format "C++ " c++-mode) (regexp :format "%v"))
537 (cons :format "%v"
538 (const :format "ObjC " objc-mode) (regexp :format "%v"))
539 (cons :format "%v"
540 (const :format "Java " java-mode) (regexp :format "%v"))
541 (cons :format "%v"
542 (const :format "IDL " idl-mode) (regexp :format "%v"))
543 (cons :format "%v"
544 (const :format "Pike " pike-mode) (regexp :format "%v"))
545 (cons :format "%v"
546 (const :format "AWK " awk-mode) (regexp :format "%v")))
547 (cons :format " %v"
548 (const :format "Other " other) (regexp :format "%v"))))
549 :group 'c)
551 (defcustom-c-stylevar c-doc-comment-style
552 '((java-mode . javadoc)
553 (pike-mode . autodoc)
554 (c-mode . gtkdoc))
555 "*Specifies documentation comment style(s) to recognize.
556 This is primarily used to fontify doc comments and the markup within
557 them, e.g. Javadoc comments.
559 The value can be any of the following symbols for various known doc
560 comment styles:
562 javadoc -- Javadoc style for \"/** ... */\" comments (default in Java mode).
563 autodoc -- Pike autodoc style for \"//! ...\" comments (default in Pike mode).
564 gtkdoc -- GtkDoc style for \"/** ... **/\" comments (default in C mode).
566 The value may also be a list of doc comment styles, in which case all
567 of them are recognized simultaneously (presumably with markup cues
568 that don't conflict).
570 The value may also be an association list to specify different doc
571 comment styles for different languages. The symbol for the major mode
572 is then looked up in the alist, and the value of that element is
573 interpreted as above if found. If it isn't found then the symbol
574 `other' is looked up and its value is used instead.
576 Note that CC Mode uses this variable to set other variables that
577 handle fontification etc. That's done at mode initialization or when
578 you switch to a style which sets this variable. Thus, if you change
579 it in some other way, e.g. interactively in a CC Mode buffer, you will
580 need to do \\[java-mode] (or whatever mode you're currently using) to
581 reinitialize.
583 Note also that when CC Mode starts up, the other variables are
584 modified before the mode hooks are run. If you change this variable
585 in a mode hook, you have to call `c-setup-doc-comment-style'
586 afterwards to redo that work."
587 ;; Symbols other than those documented above may be used on this
588 ;; variable. If a variable exists that has that name with
589 ;; "-font-lock-keywords" appended, it's value is prepended to the
590 ;; font lock keywords list. If it's a function then it's called and
591 ;; the result is prepended.
592 :type '(radio
593 (c-symbol-list :tag "Doc style(s) in all modes")
594 (list
595 :tag "Mode-specific doc styles"
596 (set
597 :inline t :format "%v"
598 (cons :format "%v"
599 (const :format "C " c-mode)
600 (c-symbol-list :format "%v"))
601 (cons :format "%v"
602 (const :format "C++ " c++-mode)
603 (c-symbol-list :format "%v"))
604 (cons :format "%v"
605 (const :format "ObjC " objc-mode)
606 (c-symbol-list :format "%v"))
607 (cons :format "%v"
608 (const :format "Java " java-mode)
609 (c-symbol-list :format "%v"))
610 (cons :format "%v"
611 (const :format "IDL " idl-mode)
612 (c-symbol-list :format "%v"))
613 (cons :format "%v"
614 (const :format "Pike " pike-mode)
615 (c-symbol-list :format "%v"))
616 (cons :format "%v"
617 (const :format "AWK " awk-mode)
618 (c-symbol-list :format "%v"))
619 (cons :format "%v"
620 (const :format "Other " other)
621 (c-symbol-list :format "%v")))))
622 :group 'c)
624 (defcustom c-ignore-auto-fill '(string cpp code)
625 "*List of contexts in which automatic filling never occurs.
626 If Auto Fill mode is active, it will be temporarily disabled if point
627 is in any context on this list. It's e.g. useful to enable Auto Fill
628 in comments only, but not in strings or normal code. The valid
629 contexts are:
631 string -- inside a string or character literal
632 c -- inside a C style block comment
633 c++ -- inside a C++ style line comment
634 cpp -- inside a preprocessor directive
635 code -- anywhere else, i.e. in normal code"
636 :type '(set
637 (const :tag "String literals" string)
638 (const :tag "C style block comments" c)
639 (const :tag "C++ style line comments" c++)
640 (const :tag "Preprocessor directives" cpp)
641 (const :tag "Normal code" code))
642 :group 'c)
644 (defcustom-c-stylevar c-cleanup-list '(scope-operator)
645 "*List of various C/C++/ObjC constructs to \"clean up\".
646 The following clean ups only take place when the auto-newline feature
647 is turned on, as evidenced by the `/la' appearing next to the mode
648 name:
650 brace-else-brace -- Clean up \"} else {\" constructs by placing
651 entire construct on a single line. This clean
652 up only takes place when there is nothing but
653 white space between the braces and the `else'.
654 Clean up occurs when the open brace after the
655 `else' is typed.
656 brace-elseif-brace -- Similar to brace-else-brace, but clean up
657 \"} else if (...) {\" constructs. Clean up
658 occurs after the open parenthesis and the open
659 brace.
660 brace-catch-brace -- Similar to brace-elseif-brace, but clean up
661 \"} catch (...) {\" constructs.
662 empty-defun-braces -- Clean up empty defun braces by placing the
663 braces on the same line. Clean up occurs when
664 the defun closing brace is typed.
665 one-liner-defun -- If the code inside a function body can fit in
666 a single line, then remove any newlines
667 between that line and the defun braces so that
668 the whole body becomes a single line.
669 `c-max-one-liner-length' gives the maximum
670 length allowed for the resulting line. Clean
671 up occurs when the closing brace is typed.
672 defun-close-semi -- Clean up the terminating semi-colon on defuns
673 by placing the semi-colon on the same line as
674 the closing brace. Clean up occurs when the
675 semi-colon is typed.
676 list-close-comma -- Clean up commas following braces in array
677 and aggregate initializers. Clean up occurs
678 when the comma is typed.
679 scope-operator -- Clean up double colons which may designate
680 a C++ scope operator split across multiple
681 lines. Note that certain C++ constructs can
682 generate ambiguous situations. This clean up
683 only takes place when there is nothing but
684 whitespace between colons. Clean up occurs
685 when the second colon is typed.
687 The following clean ups always take place when they are on this list,
688 regardless of the auto-newline feature, since they typically don't
689 involve auto-newline inserted newlines:
691 space-before-funcall -- Insert exactly one space before the opening
692 parenthesis of a function call. Clean up
693 occurs when the opening parenthesis is typed.
694 compact-empty-funcall -- Clean up any space before the function call
695 opening parenthesis if and only if the
696 argument list is empty. This is typically
697 useful together with `space-before-funcall' to
698 get the style \"foo (bar)\" and \"foo()\".
699 Clean up occurs when the closing parenthesis
700 is typed.
701 comment-close-slash -- When a slash is typed after the comment prefix
702 on a bare line in a c-style comment, the comment
703 is closed by cleaning up preceding space and
704 inserting a star if needed."
705 :type '(set
706 (const :tag "Put \"} else {\" on one line (brace-else-brace)"
707 brace-else-brace)
708 (const :tag "Put \"} else if (...) {\" on one line (brace-elseif-brace)"
709 brace-elseif-brace)
710 (const :tag "Put \"} catch (...) {\" on one line (brace-catch-brace)"
711 brace-catch-brace)
712 (const :tag "Put empty defun braces on one line (empty-defun-braces)"
713 empty-defun-braces)
714 (const :tag "Put short function bodies on one line (one-liner-defun)"
715 one-liner-defun)
716 (const :tag "Put \"};\" ending defuns on one line (defun-close-semi)"
717 defun-close-semi)
718 (const :tag "Put \"},\" in aggregates on one line (list-close-comma)"
719 list-close-comma)
720 (const :tag "Put C++ style \"::\" on one line (scope-operator)"
721 scope-operator)
722 (const :tag "Put a space before funcall parens, e.g. \"foo (bar)\" (space-before-funcall)"
723 space-before-funcall)
724 (const :tag "Remove space before empty funcalls, e.g. \"foo()\" (compact-empty-funcall)"
725 compact-empty-funcall)
726 (const :tag "Make / on a bare line of a C-style comment close it (comment-close-slash)"
727 comment-close-slash))
728 :group 'c)
730 (defcustom-c-stylevar c-hanging-braces-alist '((brace-list-open)
731 (brace-entry-open)
732 (statement-cont)
733 (substatement-open after)
734 (block-close . c-snug-do-while)
735 (extern-lang-open after)
736 (namespace-open after)
737 (module-open after)
738 (composition-open after)
739 (inexpr-class-open after)
740 (inexpr-class-close before)
741 (arglist-cont-nonempty))
742 "*Controls the insertion of newlines before and after braces
743 when the auto-newline feature is active. This variable contains an
744 association list with elements of the following form:
745 \(SYNTACTIC-SYMBOL . ACTION).
747 When a brace (either opening or closing) is inserted, the syntactic
748 context it defines is looked up in this list, and if found, the
749 associated ACTION is used to determine where newlines are inserted.
750 If the context is not found, the default is to insert a newline both
751 before and after the brace.
753 SYNTACTIC-SYMBOL can be statement-cont, brace-list-intro,
754 inexpr-class-open, inexpr-class-close, and any of the *-open and
755 *-close symbols. See `c-offsets-alist' for details, except for
756 inexpr-class-open and inexpr-class-close, which doesn't have any
757 corresponding symbols there. Those two symbols are used for the
758 opening and closing braces, respectively, of anonymous inner classes
759 in Java.
761 ACTION can be either a function symbol or a list containing any
762 combination of the symbols `before' or `after'. If the list is empty,
763 no newlines are inserted either before or after the brace.
765 When ACTION is a function symbol, the function is called with a two
766 arguments: the syntactic symbol for the brace and the buffer position
767 at which the brace was inserted. The function must return a list as
768 described in the preceding paragraph. Note that during the call to
769 the function, the variable `c-syntactic-context' is set to the entire
770 syntactic context for the brace line."
771 :type
772 `(set ,@(mapcar
773 (lambda (elt)
774 `(cons :format "%v"
775 ,(c-constant-symbol elt 24)
776 (choice :format "%[Choice%] %v"
777 :value (before after)
778 (set :menu-tag "Before/after"
779 :format "Newline %v brace\n"
780 (const :format "%v, " before)
781 (const :format "%v " after))
782 (function :menu-tag "Function"
783 :format "Run function: %v"))))
784 '(defun-open defun-close
785 class-open class-close
786 inline-open inline-close
787 block-open block-close
788 statement-cont substatement-open statement-case-open
789 brace-list-open brace-list-close
790 brace-list-intro brace-entry-open
791 extern-lang-open extern-lang-close
792 namespace-open namespace-close
793 module-open module-close
794 composition-open composition-close
795 inexpr-class-open inexpr-class-close
796 arglist-cont-nonempty)))
797 :group 'c)
799 (defcustom c-max-one-liner-length 80
800 "Maximum length of line that clean-up \"one-liner-defun\" will compact to.
801 Zero or nil means no limit."
802 :type 'integer
803 :group 'c)
805 (defcustom-c-stylevar c-hanging-colons-alist nil
806 "*Controls the insertion of newlines before and after certain colons.
807 This variable contains an association list with elements of the
808 following form: (SYNTACTIC-SYMBOL . ACTION).
810 SYNTACTIC-SYMBOL can be any of: case-label, label, access-label,
811 member-init-intro, or inher-intro.
813 See the variable `c-hanging-braces-alist' for the semantics of this
814 variable. Note however that making ACTION a function symbol is
815 currently not supported for this variable."
816 :type
817 `(set ,@(mapcar
818 (lambda (elt)
819 `(cons :format "%v"
820 ,(c-constant-symbol elt 20)
821 (set :format "Newline %v colon\n"
822 (const :format "%v, " before)
823 (const :format "%v" after))))
824 '(case-label label access-label member-init-intro inher-intro)))
825 :group 'c)
827 (defcustom-c-stylevar c-hanging-semi&comma-criteria
828 '(c-semi&comma-inside-parenlist)
829 "*List of functions that decide whether to insert a newline or not.
830 The functions in this list are called, in order, whenever the
831 auto-newline minor mode is activated (as evidenced by a `/a' or `/ah'
832 string in the mode line), and a semicolon or comma is typed (see
833 `c-electric-semi&comma'). Each function in this list is called with
834 no arguments, and should return one of the following values:
836 nil -- no determination made, continue checking
837 'stop -- do not insert a newline, and stop checking
838 (anything else) -- insert a newline, and stop checking
840 If every function in the list is called with no determination made,
841 then no newline is inserted."
842 :type '(repeat function)
843 :group 'c)
845 (defcustom-c-stylevar c-backslash-column 48
846 "*Minimum alignment column for line continuation backslashes.
847 This is used by the functions that automatically insert or align the
848 line continuation backslashes in multiline macros. If any line in the
849 macro exceeds this column then the next tab stop from that line is
850 used as alignment column instead. See also `c-backslash-max-column'."
851 :type 'integer
852 :group 'c)
853 ;;;###autoload(put 'c-backslash-column 'safe-local-variable 'integerp)
855 (defcustom-c-stylevar c-backslash-max-column 72
856 "*Maximum alignment column for line continuation backslashes.
857 This is used by the functions that automatically insert or align the
858 line continuation backslashes in multiline macros. If any line in the
859 macro exceeds this column then the backslashes for the other lines
860 will be aligned at this column."
861 :type 'integer
862 :group 'c)
864 (defcustom c-auto-align-backslashes t
865 "*Align automatically inserted line continuation backslashes.
866 When line continuation backslashes are inserted automatically for line
867 breaks in multiline macros, e.g. by \\[c-context-line-break], they are
868 aligned with the other backslashes in the same macro if this flag is
869 set. Otherwise the inserted backslashes are preceded by a single
870 space."
871 :type 'boolean
872 :group 'c)
874 (defcustom c-backspace-function 'backward-delete-char-untabify
875 "*Function called by `c-electric-backspace' when deleting backwards."
876 :type 'function
877 :group 'c)
879 (defcustom c-delete-function 'delete-char
880 "*Function called by `c-electric-delete-forward' when deleting forwards."
881 :type 'function
882 :group 'c)
884 (defcustom c-require-final-newline
885 ;; C and C++ mandate that all nonempty files should end with a
886 ;; newline. Objective-C refers to C for all things it doesn't
887 ;; specify, so the same holds there. The other languages do not
888 ;; require it (at least not explicitly in a normative text).
889 '((c-mode . t)
890 (c++-mode . t)
891 (objc-mode . t))
892 "*Controls whether a final newline is ensured when the file is saved.
893 The value is an association list that for each language mode specifies
894 the value to give to `require-final-newline' at mode initialization;
895 see that variable for details about the value. If a language isn't
896 present on the association list, CC Mode won't touch
897 `require-final-newline' in buffers for that language."
898 :type `(set (cons :format "%v"
899 (const :format "C " c-mode)
900 (symbol :format "%v" :value ,require-final-newline))
901 (cons :format "%v"
902 (const :format "C++ " c++-mode)
903 (symbol :format "%v" :value ,require-final-newline))
904 (cons :format "%v"
905 (const :format "ObjC " objc-mode)
906 (symbol :format "%v" :value ,require-final-newline))
907 (cons :format "%v"
908 (const :format "Java " java-mode)
909 (symbol :format "%v" :value ,require-final-newline))
910 (cons :format "%v"
911 (const :format "IDL " idl-mode)
912 (symbol :format "%v" :value ,require-final-newline))
913 (cons :format "%v"
914 (const :format "Pike " pike-mode)
915 (symbol :format "%v" :value ,require-final-newline))
916 (cons :format "%v"
917 (const :format "AWK " awk-mode)
918 (symbol :format "%v" :value ,require-final-newline)))
919 :group 'c)
921 (defcustom c-electric-pound-behavior nil
922 "*List of behaviors for electric pound insertion.
923 Only currently supported behavior is `alignleft'."
924 :type '(set (const alignleft))
925 :group 'c)
927 (defcustom c-special-indent-hook nil
928 "*Hook for user defined special indentation adjustments.
929 This hook gets called after each line is indented by the mode. It is only
930 called if `c-syntactic-indentation' is non-nil."
931 :type 'hook
932 :group 'c)
934 (defcustom-c-stylevar c-label-minimum-indentation 1
935 "*Minimum indentation for lines inside code blocks.
936 This variable typically only affects code using the `gnu' style, which
937 mandates a minimum of one space in front of every line inside code
938 blocks. Specifically, the function `c-gnu-impose-minimum' on your
939 `c-special-indent-hook' is what enforces this."
940 :type 'integer
941 :group 'c)
943 (defcustom c-progress-interval 5
944 "*Interval used to update progress status during long re-indentation.
945 If a number, percentage complete gets updated after each interval of
946 that many seconds. To inhibit all messages during indentation, set
947 this variable to nil."
948 :type 'integer
949 :group 'c)
951 (defcustom c-objc-method-arg-min-delta-to-bracket 2
952 "*Minimum number of chars to the opening bracket.
954 Consider this ObjC snippet:
956 [foo blahBlah: fred
957 |<-x->|barBaz: barney
959 If `x' is less than this number then `c-lineup-ObjC-method-call-colons'
960 will defer the indentation decision to the next function. By default
961 this is `c-lineup-ObjC-method-call', which would align it like:
963 [foo blahBlahBlah: fred
964 thisIsTooDamnLong: barney
966 This behavior can be overridden by customizing the indentation of
967 `objc-method-call-cont' in the \"objc\" style."
968 :type 'integer
969 :group 'c)
971 (defcustom c-objc-method-arg-unfinished-offset 4
972 "*Offset relative to bracket if first selector is on a new line.
974 [aaaaaaaaa
975 |<-x->|bbbbbbb: cccccc
976 ddddd: eeee];"
977 :type 'integer
978 :group 'c)
980 (defcustom c-objc-method-parameter-offset 4
981 "*Offset for selector parameter on a new line (relative to first selector.
983 [aaaaaaa bbbbbbbbbb:
984 |<-x->|cccccccc
985 ddd: eeee
986 ffff: ggg];"
987 :type 'integer
988 :group 'c)
990 (defcustom c-default-style '((java-mode . "java") (awk-mode . "awk")
991 (other . "gnu"))
992 "*Style which gets installed by default when a file is visited.
994 The value of this variable can be any style defined in
995 `c-style-alist', including styles you add. The value can also be an
996 association list of major mode symbols to style names.
998 When the value is a string, all CC Mode major modes will install this
999 style by default.
1001 When the value is an alist, the major mode symbol is looked up in it
1002 and the associated style is installed. If the major mode is not
1003 listed in the alist, then the symbol `other' is looked up in it, and
1004 if found, the style in that entry is used. If `other' is not found in
1005 the alist, then \"gnu\" style is used.
1007 The default style gets installed before your mode hooks run, so you
1008 can always override the use of `c-default-style' by making calls to
1009 `c-set-style' in the appropriate mode hook."
1010 :type '(radio
1011 (string :tag "Style in all modes")
1012 (set :tag "Mode-specific styles"
1013 (cons :format "%v"
1014 (const :format "C " c-mode) (string :format "%v"))
1015 (cons :format "%v"
1016 (const :format "C++ " c++-mode) (string :format "%v"))
1017 (cons :format "%v"
1018 (const :format "ObjC " objc-mode) (string :format "%v"))
1019 (cons :format "%v"
1020 (const :format "Java " java-mode) (string :format "%v"))
1021 (cons :format "%v"
1022 (const :format "IDL " idl-mode) (string :format "%v"))
1023 (cons :format "%v"
1024 (const :format "Pike " pike-mode) (string :format "%v"))
1025 (cons :format "%v"
1026 (const :format "AWK " awk-mode) (string :format "%v"))
1027 (cons :format "%v"
1028 (const :format "Other " other) (string :format "%v"))))
1029 :group 'c)
1031 ;; *) At the start of a statement or declaration means in more detail:
1032 ;; At the closest preceding statement/declaration that starts at boi
1033 ;; and doesn't have a label or comment at that position. If there's
1034 ;; no such statement within the same block, then back up to the
1035 ;; surrounding block or statement, add the appropriate
1036 ;; statement-block-intro, defun-block-intro or substatement syntax
1037 ;; symbol and continue searching.
1038 (c-set-stylevar-fallback 'c-offsets-alist
1039 '((string . c-lineup-dont-change)
1040 ;; Anchor pos: Beg of previous line.
1041 (c . c-lineup-C-comments)
1042 ;; Anchor pos: Beg of the comment.
1043 (defun-open . 0)
1044 ;; Anchor pos: When inside a class: Boi at the func decl start.
1045 ;; When at top level: Bol at the func decl start. When inside
1046 ;; a code block (only possible in Pike): At the func decl
1047 ;; start(*).
1048 (defun-close . 0)
1049 ;; Anchor pos: At the defun block open if it's at boi,
1050 ;; otherwise boi at the func decl start.
1051 (defun-block-intro . +)
1052 ;; Anchor pos: At the block open(*).
1053 (class-open . 0)
1054 ;; Anchor pos: Boi at the class decl start.
1055 (class-close . 0)
1056 ;; Anchor pos: Boi at the class decl start.
1057 (inline-open . +)
1058 ;; Anchor pos: None for functions (inclass got the relpos
1059 ;; then), boi at the lambda start for lambdas.
1060 (inline-close . 0)
1061 ;; Anchor pos: Inexpr functions: At the lambda block open if
1062 ;; it's at boi, else at the statement(*) at boi of the start of
1063 ;; the lambda construct. Otherwise: At the inline block open
1064 ;; if it's at boi, otherwise boi at the func decl start.
1065 (func-decl-cont . +)
1066 ;; Anchor pos: Boi at the func decl start.
1067 (knr-argdecl-intro . +)
1068 ;; Anchor pos: Boi at the topmost intro line.
1069 (knr-argdecl . 0)
1070 ;; Anchor pos: At the beginning of the first K&R argdecl.
1071 (topmost-intro . 0)
1072 ;; Anchor pos: Bol at the last line of previous construct.
1073 (topmost-intro-cont . c-lineup-topmost-intro-cont)
1074 ;;Anchor pos: Bol at the topmost annotation line
1075 (annotation-top-cont . 0)
1076 ;;Anchor pos: Bol at the topmost annotation line
1077 (annotation-var-cont . +)
1078 ;; Anchor pos: Boi at the topmost intro line.
1079 (member-init-intro . +)
1080 ;; Anchor pos: Boi at the func decl arglist open.
1081 (member-init-cont . c-lineup-multi-inher)
1082 ;; Anchor pos: Beg of the first member init.
1083 (inher-intro . +)
1084 ;; Anchor pos: Boi at the class decl start.
1085 (inher-cont . c-lineup-multi-inher)
1086 ;; Anchor pos: Java: At the implements/extends keyword start.
1087 ;; Otherwise: At the inher start colon, or boi at the class
1088 ;; decl start if the first inherit clause hangs and it's not a
1089 ;; func-local inherit clause (when does that occur?).
1090 (block-open . 0)
1091 ;; Anchor pos: Inexpr statement: At the statement(*) at boi of
1092 ;; the start of the inexpr construct. Otherwise: None.
1093 (block-close . 0)
1094 ;; Anchor pos: Inexpr statement: At the inexpr block open if
1095 ;; it's at boi, else at the statement(*) at boi of the start of
1096 ;; the inexpr construct. Block hanging on a case/default
1097 ;; label: At the closest preceding label that starts at boi.
1098 ;; Otherwise: At the block open(*).
1099 (brace-list-open . 0)
1100 ;; Anchor pos: Boi at the brace list decl start, but a starting
1101 ;; "typedef" token is ignored.
1102 (brace-list-close . 0)
1103 ;; Anchor pos: At the brace list decl start(*).
1104 (brace-list-intro . +)
1105 ;; Anchor pos: At the brace list decl start(*).
1106 (brace-list-entry . 0)
1107 ;; Anchor pos: At the first non-ws char after the open paren if
1108 ;; the first token is on the same line, otherwise boi at that
1109 ;; token.
1110 (brace-entry-open . 0)
1111 ;; Anchor pos: Same as brace-list-entry.
1112 (statement . 0)
1113 ;; Anchor pos: After a `;' in the condition clause of a for
1114 ;; statement: At the first token after the starting paren.
1115 ;; Otherwise: At the preceding statement(*).
1116 (statement-cont . +)
1117 ;; Anchor pos: After the first token in the condition clause of
1118 ;; a for statement: At the first token after the starting
1119 ;; paren. Otherwise: At the containing statement(*).
1120 (statement-block-intro . +)
1121 ;; Anchor pos: In inexpr statement block: At the inexpr block
1122 ;; open if it's at boi, else at the statement(*) at boi of the
1123 ;; start of the inexpr construct. In a block hanging on a
1124 ;; case/default label: At the closest preceding label that
1125 ;; starts at boi. Otherwise: At the start of the containing
1126 ;; block(*).
1127 (statement-case-intro . +)
1128 ;; Anchor pos: At the case/default label(*).
1129 (statement-case-open . 0)
1130 ;; Anchor pos: At the case/default label(*).
1131 (substatement . +)
1132 ;; Anchor pos: At the containing statement(*).
1133 (substatement-open . +)
1134 ;; Anchor pos: At the containing statement(*).
1135 (substatement-label . 2)
1136 ;; Anchor pos: At the containing statement(*).
1137 (case-label . 0)
1138 ;; Anchor pos: At the start of the switch block(*).
1139 (access-label . -)
1140 ;; Anchor pos: Same as inclass.
1141 (label . 2)
1142 ;; Anchor pos: At the start of the containing block(*).
1143 (do-while-closure . 0)
1144 ;; Anchor pos: At the corresponding while statement(*).
1145 (else-clause . 0)
1146 ;; Anchor pos: At the corresponding if statement(*).
1147 (catch-clause . 0)
1148 ;; Anchor pos: At the previous try or catch statement clause(*).
1149 (comment-intro . (c-lineup-knr-region-comment c-lineup-comment))
1150 ;; Anchor pos: None.
1151 (arglist-intro . +)
1152 ;; Anchor pos: At the containing statement(*).
1153 ;; 2nd pos: At the open paren.
1154 (arglist-cont . (c-lineup-gcc-asm-reg 0))
1155 ;; Anchor pos: At the first token after the open paren.
1156 (arglist-cont-nonempty . (c-lineup-gcc-asm-reg c-lineup-arglist))
1157 ;; Anchor pos: At the containing statement(*).
1158 ;; 2nd pos: At the open paren.
1159 (arglist-close . +)
1160 ;; Anchor pos: At the containing statement(*).
1161 ;; 2nd pos: At the open paren.
1162 (stream-op . c-lineup-streamop)
1163 ;; Anchor pos: Boi at the first stream op in the statement.
1164 (inclass . +)
1165 ;; Anchor pos: At the class open brace if it's at boi,
1166 ;; otherwise boi at the class decl start.
1167 (cpp-macro . [0])
1168 ;; Anchor pos: None.
1169 (cpp-macro-cont . +)
1170 ;; Anchor pos: At the macro start (always at boi).
1171 (cpp-define-intro . (c-lineup-cpp-define +))
1172 ;; Anchor pos: None.
1173 (friend . 0)
1174 ;; Anchor pos: None.
1175 (objc-method-intro . [0])
1176 ;; Anchor pos: Boi.
1177 (objc-method-args-cont . c-lineup-ObjC-method-args)
1178 ;; Anchor pos: At the method start (always at boi).
1179 (objc-method-call-cont . (c-lineup-ObjC-method-call-colons
1180 c-lineup-ObjC-method-call +))
1181 ;; Anchor pos: At the open bracket.
1182 (extern-lang-open . 0)
1183 (namespace-open . 0)
1184 (module-open . 0)
1185 (composition-open . 0)
1186 ;; Anchor pos: Boi at the extern/namespace/etc keyword.
1187 (extern-lang-close . 0)
1188 (namespace-close . 0)
1189 (module-close . 0)
1190 (composition-close . 0)
1191 ;; Anchor pos: Boi at the corresponding extern/namespace/etc keyword.
1192 (inextern-lang . +)
1193 (innamespace . +)
1194 (inmodule . +)
1195 (incomposition . +)
1196 ;; Anchor pos: At the extern/namespace/etc block open brace if
1197 ;; it's at boi, otherwise boi at the keyword.
1198 (template-args-cont . (c-lineup-template-args +))
1199 ;; Anchor pos: Boi at the decl start. This might be changed;
1200 ;; the logical position is clearly the opening '<'.
1201 (inlambda . c-lineup-inexpr-block)
1202 ;; Anchor pos: None.
1203 (lambda-intro-cont . +)
1204 ;; Anchor pos: Boi at the lambda start.
1205 (inexpr-statement . +)
1206 ;; Anchor pos: None.
1207 (inexpr-class . +)
1208 ;; Anchor pos: None.
1210 (defcustom c-offsets-alist nil
1211 "Association list of syntactic element symbols and indentation offsets.
1212 As described below, each cons cell in this list has the form:
1214 (SYNTACTIC-SYMBOL . OFFSET)
1216 When a line is indented, CC Mode first determines the syntactic
1217 context of it by generating a list of symbols called syntactic
1218 elements. The global variable `c-syntactic-context' is bound to the
1219 that list. Each element in the list is in turn a list where the first
1220 element is a syntactic symbol which tells what kind of construct the
1221 indentation point is located within. More elements in the syntactic
1222 element lists are optional. If there is one more and it isn't nil,
1223 then it's the anchor position for that construct.
1225 After generating the syntactic context for the line, CC Mode
1226 calculates the absolute indentation: First the base indentation is
1227 found by using the anchor position for the first syntactic element
1228 that provides one. If none does, zero is used as base indentation.
1229 Then CC Mode looks at each syntactic element in the context in turn.
1230 It compares the car of the syntactic element against the
1231 SYNTACTIC-SYMBOL's in `c-offsets-alist'. When it finds a match, it
1232 adds OFFSET to the base indentation. The sum of this calculation is
1233 the absolute offset for line being indented.
1235 If the syntactic element does not match any in the `c-offsets-alist',
1236 the element is ignored.
1238 OFFSET can specify an offset in several different ways:
1240 If OFFSET is nil then it's ignored.
1242 If OFFSET is an integer then it's used as relative offset, i.e. it's
1243 added to the base indentation.
1245 If OFFSET is one of the symbols `+', `-', `++', `--', `*', or `/'
1246 then a positive or negative multiple of `c-basic-offset' is added to
1247 the base indentation; 1, -1, 2, -2, 0.5, and -0.5, respectively.
1249 If OFFSET is a symbol with a value binding then that value, which
1250 must be an integer, is used as relative offset.
1252 If OFFSET is a vector then its first element, which must be an
1253 integer, is used as an absolute indentation column. This overrides
1254 the previous base indentation and the relative offsets applied to
1255 it, and it becomes the new base indentation.
1257 If OFFSET is a function or a lambda expression then it's called with
1258 a single argument containing the cons of the syntactic symbol and
1259 the anchor position (or nil if there is none). The return value
1260 from the function is then reinterpreted as an offset specification.
1262 If OFFSET is a list then its elements are evaluated recursively as
1263 offset specifications. If the first element is any of the symbols
1264 below then it isn't evaluated but instead specifies how the
1265 remaining offsets in the list should be combined. If it's something
1266 else then the list is combined according the method `first'. The
1267 valid combination methods are:
1269 `first' -- Use the first offset (that doesn't evaluate to nil).
1270 `min' -- Use the minimum of all the offsets. All must be either
1271 relative or absolute - they can't be mixed.
1272 `max' -- Use the maximum of all the offsets. All must be either
1273 relative or absolute - they can't be mixed.
1274 `add' -- Add all the evaluated offsets together. Exactly one of
1275 them may be absolute, in which case the result is
1276 absolute. Any relative offsets that preceded the
1277 absolute one in the list will be ignored in that case.
1279 `c-offsets-alist' is a style variable. This means that the offsets on
1280 this variable are normally taken from the style system in CC Mode
1281 \(see `c-default-style' and `c-style-alist'). However, any offsets
1282 put explicitly on this list will override the style system when a CC
1283 Mode buffer is initialized \(there is a variable
1284 `c-old-style-variable-behavior' that changes this, though).
1286 Here is the current list of valid syntactic element symbols:
1288 string -- Inside multi-line string.
1289 c -- Inside a multi-line C style block comment.
1290 defun-open -- Brace that opens a function definition.
1291 defun-close -- Brace that closes a function definition.
1292 defun-block-intro -- The first line in a top-level defun.
1293 class-open -- Brace that opens a class definition.
1294 class-close -- Brace that closes a class definition.
1295 inline-open -- Brace that opens an in-class inline method.
1296 inline-close -- Brace that closes an in-class inline method.
1297 func-decl-cont -- The region between a function definition's
1298 argument list and the function opening brace
1299 (excluding K&R argument declarations). In C, you
1300 cannot put anything but whitespace and comments
1301 between them; in C++ and Java, throws declarations
1302 and other things can appear in this context.
1303 knr-argdecl-intro -- First line of a K&R C argument declaration.
1304 knr-argdecl -- Subsequent lines in a K&R C argument declaration.
1305 topmost-intro -- The first line in a topmost construct definition.
1306 topmost-intro-cont -- Topmost definition continuation lines.
1307 annotation-top-cont -- Topmost definition continuation line where only
1308 annotations are on previous lines.
1309 annotation-var-cont -- A continuation of a C (or like) statement where
1310 only annotations are on previous lines.
1311 member-init-intro -- First line in a member initialization list.
1312 member-init-cont -- Subsequent member initialization list lines.
1313 inher-intro -- First line of a multiple inheritance list.
1314 inher-cont -- Subsequent multiple inheritance lines.
1315 block-open -- Statement block open brace.
1316 block-close -- Statement block close brace.
1317 brace-list-open -- Open brace of an enum or static array list.
1318 brace-list-close -- Close brace of an enum or static array list.
1319 brace-list-intro -- First line in an enum or static array list.
1320 brace-list-entry -- Subsequent lines in an enum or static array list.
1321 brace-entry-open -- Subsequent lines in an enum or static array
1322 list that start with an open brace.
1323 statement -- A C (or like) statement.
1324 statement-cont -- A continuation of a C (or like) statement.
1325 statement-block-intro -- The first line in a new statement block.
1326 statement-case-intro -- The first line in a case \"block\".
1327 statement-case-open -- The first line in a case block starting with brace.
1328 substatement -- The first line after an if/while/for/do/else.
1329 substatement-open -- The brace that opens a substatement block.
1330 substatement-label -- Labeled line after an if/while/for/do/else.
1331 case-label -- A \"case\" or \"default\" label.
1332 access-label -- C++ private/protected/public access label.
1333 label -- Any ordinary label.
1334 do-while-closure -- The \"while\" that ends a do/while construct.
1335 else-clause -- The \"else\" of an if/else construct.
1336 catch-clause -- The \"catch\" or \"finally\" of a try/catch construct.
1337 comment-intro -- A line containing only a comment introduction.
1338 arglist-intro -- The first line in an argument list.
1339 arglist-cont -- Subsequent argument list lines when no
1340 arguments follow on the same line as the
1341 arglist opening paren.
1342 arglist-cont-nonempty -- Subsequent argument list lines when at
1343 least one argument follows on the same
1344 line as the arglist opening paren.
1345 arglist-close -- The solo close paren of an argument list.
1346 stream-op -- Lines continuing a stream operator construct.
1347 inclass -- The construct is nested inside a class definition.
1348 Used together with e.g. `topmost-intro'.
1349 cpp-macro -- The start of a C preprocessor macro definition.
1350 cpp-macro-cont -- Inside a multi-line C preprocessor macro definition.
1351 friend -- A C++ friend declaration.
1352 objc-method-intro -- The first line of an Objective-C method definition.
1353 objc-method-args-cont -- Lines continuing an Objective-C method definition.
1354 objc-method-call-cont -- Lines continuing an Objective-C method call.
1355 extern-lang-open -- Brace that opens an \"extern\" block.
1356 extern-lang-close -- Brace that closes an \"extern\" block.
1357 inextern-lang -- Analogous to the `inclass' syntactic symbol,
1358 but used inside \"extern\" blocks.
1359 namespace-open, namespace-close, innamespace
1360 -- Similar to the three `extern-lang' symbols, but for
1361 C++ \"namespace\" blocks.
1362 module-open, module-close, inmodule
1363 -- Similar to the three `extern-lang' symbols, but for
1364 CORBA IDL \"module\" blocks.
1365 composition-open, composition-close, incomposition
1366 -- Similar to the three `extern-lang' symbols, but for
1367 CORBA CIDL \"composition\" blocks.
1368 template-args-cont -- C++ template argument list continuations.
1369 inlambda -- In the header or body of a lambda function.
1370 lambda-intro-cont -- Continuation of the header of a lambda function.
1371 inexpr-statement -- The statement is inside an expression.
1372 inexpr-class -- The class is inside an expression. Used e.g. for
1373 Java anonymous classes."
1374 :type
1375 `(set :format "%{%t%}:
1376 Override style setting
1377 | Syntax Offset
1379 ,@(mapcar
1380 (lambda (elt)
1381 `(cons :format "%v"
1382 :value ,elt
1383 ,(c-constant-symbol (car elt) 25)
1384 (sexp :format "%v"
1385 :validate
1386 (lambda (widget)
1387 (unless (c-valid-offset (widget-value widget))
1388 (widget-put widget :error "Invalid offset")
1389 widget)))))
1390 (get 'c-offsets-alist 'c-stylevar-fallback)))
1391 :group 'c)
1393 ;; The syntactic symbols that can occur inside code blocks. Used by
1394 ;; `c-gnu-impose-minimum'.
1395 (defconst c-inside-block-syms
1396 '(defun-block-intro block-open block-close statement statement-cont
1397 statement-block-intro statement-case-intro statement-case-open
1398 substatement substatement-open substatement-label case-label label
1399 do-while-closure else-clause catch-clause inlambda annotation-var-cont))
1401 (defcustom c-style-variables-are-local-p t
1402 "*Whether style variables should be buffer local by default.
1403 If non-nil, then all indentation style related variables will be made
1404 buffer local by default. If nil, they will remain global. Variables
1405 are made buffer local when this file is loaded, and once buffer
1406 localized, they cannot be made global again.
1408 This variable must be set appropriately before CC Mode is loaded.
1410 The list of variables to buffer localize are:
1411 c-basic-offset
1412 c-comment-only-line-offset
1413 c-indent-comment-alist
1414 c-indent-comments-syntactically-p
1415 c-block-comment-prefix
1416 c-comment-prefix-regexp
1417 c-doc-comment-style
1418 c-cleanup-list
1419 c-hanging-braces-alist
1420 c-hanging-colons-alist
1421 c-hanging-semi&comma-criteria
1422 c-backslash-column
1423 c-backslash-max-column
1424 c-label-minimum-indentation
1425 c-offsets-alist
1426 c-special-indent-hook
1427 c-indentation-style"
1428 :type 'boolean
1429 :safe 'booleanp
1430 :group 'c)
1432 (defcustom c-mode-hook nil
1433 "*Hook called by `c-mode'."
1434 :type 'hook
1435 :group 'c)
1437 (defcustom c++-mode-hook nil
1438 "*Hook called by `c++-mode'."
1439 :type 'hook
1440 :group 'c)
1442 (defcustom objc-mode-hook nil
1443 "*Hook called by `objc-mode'."
1444 :type 'hook
1445 :group 'c)
1447 (defcustom java-mode-hook nil
1448 "*Hook called by `java-mode'."
1449 :type 'hook
1450 :group 'c)
1452 (defcustom idl-mode-hook nil
1453 "*Hook called by `idl-mode'."
1454 :type 'hook
1455 :group 'c)
1457 (defcustom pike-mode-hook nil
1458 "*Hook called by `pike-mode'."
1459 :type 'hook
1460 :group 'c)
1462 (defcustom awk-mode-hook nil
1463 "*Hook called by `awk-mode'."
1464 :type 'hook
1465 :group 'c)
1467 (defcustom c-mode-common-hook nil
1468 "*Hook called by all CC Mode modes for common initializations."
1469 :type 'hook
1470 :group 'c)
1472 (defcustom c-initialization-hook nil
1473 "*Hook called when the CC Mode package gets initialized.
1474 This hook is only run once per Emacs session and can be used as a
1475 `load-hook' or in place of using `eval-after-load'."
1476 :type 'hook
1477 :group 'c)
1479 (defcustom c-enable-xemacs-performance-kludge-p nil
1480 "*Enables a XEmacs only hack that may improve speed for some coding styles.
1481 For styles that hang top-level opening braces (as is common with JDK
1482 Java coding styles) this can improve performance between 3 and 60
1483 times for core indentation functions (e.g. `c-parse-state'). For
1484 styles that conform to the Emacs recommendation of putting these
1485 braces in column zero, this can degrade performance about as much.
1486 This variable only has effect in XEmacs."
1487 :type 'boolean
1488 :group 'c)
1490 (defvar c-old-style-variable-behavior nil
1491 "*Enables the old style variable behavior when non-nil.
1493 Normally the values of the style variables will override the style
1494 settings specified by the variables `c-default-style' and
1495 `c-style-alist'. However, in CC Mode 5.25 and earlier, it was the
1496 other way around, meaning that changes made to the style variables
1497 from e.g. Customize would not take effect unless special precautions
1498 were taken. That was confusing, especially for novice users.
1500 It's believed that despite this change, the new behavior will still
1501 produce the same results for most old CC Mode configurations, since
1502 all style variables are per default set in a special non-override
1503 state. Set this variable only if your configuration has stopped
1504 working due to this change.")
1506 (define-widget 'c-extra-types-widget 'radio
1507 "Internal CC Mode widget for the `*-font-lock-extra-types' variables."
1508 :args '((const :tag "none" nil)
1509 (repeat :tag "types" regexp)))
1511 (defun c-make-font-lock-extra-types-blurb (mode1 mode2 example)
1512 (concat "\
1513 *List of extra types (aside from the type keywords) to recognize in "
1514 mode1 " mode.
1515 Each list item should be a regexp matching a single identifier.
1516 " example "
1518 Note that items on this list that don't include any regexp special
1519 characters are automatically optimized using `regexp-opt', so you
1520 should not use `regexp-opt' explicitly to build regexps here.
1522 On decoration level 3 (and higher, where applicable), a method is used
1523 that finds most types and declarations by syntax alone. This variable
1524 is still used as a first step, but other types are recognized
1525 correctly anyway in most cases. Therefore this variable should be
1526 fairly restrictive and not contain patterns that are uncertain.
1528 Note that this variable is only consulted when the major mode is
1529 initialized. If you change it later you have to reinitialize CC Mode
1530 by doing \\[" mode2 "].
1532 Despite the name, this variable is not only used for font locking but
1533 also elsewhere in CC Mode to tell types from other identifiers."))
1535 ;; Note: Most of the variables below are also defined in font-lock.el
1536 ;; in older versions of Emacs, so depending on the load order we might
1537 ;; not install the values below. There's no kludge to cope with this
1538 ;; (as opposed to the *-font-lock-keywords-* variables) since the old
1539 ;; values work fairly well anyway.
1541 (defcustom c-font-lock-extra-types
1542 '("\\sw+_t"
1543 ;; Defined in C99:
1544 "bool" "complex" "imaginary"
1545 ;; Standard library types (except those matched by the _t pattern):
1546 "FILE" "lconv" "tm" "va_list" "jmp_buf"
1547 ;; I do not appreciate the following very Emacs-specific luggage
1548 ;; in the default value, but otoh it can hardly get in the way for
1549 ;; other users, and removing it would cause unnecessary grief for
1550 ;; the old timers that are used to it. /mast
1551 "Lisp_Object")
1552 (c-make-font-lock-extra-types-blurb "C" "c-mode"
1553 "For example, a value of (\"FILE\" \"\\\\sw+_t\") means the word \"FILE\"
1554 and words ending in \"_t\" are treated as type names.")
1555 :type 'c-extra-types-widget
1556 :group 'c)
1558 (defcustom c++-font-lock-extra-types
1559 '("\\sw+_t"
1560 ;; C library types (except those matched by the _t pattern):
1561 "FILE" "lconv" "tm" "va_list" "jmp_buf"
1562 ;; Some standard C++ types that came from font-lock.el.
1563 ;; Experienced C++ users says there's no clear benefit in
1564 ;; extending this to all the types in the standard library, at
1565 ;; least not when they'll be recognized without "std::" too.
1566 "istream" "istreambuf"
1567 "ostream" "ostreambuf"
1568 "ifstream" "ofstream" "fstream"
1569 "strstream" "strstreambuf" "istrstream" "ostrstream"
1570 "ios"
1571 "string" "rope"
1572 "list" "slist"
1573 "deque" "vector" "bit_vector"
1574 "set" "multiset"
1575 "map" "multimap"
1576 "hash"
1577 "hash_set" "hash_multiset"
1578 "hash_map" "hash_multimap"
1579 "stack" "queue" "priority_queue"
1580 "type_info"
1581 "iterator" "const_iterator" "reverse_iterator" "const_reverse_iterator"
1582 "reference" "const_reference")
1583 (c-make-font-lock-extra-types-blurb "C++" "c++-mode"
1584 "For example, a value of (\"string\") means the word \"string\" is treated
1585 as a type name.")
1586 :type 'c-extra-types-widget
1587 :group 'c)
1589 (defcustom objc-font-lock-extra-types
1590 (list (concat "[" c-upper "]\\sw*[" c-lower "]\\sw*"))
1591 (c-make-font-lock-extra-types-blurb "ObjC" "objc-mode" (concat
1592 "For example, a value of (\"[" c-upper "]\\\\sw*[" c-lower "]\\\\sw*\") means
1593 capitalized words are treated as type names (the requirement for a
1594 lower case char is to avoid recognizing all-caps macro and constant
1595 names)."))
1596 :type 'c-extra-types-widget
1597 :group 'c)
1599 (defcustom java-font-lock-extra-types
1600 (list (concat "[" c-upper "]\\sw*[" c-lower "]\\sw"))
1601 (c-make-font-lock-extra-types-blurb "Java" "java-mode" (concat
1602 "For example, a value of (\"[" c-upper "]\\\\sw*[" c-lower "]\\\\sw*\") means
1603 capitalized words are treated as type names (the requirement for a
1604 lower case char is to avoid recognizing all-caps constant names)."))
1605 :type 'c-extra-types-widget
1606 :group 'c)
1608 (defcustom idl-font-lock-extra-types nil
1609 (c-make-font-lock-extra-types-blurb "IDL" "idl-mode" "")
1610 :type 'c-extra-types-widget
1611 :group 'c)
1613 (defcustom pike-font-lock-extra-types
1614 (list (concat "[" c-upper "]\\sw*[" c-lower "]\\sw*"))
1615 (c-make-font-lock-extra-types-blurb "Pike" "pike-mode" (concat
1616 "For example, a value of (\"[" c-upper "]\\\\sw*[" c-lower "]\\\\sw*\") means
1617 capitalized words are treated as type names (the requirement for a
1618 lower case char is to avoid recognizing all-caps macro and constant
1619 names)."))
1620 :type 'c-extra-types-widget
1621 :group 'c)
1624 ;; Non-customizable variables, still part of the interface to CC Mode
1625 (defvar c-macro-with-semi-re nil
1626 ;; Regular expression which matches a (#define'd) symbol whose expansion
1627 ;; ends with a semicolon.
1629 ;; This variable should be set by `c-make-macros-with-semi-re' rather than
1630 ;; directly.
1632 (make-variable-buffer-local 'c-macro-with-semi-re)
1634 (defun c-make-macro-with-semi-re ()
1635 ;; Convert `c-macro-names-with-semicolon' into the regexp
1636 ;; `c-macro-with-semi-re' (or just copy it if it's already a re).
1637 (setq c-macro-with-semi-re
1638 (and
1639 c-opt-cpp-macro-define
1640 (cond
1641 ((stringp c-macro-names-with-semicolon)
1642 (copy-sequence c-macro-names-with-semicolon))
1643 ((consp c-macro-names-with-semicolon)
1644 (concat
1645 "\\<"
1646 (regexp-opt c-macro-names-with-semicolon)
1647 "\\>")) ; N.B. the PAREN param of regexp-opt isn't supported by
1648 ; all XEmacsen.
1649 ((null c-macro-names-with-semicolon)
1650 nil)
1651 (t (error "c-make-macro-with-semi-re: invalid \
1652 c-macro-names-with-semicolon: %s"
1653 c-macro-names-with-semicolon))))))
1655 (defvar c-macro-names-with-semicolon
1656 '("Q_OBJECT" "Q_PROPERTY" "Q_DECLARE" "Q_ENUMS")
1657 "List of #defined symbols whose expansion ends with a semicolon.
1658 Alternatively it can be a string, a regular expression which
1659 matches all such symbols.
1661 The \"symbols\" must be syntactically valid identifiers in the
1662 target language \(C, C++, Objective C), or \(as the case may be)
1663 the regular expression must match only valid identifiers.
1665 If you change this variable's value, call the function
1666 `c-make-macros-with-semi-re' to set the necessary internal
1667 variables.
1669 Note that currently \(2008-11-04) this variable is a prototype,
1670 and is likely to disappear or change its form soon.")
1671 (make-variable-buffer-local 'c-macro-names-with-semicolon)
1673 (defvar c-file-style nil
1674 "Variable interface for setting style via File Local Variables.
1675 In a file's Local Variable section, you can set this variable to a
1676 string suitable for `c-set-style'. When the file is visited, CC Mode
1677 will set the style of the file to this value automatically.
1679 Note that file style settings are applied before file offset settings
1680 as designated in the variable `c-file-offsets'.")
1681 (make-variable-buffer-local 'c-file-style)
1682 ;;;###autoload(put 'c-file-style 'safe-local-variable 'string-or-null-p)
1684 (defvar c-file-offsets nil
1685 "Variable interface for setting offsets via File Local Variables.
1686 In a file's Local Variable section, you can set this variable to an
1687 association list similar to the values allowed in `c-offsets-alist'.
1688 When the file is visited, CC Mode will institute these offset settings
1689 automatically.
1691 Note that file offset settings are applied after file style settings
1692 as designated in the variable `c-file-style'.")
1693 (make-variable-buffer-local 'c-file-offsets)
1695 ;; It isn't possible to specify a doc-string without specifying an
1696 ;; initial value with `defvar', so the following two variables have been
1697 ;; given doc-strings by setting the property `variable-documentation'
1698 ;; directly. It's really good not to have an initial value for
1699 ;; variables like these that always should be dynamically bound, so it's
1700 ;; worth the inconvenience.
1702 (cc-bytecomp-defvar c-syntactic-context)
1703 (defvar c-syntactic-context)
1704 (put 'c-syntactic-context 'variable-documentation
1705 "Variable containing the syntactic analysis list for a line of code.
1707 It is a list with one element for each syntactic symbol pertinent to the
1708 line, for example \"((defun-block-intro 1) (comment-intro))\".
1710 It is dynamically bound when calling \(i) a brace hanging \"action
1711 function\"; \(ii) a semicolon/comma hanging \"criteria function\"; \(iii) a
1712 \"line-up function\"; \(iv) a c-special-indent-hook function. It is also
1713 used internally by CC Mode.
1715 c-syntactic-context is always bound dynamically. It must NEVER be set
1716 statically (e.g. with `setq').")
1719 (cc-bytecomp-defvar c-syntactic-element)
1720 (defvar c-syntactic-element)
1721 (put 'c-syntactic-element 'variable-documentation
1722 "Variable containing the current syntactic element during calls to
1723 the lineup functions. The value is one of the elements in the list in
1724 `c-syntactic-context' and is a list with the symbol name in the first
1725 position, followed by zero or more elements containing any additional
1726 info associated with the syntactic symbol. There are accessor functions
1727 `c-langelem-sym', `c-langelem-pos', `c-langelem-col', and
1728 `c-langelem-2nd-pos' to access the list.
1730 Specifically, the element returned by `c-langelem-pos' is the anchor
1731 position, or nil if there isn't any. See the comments in the
1732 `c-offsets-alist' variable and the CC Mode manual for more detailed info
1733 about the data each syntactic symbol provides.
1735 This is always bound dynamically. It should never be set
1736 statically (e.g. with `setq').")
1738 (defvar c-indentation-style nil
1739 "Name of the currently installed style.
1740 Don't change this directly; call `c-set-style' instead, or set the variable
1741 `c-file-style' in the file's Local Variable list.")
1743 (defvar c-current-comment-prefix nil
1744 "The current comment prefix regexp.
1745 Set from `c-comment-prefix-regexp' at mode initialization.")
1746 (make-variable-buffer-local 'c-current-comment-prefix)
1748 ;; N.B. The next three variables are initialized in
1749 ;; c-setup-paragraph-variables. Their initializations here are "just in
1750 ;; case". ACM, 2004/2/15. They are NOT buffer local (yet?).
1751 (defvar c-string-par-start
1752 ;; (concat "\\(" (default-value 'paragraph-start) "\\)\\|[ \t]*\\\\$")
1753 "\f\\|[ \t]*\\\\?$"
1754 "Value of paragraph-start used when scanning strings.
1755 It treats escaped EOLs as whitespace.")
1757 (defvar c-string-par-separate
1758 ;; (concat "\\(" (default-value 'paragraph-separate) "\\)\\|[ \t]*\\\\$")
1759 "[ \t\f]*\\\\?$"
1760 "Value of paragraph-separate used when scanning strings.
1761 It treats escaped EOLs as whitespace.")
1763 (defvar c-sentence-end-with-esc-eol
1764 (concat "\\(\\(" (c-default-value-sentence-end) "\\)"
1765 ;; N.B.: "$" would be illegal when not enclosed like "\\($\\)".
1766 "\\|" "[.?!][]\"')}]* ?\\\\\\($\\)[ \t\n]*"
1767 "\\)")
1768 "Value used like sentence-end used when scanning strings.
1769 It treats escaped EOLs as whitespace.")
1772 (cc-provide 'cc-vars)
1774 ;;; cc-vars.el ends here