More CL cleanups and reduction of use of cl.el.
[emacs.git] / lisp / progmodes / cc-vars.el
blob5201e4a26ed6ef25fae90981269a4b771465bf16
1 ;;; cc-vars.el --- user customization variables for CC Mode
3 ;; Copyright (C) 1985, 1987, 1992-2012 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 :version "24.1"
353 :type '(radio
354 (const :tag "Functions are at the top-level" t)
355 (const :tag "Functions are also recognized inside declaration scopes" go-outward))
356 :group 'c)
358 (defcustom-c-stylevar c-comment-only-line-offset 0
359 "*Extra offset for line which contains only the start of a comment.
360 Can contain an integer or a cons cell of the form:
362 (NON-ANCHORED-OFFSET . ANCHORED-OFFSET)
364 Where NON-ANCHORED-OFFSET is the amount of offset given to
365 non-column-zero anchored comment-only lines, and ANCHORED-OFFSET is
366 the amount of offset to give column-zero anchored comment-only lines.
367 Just an integer as value is equivalent to (<val> . -1000).
369 Note that this variable only has effect when the `c-lineup-comment'
370 lineup function is used on the `comment-intro' syntactic symbol (the
371 default)."
372 :type '(choice (integer :tag "Non-anchored offset" 0)
373 (cons :tag "Non-anchored & anchored offset"
374 :value (0 . 0)
375 (integer :tag "Non-anchored offset")
376 (integer :tag "Anchored offset")))
377 :group 'c)
379 (defcustom-c-stylevar c-indent-comment-alist
380 '((anchored-comment . (column . 0))
381 (end-block . (space . 1))
382 (cpp-end-block . (space . 2)))
383 "*Specifies how \\[indent-for-comment] calculates the comment start column.
384 This is an association list that contains entries of the form:
386 (LINE-TYPE . INDENT-SPEC)
388 LINE-TYPE specifies a type of line as described below, and INDENT-SPEC
389 says what \\[indent-for-comment] should do when used on that type of line.
391 The recognized values for LINE-TYPE are:
393 empty-line -- The line is empty.
394 anchored-comment -- The line contains a comment that starts in column 0.
395 end-block -- The line contains a solitary block closing brace.
396 cpp-end-block -- The line contains a preprocessor directive that
397 closes a block, i.e. either \"#endif\" or \"#else\".
398 other -- The line does not match any other entry
399 currently on the list.
401 An INDENT-SPEC is a cons cell of the form:
403 (ACTION . VALUE)
405 ACTION says how \\[indent-for-comment] should align the comment, and
406 VALUE is interpreted depending on ACTION. ACTION can be any of the
407 following:
409 space -- Put VALUE spaces between the end of the line and the start
410 of the comment.
411 column -- Start the comment at the column VALUE. If the line is
412 longer than that, the comment is preceded by a single
413 space. If VALUE is nil, `comment-column' is used.
414 align -- Align the comment with one on the previous line, if there
415 is any. If the line is too long, the comment is preceded
416 by a single space. If there isn't a comment start on the
417 previous line, the behavior is specified by VALUE, which
418 in turn is interpreted as an INDENT-SPEC.
420 If a LINE-TYPE is missing, then \\[indent-for-comment] indents the comment
421 according to `comment-column'.
423 Note that a non-nil value on `c-indent-comments-syntactically-p'
424 overrides this variable, so empty lines are indented syntactically
425 in that case, i.e. as if \\[c-indent-command] was used instead."
426 :type
427 (let ((space '(cons :tag "space"
428 :format "%v"
429 :value (space . 1)
430 (const :format "space " space)
431 (integer :format "%v")))
432 (column '(cons :tag "column"
433 :format "%v"
434 (const :format "column " column)
435 (c-integer-or-nil :format "%v"))))
436 `(set ,@(mapcar
437 (lambda (elt)
438 `(cons :format "%v"
439 ,(c-constant-symbol elt 20)
440 (choice
441 :format "%[Choice%] %v"
442 :value (column . nil)
443 ,space
444 ,column
445 (cons :tag "align"
446 :format "%v"
447 (const :format "align " align)
448 (choice
449 :format "%[Choice%] %v"
450 :value (column . nil)
451 ,space
452 ,column)))))
453 '(empty-line anchored-comment end-block cpp-end-block other))))
454 :group 'c)
456 (defcustom-c-stylevar c-indent-comments-syntactically-p nil
457 "*Specifies how \\[indent-for-comment] should handle comment-only lines.
458 When this variable is non-nil, comment-only lines are indented
459 according to syntactic analysis via `c-offsets-alist'. Otherwise, the
460 comment is indented as if it was preceded by code. Note that this
461 variable does not affect how the normal line indentation treats
462 comment-only lines."
463 :type 'boolean
464 :group 'c)
466 (make-obsolete-variable 'c-comment-continuation-stars
467 'c-block-comment-prefix "21.1")
469 ;; Although c-comment-continuation-stars is obsolete, we look at it in
470 ;; some places in CC Mode anyway, so make the compiler ignore it
471 ;; during our compilation.
472 ;; [This is unclean; better to use `symbol-value'. --ttn]
473 ;;(cc-bytecomp-obsolete-var c-comment-continuation-stars)
474 ;;(cc-bytecomp-defvar c-comment-continuation-stars)
476 (defcustom-c-stylevar c-block-comment-prefix
477 (if (boundp 'c-comment-continuation-stars)
478 (symbol-value 'c-comment-continuation-stars)
479 "* ")
480 "*Specifies the line prefix of continued C-style block comments.
481 You should set this variable to the literal string that gets inserted
482 at the front of continued block style comment lines. This should
483 either be the empty string, or some characters without preceding
484 spaces. To adjust the alignment under the comment starter, put an
485 appropriate value on the `c' syntactic symbol (see the
486 `c-offsets-alist' variable).
488 It's only used when a one-line block comment is broken into two or
489 more lines for the first time; otherwise the appropriate prefix is
490 adapted from the comment. This variable is not used for C++ line
491 style comments."
492 :type 'string
493 :group 'c)
495 (defcustom-c-stylevar c-comment-prefix-regexp
496 '((pike-mode . "//+!?\\|\\**")
497 (awk-mode . "#+")
498 (other . "//+\\|\\**"))
499 "*Regexp to match the line prefix inside comments.
500 This regexp is used to recognize the fill prefix inside comments for
501 correct paragraph filling and other things.
503 If this variable is a string, it will be used in all CC Mode major
504 modes. It can also be an association list, to associate specific
505 regexps to specific major modes. The symbol for the major mode is
506 looked up in the association list, and its value is used as the line
507 prefix regexp. If it's not found, then the symbol `other' is looked
508 up and its value is used instead.
510 The regexp should match the prefix used in both C++ style line
511 comments and C style block comments, but it does not need to match a
512 block comment starter. In other words, it should at least match
513 \"//\" for line comments and the string in `c-block-comment-prefix',
514 which is sometimes inserted by CC Mode inside block comments. It
515 should not match any surrounding whitespace.
517 Note that CC Mode uses this variable to set many other variables that
518 handle the paragraph filling. That's done at mode initialization or
519 when you switch to a style which sets this variable. Thus, if you
520 change it in some other way, e.g. interactively in a CC Mode buffer,
521 you will need to do \\[c-setup-paragraph-variables] afterwards so that
522 the other variables are updated with the new value.
524 Note also that when CC Mode starts up, all variables are initialized
525 before the mode hooks are run. It's therefore necessary to make a
526 call to `c-setup-paragraph-variables' explicitly if you change this
527 variable in a mode hook."
528 :type '(radio
529 (regexp :tag "Regexp for all modes")
530 (list
531 :tag "Mode-specific regexps"
532 (set
533 :inline t :format "%v"
534 (cons :format "%v"
535 (const :format "C " c-mode) (regexp :format "%v"))
536 (cons :format "%v"
537 (const :format "C++ " c++-mode) (regexp :format "%v"))
538 (cons :format "%v"
539 (const :format "ObjC " objc-mode) (regexp :format "%v"))
540 (cons :format "%v"
541 (const :format "Java " java-mode) (regexp :format "%v"))
542 (cons :format "%v"
543 (const :format "IDL " idl-mode) (regexp :format "%v"))
544 (cons :format "%v"
545 (const :format "Pike " pike-mode) (regexp :format "%v"))
546 (cons :format "%v"
547 (const :format "AWK " awk-mode) (regexp :format "%v")))
548 (cons :format " %v"
549 (const :format "Other " other) (regexp :format "%v"))))
550 :group 'c)
552 (defcustom-c-stylevar c-doc-comment-style
553 '((java-mode . javadoc)
554 (pike-mode . autodoc)
555 (c-mode . gtkdoc))
556 "*Specifies documentation comment style(s) to recognize.
557 This is primarily used to fontify doc comments and the markup within
558 them, e.g. Javadoc comments.
560 The value can be any of the following symbols for various known doc
561 comment styles:
563 javadoc -- Javadoc style for \"/** ... */\" comments (default in Java mode).
564 autodoc -- Pike autodoc style for \"//! ...\" comments (default in Pike mode).
565 gtkdoc -- GtkDoc style for \"/** ... **/\" comments (default in C mode).
567 The value may also be a list of doc comment styles, in which case all
568 of them are recognized simultaneously (presumably with markup cues
569 that don't conflict).
571 The value may also be an association list to specify different doc
572 comment styles for different languages. The symbol for the major mode
573 is then looked up in the alist, and the value of that element is
574 interpreted as above if found. If it isn't found then the symbol
575 `other' is looked up and its value is used instead.
577 Note that CC Mode uses this variable to set other variables that
578 handle fontification etc. That's done at mode initialization or when
579 you switch to a style which sets this variable. Thus, if you change
580 it in some other way, e.g. interactively in a CC Mode buffer, you will
581 need to do \\[java-mode] (or whatever mode you're currently using) to
582 reinitialize.
584 Note also that when CC Mode starts up, the other variables are
585 modified before the mode hooks are run. If you change this variable
586 in a mode hook, you have to call `c-setup-doc-comment-style'
587 afterwards to redo that work."
588 ;; Symbols other than those documented above may be used on this
589 ;; variable. If a variable exists that has that name with
590 ;; "-font-lock-keywords" appended, its value is prepended to the
591 ;; font lock keywords list. If it's a function then it's called and
592 ;; the result is prepended.
593 :type '(radio
594 (c-symbol-list :tag "Doc style(s) in all modes")
595 (list
596 :tag "Mode-specific doc styles"
597 (set
598 :inline t :format "%v"
599 (cons :format "%v"
600 (const :format "C " c-mode)
601 (c-symbol-list :format "%v"))
602 (cons :format "%v"
603 (const :format "C++ " c++-mode)
604 (c-symbol-list :format "%v"))
605 (cons :format "%v"
606 (const :format "ObjC " objc-mode)
607 (c-symbol-list :format "%v"))
608 (cons :format "%v"
609 (const :format "Java " java-mode)
610 (c-symbol-list :format "%v"))
611 (cons :format "%v"
612 (const :format "IDL " idl-mode)
613 (c-symbol-list :format "%v"))
614 (cons :format "%v"
615 (const :format "Pike " pike-mode)
616 (c-symbol-list :format "%v"))
617 (cons :format "%v"
618 (const :format "AWK " awk-mode)
619 (c-symbol-list :format "%v"))
620 (cons :format "%v"
621 (const :format "Other " other)
622 (c-symbol-list :format "%v")))))
623 :group 'c)
625 (defcustom c-ignore-auto-fill '(string cpp code)
626 "*List of contexts in which automatic filling never occurs.
627 If Auto Fill mode is active, it will be temporarily disabled if point
628 is in any context on this list. It's e.g. useful to enable Auto Fill
629 in comments only, but not in strings or normal code. The valid
630 contexts are:
632 string -- inside a string or character literal
633 c -- inside a C style block comment
634 c++ -- inside a C++ style line comment
635 cpp -- inside a preprocessor directive
636 code -- anywhere else, i.e. in normal code"
637 :type '(set
638 (const :tag "String literals" string)
639 (const :tag "C style block comments" c)
640 (const :tag "C++ style line comments" c++)
641 (const :tag "Preprocessor directives" cpp)
642 (const :tag "Normal code" code))
643 :group 'c)
645 (defcustom-c-stylevar c-cleanup-list '(scope-operator)
646 "*List of various C/C++/ObjC constructs to \"clean up\".
647 The following clean ups only take place when the auto-newline feature
648 is turned on, as evidenced by the `/la' appearing next to the mode
649 name:
651 brace-else-brace -- Clean up \"} else {\" constructs by placing
652 entire construct on a single line. This clean
653 up only takes place when there is nothing but
654 white space between the braces and the `else'.
655 Clean up occurs when the open brace after the
656 `else' is typed.
657 brace-elseif-brace -- Similar to brace-else-brace, but clean up
658 \"} else if (...) {\" constructs. Clean up
659 occurs after the open parenthesis and the open
660 brace.
661 brace-catch-brace -- Similar to brace-elseif-brace, but clean up
662 \"} catch (...) {\" constructs.
663 empty-defun-braces -- Clean up empty defun braces by placing the
664 braces on the same line. Clean up occurs when
665 the defun closing brace is typed.
666 one-liner-defun -- If the code inside a function body can fit in
667 a single line, then remove any newlines
668 between that line and the defun braces so that
669 the whole body becomes a single line.
670 `c-max-one-liner-length' gives the maximum
671 length allowed for the resulting line. Clean
672 up occurs when the closing brace is typed.
673 defun-close-semi -- Clean up the terminating semi-colon on defuns
674 by placing the semi-colon on the same line as
675 the closing brace. Clean up occurs when the
676 semi-colon is typed.
677 list-close-comma -- Clean up commas following braces in array
678 and aggregate initializers. Clean up occurs
679 when the comma is typed.
680 scope-operator -- Clean up double colons which may designate
681 a C++ scope operator split across multiple
682 lines. Note that certain C++ constructs can
683 generate ambiguous situations. This clean up
684 only takes place when there is nothing but
685 whitespace between colons. Clean up occurs
686 when the second colon is typed.
688 The following clean ups always take place when they are on this list,
689 regardless of the auto-newline feature, since they typically don't
690 involve auto-newline inserted newlines:
692 space-before-funcall -- Insert exactly one space before the opening
693 parenthesis of a function call. Clean up
694 occurs when the opening parenthesis is typed.
695 compact-empty-funcall -- Clean up any space before the function call
696 opening parenthesis if and only if the
697 argument list is empty. This is typically
698 useful together with `space-before-funcall' to
699 get the style \"foo (bar)\" and \"foo()\".
700 Clean up occurs when the closing parenthesis
701 is typed.
702 comment-close-slash -- When a slash is typed after the comment prefix
703 on a bare line in a c-style comment, the comment
704 is closed by cleaning up preceding space and
705 inserting a star if needed."
706 :type '(set
707 (const :tag "Put \"} else {\" on one line (brace-else-brace)"
708 brace-else-brace)
709 (const :tag "Put \"} else if (...) {\" on one line (brace-elseif-brace)"
710 brace-elseif-brace)
711 (const :tag "Put \"} catch (...) {\" on one line (brace-catch-brace)"
712 brace-catch-brace)
713 (const :tag "Put empty defun braces on one line (empty-defun-braces)"
714 empty-defun-braces)
715 (const :tag "Put short function bodies on one line (one-liner-defun)"
716 one-liner-defun)
717 (const :tag "Put \"};\" ending defuns on one line (defun-close-semi)"
718 defun-close-semi)
719 (const :tag "Put \"},\" in aggregates on one line (list-close-comma)"
720 list-close-comma)
721 (const :tag "Put C++ style \"::\" on one line (scope-operator)"
722 scope-operator)
723 (const :tag "Put a space before funcall parens, e.g. \"foo (bar)\" (space-before-funcall)"
724 space-before-funcall)
725 (const :tag "Remove space before empty funcalls, e.g. \"foo()\" (compact-empty-funcall)"
726 compact-empty-funcall)
727 (const :tag "Make / on a bare line of a C-style comment close it (comment-close-slash)"
728 comment-close-slash))
729 :group 'c)
731 (defcustom-c-stylevar c-hanging-braces-alist '((brace-list-open)
732 (brace-entry-open)
733 (statement-cont)
734 (substatement-open after)
735 (block-close . c-snug-do-while)
736 (extern-lang-open after)
737 (namespace-open after)
738 (module-open after)
739 (composition-open after)
740 (inexpr-class-open after)
741 (inexpr-class-close before)
742 (arglist-cont-nonempty))
743 "*Controls the insertion of newlines before and after braces
744 when the auto-newline feature is active. This variable contains an
745 association list with elements of the following form:
746 \(SYNTACTIC-SYMBOL . ACTION).
748 When a brace (either opening or closing) is inserted, the syntactic
749 context it defines is looked up in this list, and if found, the
750 associated ACTION is used to determine where newlines are inserted.
751 If the context is not found, the default is to insert a newline both
752 before and after the brace.
754 SYNTACTIC-SYMBOL can be statement-cont, brace-list-intro,
755 inexpr-class-open, inexpr-class-close, and any of the *-open and
756 *-close symbols. See `c-offsets-alist' for details, except for
757 inexpr-class-open and inexpr-class-close, which doesn't have any
758 corresponding symbols there. Those two symbols are used for the
759 opening and closing braces, respectively, of anonymous inner classes
760 in Java.
762 ACTION can be either a function symbol or a list containing any
763 combination of the symbols `before' or `after'. If the list is empty,
764 no newlines are inserted either before or after the brace.
766 When ACTION is a function symbol, the function is called with a two
767 arguments: the syntactic symbol for the brace and the buffer position
768 at which the brace was inserted. The function must return a list as
769 described in the preceding paragraph. Note that during the call to
770 the function, the variable `c-syntactic-context' is set to the entire
771 syntactic context for the brace line."
772 :type
773 `(set ,@(mapcar
774 (lambda (elt)
775 `(cons :format "%v"
776 ,(c-constant-symbol elt 24)
777 (choice :format "%[Choice%] %v"
778 :value (before after)
779 (set :menu-tag "Before/after"
780 :format "Newline %v brace\n"
781 (const :format "%v, " before)
782 (const :format "%v " after))
783 (function :menu-tag "Function"
784 :format "Run function: %v"))))
785 '(defun-open defun-close
786 class-open class-close
787 inline-open inline-close
788 block-open block-close
789 statement-cont substatement-open statement-case-open
790 brace-list-open brace-list-close
791 brace-list-intro brace-entry-open
792 extern-lang-open extern-lang-close
793 namespace-open namespace-close
794 module-open module-close
795 composition-open composition-close
796 inexpr-class-open inexpr-class-close
797 arglist-cont-nonempty)))
798 :group 'c)
800 (defcustom c-max-one-liner-length 80
801 "Maximum length of line that clean-up \"one-liner-defun\" will compact to.
802 Zero or nil means no limit."
803 :type 'integer
804 :group 'c)
806 (defcustom-c-stylevar c-hanging-colons-alist nil
807 "*Controls the insertion of newlines before and after certain colons.
808 This variable contains an association list with elements of the
809 following form: (SYNTACTIC-SYMBOL . ACTION).
811 SYNTACTIC-SYMBOL can be any of: case-label, label, access-label,
812 member-init-intro, or inher-intro.
814 See the variable `c-hanging-braces-alist' for the semantics of this
815 variable. Note however that making ACTION a function symbol is
816 currently not supported for this variable."
817 :type
818 `(set ,@(mapcar
819 (lambda (elt)
820 `(cons :format "%v"
821 ,(c-constant-symbol elt 20)
822 (set :format "Newline %v colon\n"
823 (const :format "%v, " before)
824 (const :format "%v" after))))
825 '(case-label label access-label member-init-intro inher-intro)))
826 :group 'c)
828 (defcustom-c-stylevar c-hanging-semi&comma-criteria
829 '(c-semi&comma-inside-parenlist)
830 "*List of functions that decide whether to insert a newline or not.
831 The functions in this list are called, in order, whenever the
832 auto-newline minor mode is activated (as evidenced by a `/a' or `/ah'
833 string in the mode line), and a semicolon or comma is typed (see
834 `c-electric-semi&comma'). Each function in this list is called with
835 no arguments, and should return one of the following values:
837 nil -- no determination made, continue checking
838 'stop -- do not insert a newline, and stop checking
839 (anything else) -- insert a newline, and stop checking
841 If every function in the list is called with no determination made,
842 then no newline is inserted."
843 :type '(repeat function)
844 :group 'c)
846 (defcustom-c-stylevar c-backslash-column 48
847 "*Minimum alignment column for line continuation backslashes.
848 This is used by the functions that automatically insert or align the
849 line continuation backslashes in multiline macros. If any line in the
850 macro exceeds this column then the next tab stop from that line is
851 used as alignment column instead. See also `c-backslash-max-column'."
852 :type 'integer
853 :group 'c)
854 ;;;###autoload(put 'c-backslash-column 'safe-local-variable 'integerp)
856 (defcustom-c-stylevar c-backslash-max-column 72
857 "*Maximum alignment column for line continuation backslashes.
858 This is used by the functions that automatically insert or align the
859 line continuation backslashes in multiline macros. If any line in the
860 macro exceeds this column then the backslashes for the other lines
861 will be aligned at this column."
862 :type 'integer
863 :group 'c)
865 (defcustom c-auto-align-backslashes t
866 "*Align automatically inserted line continuation backslashes.
867 When line continuation backslashes are inserted automatically for line
868 breaks in multiline macros, e.g. by \\[c-context-line-break], they are
869 aligned with the other backslashes in the same macro if this flag is
870 set. Otherwise the inserted backslashes are preceded by a single
871 space."
872 :type 'boolean
873 :group 'c)
875 (defcustom c-backspace-function 'backward-delete-char-untabify
876 "*Function called by `c-electric-backspace' when deleting backwards."
877 :type 'function
878 :group 'c)
880 (defcustom c-delete-function 'delete-char
881 "*Function called by `c-electric-delete-forward' when deleting forwards."
882 :type 'function
883 :group 'c)
885 (defcustom c-require-final-newline
886 ;; C and C++ mandate that all nonempty files should end with a
887 ;; newline. Objective-C refers to C for all things it doesn't
888 ;; specify, so the same holds there. The other languages do not
889 ;; require it (at least not explicitly in a normative text).
890 '((c-mode . t)
891 (c++-mode . t)
892 (objc-mode . t))
893 "*Controls whether a final newline is ensured when the file is saved.
894 The value is an association list that for each language mode specifies
895 the value to give to `require-final-newline' at mode initialization;
896 see that variable for details about the value. If a language isn't
897 present on the association list, CC Mode won't touch
898 `require-final-newline' in buffers for that language."
899 :type `(set (cons :format "%v"
900 (const :format "C " c-mode)
901 (symbol :format "%v" :value ,require-final-newline))
902 (cons :format "%v"
903 (const :format "C++ " c++-mode)
904 (symbol :format "%v" :value ,require-final-newline))
905 (cons :format "%v"
906 (const :format "ObjC " objc-mode)
907 (symbol :format "%v" :value ,require-final-newline))
908 (cons :format "%v"
909 (const :format "Java " java-mode)
910 (symbol :format "%v" :value ,require-final-newline))
911 (cons :format "%v"
912 (const :format "IDL " idl-mode)
913 (symbol :format "%v" :value ,require-final-newline))
914 (cons :format "%v"
915 (const :format "Pike " pike-mode)
916 (symbol :format "%v" :value ,require-final-newline))
917 (cons :format "%v"
918 (const :format "AWK " awk-mode)
919 (symbol :format "%v" :value ,require-final-newline)))
920 :group 'c)
922 (defcustom c-electric-pound-behavior nil
923 "*List of behaviors for electric pound insertion.
924 Only currently supported behavior is `alignleft'."
925 :type '(set (const alignleft))
926 :group 'c)
928 (defcustom c-special-indent-hook nil
929 "*Hook for user defined special indentation adjustments.
930 This hook gets called after each line is indented by the mode. It is only
931 called if `c-syntactic-indentation' is non-nil."
932 :type 'hook
933 :group 'c)
935 (defcustom-c-stylevar c-label-minimum-indentation 1
936 "*Minimum indentation for lines inside code blocks.
937 This variable typically only affects code using the `gnu' style, which
938 mandates a minimum of one space in front of every line inside code
939 blocks. Specifically, the function `c-gnu-impose-minimum' on your
940 `c-special-indent-hook' is what enforces this."
941 :type 'integer
942 :group 'c)
944 (defcustom c-progress-interval 5
945 "*Interval used to update progress status during long re-indentation.
946 If a number, percentage complete gets updated after each interval of
947 that many seconds. To inhibit all messages during indentation, set
948 this variable to nil."
949 :type 'integer
950 :group 'c)
952 (defcustom c-objc-method-arg-min-delta-to-bracket 2
953 "*Minimum number of chars to the opening bracket.
955 Consider this ObjC snippet:
957 [foo blahBlah: fred
958 |<-x->|barBaz: barney
960 If `x' is less than this number then `c-lineup-ObjC-method-call-colons'
961 will defer the indentation decision to the next function. By default
962 this is `c-lineup-ObjC-method-call', which would align it like:
964 [foo blahBlahBlah: fred
965 thisIsTooDamnLong: barney
967 This behavior can be overridden by customizing the indentation of
968 `objc-method-call-cont' in the \"objc\" style."
969 :type 'integer
970 :group 'c)
972 (defcustom c-objc-method-arg-unfinished-offset 4
973 "*Offset relative to bracket if first selector is on a new line.
975 [aaaaaaaaa
976 |<-x->|bbbbbbb: cccccc
977 ddddd: eeee];"
978 :type 'integer
979 :group 'c)
981 (defcustom c-objc-method-parameter-offset 4
982 "*Offset for selector parameter on a new line (relative to first selector.
984 [aaaaaaa bbbbbbbbbb:
985 |<-x->|cccccccc
986 ddd: eeee
987 ffff: ggg];"
988 :type 'integer
989 :group 'c)
991 (defcustom c-default-style '((java-mode . "java") (awk-mode . "awk")
992 (other . "gnu"))
993 "*Style which gets installed by default when a file is visited.
995 The value of this variable can be any style defined in
996 `c-style-alist', including styles you add. The value can also be an
997 association list of major mode symbols to style names.
999 When the value is a string, all CC Mode major modes will install this
1000 style by default.
1002 When the value is an alist, the major mode symbol is looked up in it
1003 and the associated style is installed. If the major mode is not
1004 listed in the alist, then the symbol `other' is looked up in it, and
1005 if found, the style in that entry is used. If `other' is not found in
1006 the alist, then \"gnu\" style is used.
1008 The default style gets installed before your mode hooks run, so you
1009 can always override the use of `c-default-style' by making calls to
1010 `c-set-style' in the appropriate mode hook."
1011 :type '(radio
1012 (string :tag "Style in all modes")
1013 (set :tag "Mode-specific styles"
1014 (cons :format "%v"
1015 (const :format "C " c-mode) (string :format "%v"))
1016 (cons :format "%v"
1017 (const :format "C++ " c++-mode) (string :format "%v"))
1018 (cons :format "%v"
1019 (const :format "ObjC " objc-mode) (string :format "%v"))
1020 (cons :format "%v"
1021 (const :format "Java " java-mode) (string :format "%v"))
1022 (cons :format "%v"
1023 (const :format "IDL " idl-mode) (string :format "%v"))
1024 (cons :format "%v"
1025 (const :format "Pike " pike-mode) (string :format "%v"))
1026 (cons :format "%v"
1027 (const :format "AWK " awk-mode) (string :format "%v"))
1028 (cons :format "%v"
1029 (const :format "Other " other) (string :format "%v"))))
1030 :group 'c)
1032 ;; *) At the start of a statement or declaration means in more detail:
1033 ;; At the closest preceding statement/declaration that starts at boi
1034 ;; and doesn't have a label or comment at that position. If there's
1035 ;; no such statement within the same block, then back up to the
1036 ;; surrounding block or statement, add the appropriate
1037 ;; statement-block-intro, defun-block-intro or substatement syntax
1038 ;; symbol and continue searching.
1039 (c-set-stylevar-fallback 'c-offsets-alist
1040 '((string . c-lineup-dont-change)
1041 ;; Anchor pos: Beg of previous line.
1042 (c . c-lineup-C-comments)
1043 ;; Anchor pos: Beg of the comment.
1044 (defun-open . 0)
1045 ;; Anchor pos: When inside a class: Boi at the func decl start.
1046 ;; When at top level: Bol at the func decl start. When inside
1047 ;; a code block (only possible in Pike): At the func decl
1048 ;; start(*).
1049 (defun-close . 0)
1050 ;; Anchor pos: At the defun block open if it's at boi,
1051 ;; otherwise boi at the func decl start.
1052 (defun-block-intro . +)
1053 ;; Anchor pos: At the block open(*).
1054 (class-open . 0)
1055 ;; Anchor pos: Boi at the class decl start.
1056 (class-close . 0)
1057 ;; Anchor pos: Boi at the class decl start.
1058 (inline-open . +)
1059 ;; Anchor pos: None for functions (inclass got the relpos
1060 ;; then), boi at the lambda start for lambdas.
1061 (inline-close . 0)
1062 ;; Anchor pos: Inexpr functions: At the lambda block open if
1063 ;; it's at boi, else at the statement(*) at boi of the start of
1064 ;; the lambda construct. Otherwise: At the inline block open
1065 ;; if it's at boi, otherwise boi at the func decl start.
1066 (func-decl-cont . +)
1067 ;; Anchor pos: Boi at the func decl start.
1068 (knr-argdecl-intro . +)
1069 ;; Anchor pos: Boi at the topmost intro line.
1070 (knr-argdecl . 0)
1071 ;; Anchor pos: At the beginning of the first K&R argdecl.
1072 (topmost-intro . 0)
1073 ;; Anchor pos: Bol at the last line of previous construct.
1074 (topmost-intro-cont . c-lineup-topmost-intro-cont)
1075 ;;Anchor pos: Bol at the topmost annotation line
1076 (annotation-top-cont . 0)
1077 ;;Anchor pos: Bol at the topmost annotation line
1078 (annotation-var-cont . +)
1079 ;; Anchor pos: Boi at the topmost intro line.
1080 (member-init-intro . +)
1081 ;; Anchor pos: Boi at the func decl arglist open.
1082 (member-init-cont . c-lineup-multi-inher)
1083 ;; Anchor pos: Beg of the first member init.
1084 (inher-intro . +)
1085 ;; Anchor pos: Boi at the class decl start.
1086 (inher-cont . c-lineup-multi-inher)
1087 ;; Anchor pos: Java: At the implements/extends keyword start.
1088 ;; Otherwise: At the inher start colon, or boi at the class
1089 ;; decl start if the first inherit clause hangs and it's not a
1090 ;; func-local inherit clause (when does that occur?).
1091 (block-open . 0)
1092 ;; Anchor pos: Inexpr statement: At the statement(*) at boi of
1093 ;; the start of the inexpr construct. Otherwise: None.
1094 (block-close . 0)
1095 ;; Anchor pos: Inexpr statement: At the inexpr block open if
1096 ;; it's at boi, else at the statement(*) at boi of the start of
1097 ;; the inexpr construct. Block hanging on a case/default
1098 ;; label: At the closest preceding label that starts at boi.
1099 ;; Otherwise: At the block open(*).
1100 (brace-list-open . 0)
1101 ;; Anchor pos: Boi at the brace list decl start, but a starting
1102 ;; "typedef" token is ignored.
1103 (brace-list-close . 0)
1104 ;; Anchor pos: At the brace list decl start(*).
1105 (brace-list-intro . +)
1106 ;; Anchor pos: At the brace list decl start(*).
1107 (brace-list-entry . 0)
1108 ;; Anchor pos: At the first non-ws char after the open paren if
1109 ;; the first token is on the same line, otherwise boi at that
1110 ;; token.
1111 (brace-entry-open . 0)
1112 ;; Anchor pos: Same as brace-list-entry.
1113 (statement . 0)
1114 ;; Anchor pos: After a `;' in the condition clause of a for
1115 ;; statement: At the first token after the starting paren.
1116 ;; Otherwise: At the preceding statement(*).
1117 (statement-cont . +)
1118 ;; Anchor pos: After the first token in the condition clause of
1119 ;; a for statement: At the first token after the starting
1120 ;; paren. Otherwise: At the containing statement(*).
1121 (statement-block-intro . +)
1122 ;; Anchor pos: In inexpr statement block: At the inexpr block
1123 ;; open if it's at boi, else at the statement(*) at boi of the
1124 ;; start of the inexpr construct. In a block hanging on a
1125 ;; case/default label: At the closest preceding label that
1126 ;; starts at boi. Otherwise: At the start of the containing
1127 ;; block(*).
1128 (statement-case-intro . +)
1129 ;; Anchor pos: At the case/default label(*).
1130 (statement-case-open . 0)
1131 ;; Anchor pos: At the case/default label(*).
1132 (substatement . +)
1133 ;; Anchor pos: At the containing statement(*).
1134 (substatement-open . +)
1135 ;; Anchor pos: At the containing statement(*).
1136 (substatement-label . 2)
1137 ;; Anchor pos: At the containing statement(*).
1138 (case-label . 0)
1139 ;; Anchor pos: At the start of the switch block(*).
1140 (access-label . -)
1141 ;; Anchor pos: Same as inclass.
1142 (label . 2)
1143 ;; Anchor pos: At the start of the containing block(*).
1144 (do-while-closure . 0)
1145 ;; Anchor pos: At the corresponding while statement(*).
1146 (else-clause . 0)
1147 ;; Anchor pos: At the corresponding if statement(*).
1148 (catch-clause . 0)
1149 ;; Anchor pos: At the previous try or catch statement clause(*).
1150 (comment-intro . (c-lineup-knr-region-comment c-lineup-comment))
1151 ;; Anchor pos: None.
1152 (arglist-intro . +)
1153 ;; Anchor pos: At the containing statement(*).
1154 ;; 2nd pos: At the open paren.
1155 (arglist-cont . (c-lineup-gcc-asm-reg 0))
1156 ;; Anchor pos: At the first token after the open paren.
1157 (arglist-cont-nonempty . (c-lineup-gcc-asm-reg c-lineup-arglist))
1158 ;; Anchor pos: At the containing statement(*).
1159 ;; 2nd pos: At the open paren.
1160 (arglist-close . +)
1161 ;; Anchor pos: At the containing statement(*).
1162 ;; 2nd pos: At the open paren.
1163 (stream-op . c-lineup-streamop)
1164 ;; Anchor pos: Boi at the first stream op in the statement.
1165 (inclass . +)
1166 ;; Anchor pos: At the class open brace if it's at boi,
1167 ;; otherwise boi at the class decl start.
1168 (cpp-macro . [0])
1169 ;; Anchor pos: None.
1170 (cpp-macro-cont . +)
1171 ;; Anchor pos: At the macro start (always at boi).
1172 (cpp-define-intro . (c-lineup-cpp-define +))
1173 ;; Anchor pos: None.
1174 (friend . 0)
1175 ;; Anchor pos: None.
1176 (objc-method-intro . [0])
1177 ;; Anchor pos: Boi.
1178 (objc-method-args-cont . c-lineup-ObjC-method-args)
1179 ;; Anchor pos: At the method start (always at boi).
1180 (objc-method-call-cont . (c-lineup-ObjC-method-call-colons
1181 c-lineup-ObjC-method-call +))
1182 ;; Anchor pos: At the open bracket.
1183 (extern-lang-open . 0)
1184 (namespace-open . 0)
1185 (module-open . 0)
1186 (composition-open . 0)
1187 ;; Anchor pos: Boi at the extern/namespace/etc keyword.
1188 (extern-lang-close . 0)
1189 (namespace-close . 0)
1190 (module-close . 0)
1191 (composition-close . 0)
1192 ;; Anchor pos: Boi at the corresponding extern/namespace/etc keyword.
1193 (inextern-lang . +)
1194 (innamespace . +)
1195 (inmodule . +)
1196 (incomposition . +)
1197 ;; Anchor pos: At the extern/namespace/etc block open brace if
1198 ;; it's at boi, otherwise boi at the keyword.
1199 (template-args-cont . (c-lineup-template-args +))
1200 ;; Anchor pos: Boi at the decl start. This might be changed;
1201 ;; the logical position is clearly the opening '<'.
1202 (inlambda . c-lineup-inexpr-block)
1203 ;; Anchor pos: None.
1204 (lambda-intro-cont . +)
1205 ;; Anchor pos: Boi at the lambda start.
1206 (inexpr-statement . +)
1207 ;; Anchor pos: None.
1208 (inexpr-class . +)
1209 ;; Anchor pos: None.
1211 (defcustom c-offsets-alist nil
1212 "Association list of syntactic element symbols and indentation offsets.
1213 As described below, each cons cell in this list has the form:
1215 (SYNTACTIC-SYMBOL . OFFSET)
1217 When a line is indented, CC Mode first determines the syntactic
1218 context of it by generating a list of symbols called syntactic
1219 elements. The global variable `c-syntactic-context' is bound to the
1220 that list. Each element in the list is in turn a list where the first
1221 element is a syntactic symbol which tells what kind of construct the
1222 indentation point is located within. More elements in the syntactic
1223 element lists are optional. If there is one more and it isn't nil,
1224 then it's the anchor position for that construct.
1226 After generating the syntactic context for the line, CC Mode
1227 calculates the absolute indentation: First the base indentation is
1228 found by using the anchor position for the first syntactic element
1229 that provides one. If none does, zero is used as base indentation.
1230 Then CC Mode looks at each syntactic element in the context in turn.
1231 It compares the car of the syntactic element against the
1232 SYNTACTIC-SYMBOL's in `c-offsets-alist'. When it finds a match, it
1233 adds OFFSET to the base indentation. The sum of this calculation is
1234 the absolute offset for line being indented.
1236 If the syntactic element does not match any in the `c-offsets-alist',
1237 the element is ignored.
1239 OFFSET can specify an offset in several different ways:
1241 If OFFSET is nil then it's ignored.
1243 If OFFSET is an integer then it's used as relative offset, i.e. it's
1244 added to the base indentation.
1246 If OFFSET is one of the symbols `+', `-', `++', `--', `*', or `/'
1247 then a positive or negative multiple of `c-basic-offset' is added to
1248 the base indentation; 1, -1, 2, -2, 0.5, and -0.5, respectively.
1250 If OFFSET is a symbol with a value binding then that value, which
1251 must be an integer, is used as relative offset.
1253 If OFFSET is a vector then its first element, which must be an
1254 integer, is used as an absolute indentation column. This overrides
1255 the previous base indentation and the relative offsets applied to
1256 it, and it becomes the new base indentation.
1258 If OFFSET is a function or a lambda expression then it's called with
1259 a single argument containing the cons of the syntactic symbol and
1260 the anchor position (or nil if there is none). The return value
1261 from the function is then reinterpreted as an offset specification.
1263 If OFFSET is a list then its elements are evaluated recursively as
1264 offset specifications. If the first element is any of the symbols
1265 below then it isn't evaluated but instead specifies how the
1266 remaining offsets in the list should be combined. If it's something
1267 else then the list is combined according the method `first'. The
1268 valid combination methods are:
1270 `first' -- Use the first offset (that doesn't evaluate to nil).
1271 `min' -- Use the minimum of all the offsets. All must be either
1272 relative or absolute - they can't be mixed.
1273 `max' -- Use the maximum of all the offsets. All must be either
1274 relative or absolute - they can't be mixed.
1275 `add' -- Add all the evaluated offsets together. Exactly one of
1276 them may be absolute, in which case the result is
1277 absolute. Any relative offsets that preceded the
1278 absolute one in the list will be ignored in that case.
1280 `c-offsets-alist' is a style variable. This means that the offsets on
1281 this variable are normally taken from the style system in CC Mode
1282 \(see `c-default-style' and `c-style-alist'). However, any offsets
1283 put explicitly on this list will override the style system when a CC
1284 Mode buffer is initialized \(there is a variable
1285 `c-old-style-variable-behavior' that changes this, though).
1287 Here is the current list of valid syntactic element symbols:
1289 string -- Inside multi-line string.
1290 c -- Inside a multi-line C style block comment.
1291 defun-open -- Brace that opens a function definition.
1292 defun-close -- Brace that closes a function definition.
1293 defun-block-intro -- The first line in a top-level defun.
1294 class-open -- Brace that opens a class definition.
1295 class-close -- Brace that closes a class definition.
1296 inline-open -- Brace that opens an in-class inline method.
1297 inline-close -- Brace that closes an in-class inline method.
1298 func-decl-cont -- The region between a function definition's
1299 argument list and the function opening brace
1300 (excluding K&R argument declarations). In C, you
1301 cannot put anything but whitespace and comments
1302 between them; in C++ and Java, throws declarations
1303 and other things can appear in this context.
1304 knr-argdecl-intro -- First line of a K&R C argument declaration.
1305 knr-argdecl -- Subsequent lines in a K&R C argument declaration.
1306 topmost-intro -- The first line in a topmost construct definition.
1307 topmost-intro-cont -- Topmost definition continuation lines.
1308 annotation-top-cont -- Topmost definition continuation line where only
1309 annotations are on previous lines.
1310 annotation-var-cont -- A continuation of a C (or like) statement where
1311 only annotations are on previous lines.
1312 member-init-intro -- First line in a member initialization list.
1313 member-init-cont -- Subsequent member initialization list lines.
1314 inher-intro -- First line of a multiple inheritance list.
1315 inher-cont -- Subsequent multiple inheritance lines.
1316 block-open -- Statement block open brace.
1317 block-close -- Statement block close brace.
1318 brace-list-open -- Open brace of an enum or static array list.
1319 brace-list-close -- Close brace of an enum or static array list.
1320 brace-list-intro -- First line in an enum or static array list.
1321 brace-list-entry -- Subsequent lines in an enum or static array list.
1322 brace-entry-open -- Subsequent lines in an enum or static array
1323 list that start with an open brace.
1324 statement -- A C (or like) statement.
1325 statement-cont -- A continuation of a C (or like) statement.
1326 statement-block-intro -- The first line in a new statement block.
1327 statement-case-intro -- The first line in a case \"block\".
1328 statement-case-open -- The first line in a case block starting with brace.
1329 substatement -- The first line after an if/while/for/do/else.
1330 substatement-open -- The brace that opens a substatement block.
1331 substatement-label -- Labeled line after an if/while/for/do/else.
1332 case-label -- A \"case\" or \"default\" label.
1333 access-label -- C++ private/protected/public access label.
1334 label -- Any ordinary label.
1335 do-while-closure -- The \"while\" that ends a do/while construct.
1336 else-clause -- The \"else\" of an if/else construct.
1337 catch-clause -- The \"catch\" or \"finally\" of a try/catch construct.
1338 comment-intro -- A line containing only a comment introduction.
1339 arglist-intro -- The first line in an argument list.
1340 arglist-cont -- Subsequent argument list lines when no
1341 arguments follow on the same line as the
1342 arglist opening paren.
1343 arglist-cont-nonempty -- Subsequent argument list lines when at
1344 least one argument follows on the same
1345 line as the arglist opening paren.
1346 arglist-close -- The solo close paren of an argument list.
1347 stream-op -- Lines continuing a stream operator construct.
1348 inclass -- The construct is nested inside a class definition.
1349 Used together with e.g. `topmost-intro'.
1350 cpp-macro -- The start of a C preprocessor macro definition.
1351 cpp-macro-cont -- Inside a multi-line C preprocessor macro definition.
1352 friend -- A C++ friend declaration.
1353 objc-method-intro -- The first line of an Objective-C method definition.
1354 objc-method-args-cont -- Lines continuing an Objective-C method definition.
1355 objc-method-call-cont -- Lines continuing an Objective-C method call.
1356 extern-lang-open -- Brace that opens an \"extern\" block.
1357 extern-lang-close -- Brace that closes an \"extern\" block.
1358 inextern-lang -- Analogous to the `inclass' syntactic symbol,
1359 but used inside \"extern\" blocks.
1360 namespace-open, namespace-close, innamespace
1361 -- Similar to the three `extern-lang' symbols, but for
1362 C++ \"namespace\" blocks.
1363 module-open, module-close, inmodule
1364 -- Similar to the three `extern-lang' symbols, but for
1365 CORBA IDL \"module\" blocks.
1366 composition-open, composition-close, incomposition
1367 -- Similar to the three `extern-lang' symbols, but for
1368 CORBA CIDL \"composition\" blocks.
1369 template-args-cont -- C++ template argument list continuations.
1370 inlambda -- In the header or body of a lambda function.
1371 lambda-intro-cont -- Continuation of the header of a lambda function.
1372 inexpr-statement -- The statement is inside an expression.
1373 inexpr-class -- The class is inside an expression. Used e.g. for
1374 Java anonymous classes."
1375 :type
1376 `(set :format "%{%t%}:
1377 Override style setting
1378 | Syntax Offset
1380 ,@(mapcar
1381 (lambda (elt)
1382 `(cons :format "%v"
1383 :value ,elt
1384 ,(c-constant-symbol (car elt) 25)
1385 (sexp :format "%v"
1386 :validate
1387 (lambda (widget)
1388 (unless (c-valid-offset (widget-value widget))
1389 (widget-put widget :error "Invalid offset")
1390 widget)))))
1391 (get 'c-offsets-alist 'c-stylevar-fallback)))
1392 :group 'c)
1394 ;; The syntactic symbols that can occur inside code blocks. Used by
1395 ;; `c-gnu-impose-minimum'.
1396 (defconst c-inside-block-syms
1397 '(defun-block-intro block-open block-close statement statement-cont
1398 statement-block-intro statement-case-intro statement-case-open
1399 substatement substatement-open substatement-label case-label label
1400 do-while-closure else-clause catch-clause inlambda annotation-var-cont))
1402 (defcustom c-style-variables-are-local-p t
1403 "*Whether style variables should be buffer local by default.
1404 If non-nil, then all indentation style related variables will be made
1405 buffer local by default. If nil, they will remain global. Variables
1406 are made buffer local when this file is loaded, and once buffer
1407 localized, they cannot be made global again.
1409 This variable must be set appropriately before CC Mode is loaded.
1411 The list of variables to buffer localize are:
1412 c-basic-offset
1413 c-comment-only-line-offset
1414 c-indent-comment-alist
1415 c-indent-comments-syntactically-p
1416 c-block-comment-prefix
1417 c-comment-prefix-regexp
1418 c-doc-comment-style
1419 c-cleanup-list
1420 c-hanging-braces-alist
1421 c-hanging-colons-alist
1422 c-hanging-semi&comma-criteria
1423 c-backslash-column
1424 c-backslash-max-column
1425 c-label-minimum-indentation
1426 c-offsets-alist
1427 c-special-indent-hook
1428 c-indentation-style"
1429 :type 'boolean
1430 :safe 'booleanp
1431 :group 'c)
1433 (defcustom c-mode-hook nil
1434 "*Hook called by `c-mode'."
1435 :type 'hook
1436 :group 'c)
1438 (defcustom c++-mode-hook nil
1439 "*Hook called by `c++-mode'."
1440 :type 'hook
1441 :group 'c)
1443 (defcustom objc-mode-hook nil
1444 "*Hook called by `objc-mode'."
1445 :type 'hook
1446 :group 'c)
1448 (defcustom java-mode-hook nil
1449 "*Hook called by `java-mode'."
1450 :type 'hook
1451 :group 'c)
1453 (defcustom idl-mode-hook nil
1454 "*Hook called by `idl-mode'."
1455 :type 'hook
1456 :group 'c)
1458 (defcustom pike-mode-hook nil
1459 "*Hook called by `pike-mode'."
1460 :type 'hook
1461 :group 'c)
1463 (defcustom awk-mode-hook nil
1464 "*Hook called by `awk-mode'."
1465 :type 'hook
1466 :group 'c)
1468 (defcustom c-mode-common-hook nil
1469 "*Hook called by all CC Mode modes for common initializations."
1470 :type 'hook
1471 :group 'c)
1473 (defcustom c-initialization-hook nil
1474 "*Hook called when the CC Mode package gets initialized.
1475 This hook is only run once per Emacs session and can be used as a
1476 `load-hook' or in place of using `eval-after-load'."
1477 :type 'hook
1478 :group 'c)
1480 (defcustom c-enable-xemacs-performance-kludge-p nil
1481 "*Enables a XEmacs only hack that may improve speed for some coding styles.
1482 For styles that hang top-level opening braces (as is common with JDK
1483 Java coding styles) this can improve performance between 3 and 60
1484 times for core indentation functions (e.g. `c-parse-state'). For
1485 styles that conform to the Emacs recommendation of putting these
1486 braces in column zero, this can degrade performance about as much.
1487 This variable only has effect in XEmacs."
1488 :type 'boolean
1489 :group 'c)
1491 (defvar c-old-style-variable-behavior nil
1492 "*Enables the old style variable behavior when non-nil.
1494 Normally the values of the style variables will override the style
1495 settings specified by the variables `c-default-style' and
1496 `c-style-alist'. However, in CC Mode 5.25 and earlier, it was the
1497 other way around, meaning that changes made to the style variables
1498 from e.g. Customize would not take effect unless special precautions
1499 were taken. That was confusing, especially for novice users.
1501 It's believed that despite this change, the new behavior will still
1502 produce the same results for most old CC Mode configurations, since
1503 all style variables are per default set in a special non-override
1504 state. Set this variable only if your configuration has stopped
1505 working due to this change.")
1507 (define-widget 'c-extra-types-widget 'radio
1508 "Internal CC Mode widget for the `*-font-lock-extra-types' variables."
1509 :args '((const :tag "none" nil)
1510 (repeat :tag "types" regexp)))
1512 (defun c-make-font-lock-extra-types-blurb (mode1 mode2 example)
1513 (concat "\
1514 *List of extra types (aside from the type keywords) to recognize in "
1515 mode1 " mode.
1516 Each list item should be a regexp matching a single identifier.
1517 " example "
1519 Note that items on this list that don't include any regexp special
1520 characters are automatically optimized using `regexp-opt', so you
1521 should not use `regexp-opt' explicitly to build regexps here.
1523 On decoration level 3 (and higher, where applicable), a method is used
1524 that finds most types and declarations by syntax alone. This variable
1525 is still used as a first step, but other types are recognized
1526 correctly anyway in most cases. Therefore this variable should be
1527 fairly restrictive and not contain patterns that are uncertain.
1529 Note that this variable is only consulted when the major mode is
1530 initialized. If you change it later you have to reinitialize CC Mode
1531 by doing \\[" mode2 "].
1533 Despite the name, this variable is not only used for font locking but
1534 also elsewhere in CC Mode to tell types from other identifiers."))
1536 ;; Note: Most of the variables below are also defined in font-lock.el
1537 ;; in older versions of Emacs, so depending on the load order we might
1538 ;; not install the values below. There's no kludge to cope with this
1539 ;; (as opposed to the *-font-lock-keywords-* variables) since the old
1540 ;; values work fairly well anyway.
1542 (defcustom c-font-lock-extra-types
1543 '("\\sw+_t"
1544 ;; Defined in C99:
1545 "bool" "complex" "imaginary"
1546 ;; Standard library types (except those matched by the _t pattern):
1547 "FILE" "lconv" "tm" "va_list" "jmp_buf"
1548 ;; I do not appreciate the following very Emacs-specific luggage
1549 ;; in the default value, but otoh it can hardly get in the way for
1550 ;; other users, and removing it would cause unnecessary grief for
1551 ;; the old timers that are used to it. /mast
1552 "Lisp_Object")
1553 (c-make-font-lock-extra-types-blurb "C" "c-mode"
1554 "For example, a value of (\"FILE\" \"\\\\sw+_t\") means the word \"FILE\"
1555 and words ending in \"_t\" are treated as type names.")
1556 :type 'c-extra-types-widget
1557 :group 'c)
1559 (defcustom c++-font-lock-extra-types
1560 '("\\sw+_t"
1561 ;; C library types (except those matched by the _t pattern):
1562 "FILE" "lconv" "tm" "va_list" "jmp_buf"
1563 ;; Some standard C++ types that came from font-lock.el.
1564 ;; Experienced C++ users says there's no clear benefit in
1565 ;; extending this to all the types in the standard library, at
1566 ;; least not when they'll be recognized without "std::" too.
1567 "istream" "istreambuf"
1568 "ostream" "ostreambuf"
1569 "ifstream" "ofstream" "fstream"
1570 "strstream" "strstreambuf" "istrstream" "ostrstream"
1571 "ios"
1572 "string" "rope"
1573 "list" "slist"
1574 "deque" "vector" "bit_vector"
1575 "set" "multiset"
1576 "map" "multimap"
1577 "hash"
1578 "hash_set" "hash_multiset"
1579 "hash_map" "hash_multimap"
1580 "stack" "queue" "priority_queue"
1581 "type_info"
1582 "iterator" "const_iterator" "reverse_iterator" "const_reverse_iterator"
1583 "reference" "const_reference")
1584 (c-make-font-lock-extra-types-blurb "C++" "c++-mode"
1585 "For example, a value of (\"string\") means the word \"string\" is treated
1586 as a type name.")
1587 :type 'c-extra-types-widget
1588 :group 'c)
1590 (defcustom objc-font-lock-extra-types
1591 (list (concat "[" c-upper "]\\sw*[" c-lower "]\\sw*"))
1592 (c-make-font-lock-extra-types-blurb "ObjC" "objc-mode" (concat
1593 "For example, a value of (\"[" c-upper "]\\\\sw*[" c-lower "]\\\\sw*\") means
1594 capitalized words are treated as type names (the requirement for a
1595 lower case char is to avoid recognizing all-caps macro and constant
1596 names)."))
1597 :type 'c-extra-types-widget
1598 :group 'c)
1600 (defcustom java-font-lock-extra-types
1601 (list (concat "[" c-upper "]\\sw*[" c-lower "]\\sw"))
1602 (c-make-font-lock-extra-types-blurb "Java" "java-mode" (concat
1603 "For example, a value of (\"[" c-upper "]\\\\sw*[" c-lower "]\\\\sw*\") means
1604 capitalized words are treated as type names (the requirement for a
1605 lower case char is to avoid recognizing all-caps constant names)."))
1606 :type 'c-extra-types-widget
1607 :group 'c)
1609 (defcustom idl-font-lock-extra-types nil
1610 (c-make-font-lock-extra-types-blurb "IDL" "idl-mode" "")
1611 :type 'c-extra-types-widget
1612 :group 'c)
1614 (defcustom pike-font-lock-extra-types
1615 (list (concat "[" c-upper "]\\sw*[" c-lower "]\\sw*"))
1616 (c-make-font-lock-extra-types-blurb "Pike" "pike-mode" (concat
1617 "For example, a value of (\"[" c-upper "]\\\\sw*[" c-lower "]\\\\sw*\") means
1618 capitalized words are treated as type names (the requirement for a
1619 lower case char is to avoid recognizing all-caps macro and constant
1620 names)."))
1621 :type 'c-extra-types-widget
1622 :group 'c)
1625 ;; Non-customizable variables, still part of the interface to CC Mode
1626 (defvar c-macro-with-semi-re nil
1627 ;; Regular expression which matches a (#define'd) symbol whose expansion
1628 ;; ends with a semicolon.
1630 ;; This variable should be set by `c-make-macros-with-semi-re' rather than
1631 ;; directly.
1633 (make-variable-buffer-local 'c-macro-with-semi-re)
1635 (defun c-make-macro-with-semi-re ()
1636 ;; Convert `c-macro-names-with-semicolon' into the regexp
1637 ;; `c-macro-with-semi-re' (or just copy it if it's already a re).
1638 (setq c-macro-with-semi-re
1639 (and
1640 c-opt-cpp-macro-define
1641 (cond
1642 ((stringp c-macro-names-with-semicolon)
1643 (copy-sequence c-macro-names-with-semicolon))
1644 ((consp c-macro-names-with-semicolon)
1645 (concat
1646 "\\<"
1647 (regexp-opt c-macro-names-with-semicolon)
1648 "\\>")) ; N.B. the PAREN param of regexp-opt isn't supported by
1649 ; all XEmacsen.
1650 ((null c-macro-names-with-semicolon)
1651 nil)
1652 (t (error "c-make-macro-with-semi-re: invalid \
1653 c-macro-names-with-semicolon: %s"
1654 c-macro-names-with-semicolon))))))
1656 (defvar c-macro-names-with-semicolon
1657 '("Q_OBJECT" "Q_PROPERTY" "Q_DECLARE" "Q_ENUMS")
1658 "List of #defined symbols whose expansion ends with a semicolon.
1659 Alternatively it can be a string, a regular expression which
1660 matches all such symbols.
1662 The \"symbols\" must be syntactically valid identifiers in the
1663 target language \(C, C++, Objective C), or \(as the case may be)
1664 the regular expression must match only valid identifiers.
1666 If you change this variable's value, call the function
1667 `c-make-macros-with-semi-re' to set the necessary internal
1668 variables.
1670 Note that currently \(2008-11-04) this variable is a prototype,
1671 and is likely to disappear or change its form soon.")
1672 (make-variable-buffer-local 'c-macro-names-with-semicolon)
1674 (defvar c-file-style nil
1675 "Variable interface for setting style via File Local Variables.
1676 In a file's Local Variable section, you can set this variable to a
1677 string suitable for `c-set-style'. When the file is visited, CC Mode
1678 will set the style of the file to this value automatically.
1680 Note that file style settings are applied before file offset settings
1681 as designated in the variable `c-file-offsets'.")
1682 (make-variable-buffer-local 'c-file-style)
1683 ;;;###autoload(put 'c-file-style 'safe-local-variable 'string-or-null-p)
1685 (defvar c-file-offsets nil
1686 "Variable interface for setting offsets via File Local Variables.
1687 In a file's Local Variable section, you can set this variable to an
1688 association list similar to the values allowed in `c-offsets-alist'.
1689 When the file is visited, CC Mode will institute these offset settings
1690 automatically.
1692 Note that file offset settings are applied after file style settings
1693 as designated in the variable `c-file-style'.")
1694 (make-variable-buffer-local 'c-file-offsets)
1696 ;; It isn't possible to specify a doc-string without specifying an
1697 ;; initial value with `defvar', so the following two variables have been
1698 ;; given doc-strings by setting the property `variable-documentation'
1699 ;; directly. It's really good not to have an initial value for
1700 ;; variables like these that always should be dynamically bound, so it's
1701 ;; worth the inconvenience.
1703 (cc-bytecomp-defvar c-syntactic-context)
1704 (defvar c-syntactic-context)
1705 (put 'c-syntactic-context 'variable-documentation
1706 "Variable containing the syntactic analysis list for a line of code.
1708 It is a list with one element for each syntactic symbol pertinent to the
1709 line, for example \"((defun-block-intro 1) (comment-intro))\".
1711 It is dynamically bound when calling \(i) a brace hanging \"action
1712 function\"; \(ii) a semicolon/comma hanging \"criteria function\"; \(iii) a
1713 \"line-up function\"; \(iv) a c-special-indent-hook function. It is also
1714 used internally by CC Mode.
1716 c-syntactic-context is always bound dynamically. It must NEVER be set
1717 statically (e.g. with `setq').")
1720 (cc-bytecomp-defvar c-syntactic-element)
1721 (defvar c-syntactic-element)
1722 (put 'c-syntactic-element 'variable-documentation
1723 "Variable containing the current syntactic element during calls to
1724 the lineup functions. The value is one of the elements in the list in
1725 `c-syntactic-context' and is a list with the symbol name in the first
1726 position, followed by zero or more elements containing any additional
1727 info associated with the syntactic symbol. There are accessor functions
1728 `c-langelem-sym', `c-langelem-pos', `c-langelem-col', and
1729 `c-langelem-2nd-pos' to access the list.
1731 Specifically, the element returned by `c-langelem-pos' is the anchor
1732 position, or nil if there isn't any. See the comments in the
1733 `c-offsets-alist' variable and the CC Mode manual for more detailed info
1734 about the data each syntactic symbol provides.
1736 This is always bound dynamically. It should never be set
1737 statically (e.g. with `setq').")
1739 (defvar c-indentation-style nil
1740 "Name of the currently installed style.
1741 Don't change this directly; call `c-set-style' instead, or set the variable
1742 `c-file-style' in the file's Local Variable list.")
1744 (defvar c-current-comment-prefix nil
1745 "The current comment prefix regexp.
1746 Set from `c-comment-prefix-regexp' at mode initialization.")
1747 (make-variable-buffer-local 'c-current-comment-prefix)
1749 ;; N.B. The next three variables are initialized in
1750 ;; c-setup-paragraph-variables. Their initializations here are "just in
1751 ;; case". ACM, 2004/2/15. They are NOT buffer local (yet?).
1752 (defvar c-string-par-start
1753 ;; (concat "\\(" (default-value 'paragraph-start) "\\)\\|[ \t]*\\\\$")
1754 "\f\\|[ \t]*\\\\?$"
1755 "Value of paragraph-start used when scanning strings.
1756 It treats escaped EOLs as whitespace.")
1758 (defvar c-string-par-separate
1759 ;; (concat "\\(" (default-value 'paragraph-separate) "\\)\\|[ \t]*\\\\$")
1760 "[ \t\f]*\\\\?$"
1761 "Value of paragraph-separate used when scanning strings.
1762 It treats escaped EOLs as whitespace.")
1764 (defvar c-sentence-end-with-esc-eol
1765 (concat "\\(\\(" (c-default-value-sentence-end) "\\)"
1766 ;; N.B.: "$" would be illegal when not enclosed like "\\($\\)".
1767 "\\|" "[.?!][]\"')}]* ?\\\\\\($\\)[ \t\n]*"
1768 "\\)")
1769 "Value used like sentence-end used when scanning strings.
1770 It treats escaped EOLs as whitespace.")
1773 (cc-provide 'cc-vars)
1775 ;;; cc-vars.el ends here