]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/cc-vars.el
Merge multi-tty branch
[gnu-emacs] / lisp / progmodes / cc-vars.el
index e7f84f491106a5b567c5443f077da1543a03c366..76b0e5a898c2e42607e4916d5746b6edd6c5316e 100644 (file)
@@ -1,10 +1,12 @@
 ;;; cc-vars.el --- user customization variables for CC Mode
 
-;; Copyright (C) 1985,87,92,93,94,95,96,97,98,99,2000 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+;;   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+;;   Free Software Foundation, Inc.
 
-;; Authors:    2000- Martin Stjernholm
-;;            1998-1999 Barry A. Warsaw and Martin Stjernholm
-;;             1992-1997 Barry A. Warsaw
+;; Authors:    2002- Alan Mackenzie
+;;             1998- Martin Stjernholm
+;;             1992-1999 Barry A. Warsaw
 ;;             1987 Dave Detlefs and Stewart Clamen
 ;;             1985 Richard M. Stallman
 ;; Maintainer: bug-cc-mode@gnu.org
@@ -16,7 +18,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; along with this program; see the file COPYING.  If not, write to
+;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;;; Code:
 
 (eval-when-compile
   (let ((load-path
-        (if (and (boundp 'byte-compile-current-file)
-                 (stringp byte-compile-current-file))
-            (cons (file-name-directory byte-compile-current-file)
-                  load-path)
+        (if (and (boundp 'byte-compile-dest-file)
+                 (stringp byte-compile-dest-file))
+            (cons (file-name-directory byte-compile-dest-file) load-path)
           load-path)))
-    (load "cc-defs" nil t)))
-(require 'custom)
+    (load "cc-bytecomp" nil t)))
+
+(cc-require 'cc-defs)
 
+;; Silence the compiler.
+(cc-bytecomp-defun get-char-table)     ; XEmacs
+
+(cc-eval-when-compile
+  (require 'custom)
+  (require 'widget))
+
+(cc-eval-when-compile
+  ;; Need the function form of `backquote', which isn't standardized
+  ;; between Emacsen.  It's called `bq-process' in XEmacs, and
+  ;; `backquote-process' in Emacs.  `backquote-process' returns a
+  ;; slightly more convoluted form, so let `bq-process' be the norm.
+  (if (fboundp 'backquote-process)
+      (cc-bytecomp-defmacro bq-process (form)
+       `(cdr (backquote-process ,form)))))
 
 \f
 ;;; Helpers
 
-;; This widget will show up in newer versions of the Custom library
+;; This widget exists in newer versions of the Custom library
 (or (get 'other 'widget-type)
     (define-widget 'other 'sexp
       "Matches everything, but doesn't let the user edit the value.
@@ -75,47 +96,97 @@ Useful as last item in a `choice' widget."
                  (match-string 0 value)))
       value)))
 
+(define-widget 'c-integer-or-nil 'sexp
+  "An integer or the value nil."
+  :value nil
+  :tag "Optional integer"
+  :match (lambda (widget value) (or (integerp value) (null value))))
+
+(define-widget 'c-symbol-list 'sexp
+  "A single symbol or a list of symbols."
+  :tag "Symbols separated by spaces"
+  :validate 'widget-field-validate
+  :match
+  (lambda (widget value)
+    (or (symbolp value)
+       (catch 'ok
+         (while (listp value)
+           (unless (symbolp (car value))
+             (throw 'ok nil))
+           (setq value (cdr value)))
+         (null value))))
+  :value-to-internal
+  (lambda (widget value)
+    (cond ((null value)
+          "")
+         ((symbolp value)
+          (symbol-name value))
+         ((consp value)
+          (mapconcat (lambda (symbol)
+                       (symbol-name symbol))
+                     value
+                     " "))
+         (t
+          value)))
+  :value-to-external
+  (lambda (widget value)
+    (if (stringp value)
+       (let (list end)
+         (while (string-match "\\S +" value end)
+           (setq list (cons (intern (match-string 0 value)) list)
+                 end (match-end 0)))
+         (if (and list (not (cdr list)))
+             (car list)
+           (nreverse list)))
+      value)))
+
 (defvar c-style-variables
-  '(c-basic-offset c-comment-only-line-offset c-block-comment-prefix
-    c-comment-prefix-regexp c-cleanup-list c-hanging-braces-alist
-    c-hanging-colons-alist c-hanging-semi&comma-criteria c-backslash-column
+  '(c-basic-offset c-comment-only-line-offset c-indent-comment-alist
+    c-indent-comments-syntactically-p c-block-comment-prefix
+    c-comment-prefix-regexp c-doc-comment-style c-cleanup-list
+    c-hanging-braces-alist c-hanging-colons-alist
+    c-hanging-semi&comma-criteria c-backslash-column c-backslash-max-column
     c-special-indent-hook c-label-minimum-indentation c-offsets-alist)
   "List of the style variables.")
 
+(defvar c-fallback-style nil)
+
+(defsubst c-set-stylevar-fallback (name val)
+  (put name 'c-stylevar-fallback val)
+  (setq c-fallback-style (cons (cons name val) c-fallback-style)))
+
 (defmacro defcustom-c-stylevar (name val doc &rest args)
   "Defines a style variable."
-  (setq val (if (eq (car-safe val) 'quote)
-               (nth 1 val)
-             (eval val)))
-  `(progn
-     (put ',name 'c-stylevar-fallback ',val)
-     (defcustom ,name 'set-from-style
-       ,(concat doc "
+  `(let ((-value- ,val))
+     (c-set-stylevar-fallback ',name -value-)
+     (custom-declare-variable
+      ',name ''set-from-style
+      ,(concat doc "
 
 This is a style variable.  Apart from the valid values described
 above, it can be set to the symbol `set-from-style'.  In that case, it
 takes its value from the style system (see `c-default-style' and
-`c-styles-alist') when a CC Mode buffer is initialized.  Otherwise,
+`c-style-alist') when a CC Mode buffer is initialized.  Otherwise,
 the value set here overrides the style system (there is a variable
 `c-old-style-variable-behavior' that changes this, though).")
-       ,@(plist-put
-         args ':type
-         `'(radio
-            (const :tag "Use style settings"
-                   set-from-style)
-            ,(let ((type (eval (plist-get args ':type))))
-               (unless (consp type)
-                 (setq type (list type)))
-               (unless (c-safe (plist-get (cdr type) ':value))
-                 (setcdr type (append `(:value ,val)
-                                      (cdr type))))
-               (unless (c-safe (plist-get (cdr type) ':tag))
-                 (setcdr type (append '(:tag "Override style settings")
-                                      (cdr type))))
-               type))))))
+      ,@(plist-put
+        args ':type
+        `(` (radio
+             (const :tag "Use style settings"
+                    set-from-style)
+             ,(, (let ((type (eval (plist-get args ':type))))
+                   (unless (consp type)
+                     (setq type (list type)))
+                   (unless (c-safe (plist-get (cdr type) ':value))
+                     (setcdr type (append '(:value (, -value-))
+                                          (cdr type))))
+                   (unless (c-safe (plist-get (cdr type) ':tag))
+                     (setcdr type (append '(:tag "Override style settings")
+                                          (cdr type))))
+                   (bq-process type)))))))))
 
 (defun c-valid-offset (offset)
-  "Return non-nil iff OFFSET is a valid offset for a syntactic symbol.
+  "Return non-nil if OFFSET is a valid offset for a syntactic symbol.
 See `c-offsets-alist'."
   (or (eq offset '+)
       (eq offset '-)
@@ -125,14 +196,19 @@ See `c-offsets-alist'."
       (eq offset '/)
       (integerp offset)
       (functionp offset)
-      (and (symbolp offset)
-          (or (boundp offset)
-              (fboundp offset)))
-      (progn
-       (while (and (consp offset)
-                   (c-valid-offset (car offset)))
-         (setq offset (cdr offset)))
-       (null offset))))
+      (and (symbolp offset) (boundp offset))
+      (and (vectorp offset)
+          (= (length offset) 1)
+          (integerp (elt offset 0)))
+      (and (consp offset)
+          (not (eq (car offset) 'quote)) ; Detect misquoted lists.
+          (progn
+            (when (memq (car offset) '(first min max add))
+              (setq offset (cdr offset)))
+            (while (and (consp offset)
+                        (c-valid-offset (car offset)))
+              (setq offset (cdr offset)))
+            (null offset)))))
 
 
 \f
@@ -156,21 +232,34 @@ syntactic symbols in `c-offsets-alist'.  Please keep it set to nil."
   :type 'boolean
   :group 'c)
 
+(defcustom c-report-syntactic-errors nil
+  "*If non-nil, certain syntactic errors are reported with a ding
+and a message, for example when an \"else\" is indented for which
+there's no corresponding \"if\".
+
+Note however that CC Mode doesn't make any special effort to check for
+syntactic errors; that's the job of the compiler.  The reason it can
+report cases like the one above is that it can't find the correct
+anchoring position to indent the line in that case."
+  :type 'boolean
+  :group 'c)
+
 (defcustom-c-stylevar c-basic-offset 4
   "*Amount of basic offset used by + and - symbols in `c-offsets-alist'.
 Also used as the indentation step when `c-syntactic-indentation' is
 nil."
   :type 'integer
   :group 'c)
+;;;###autoload(put 'c-basic-offset 'safe-local-variable 'integerp)
 
 (defcustom c-tab-always-indent t
   "*Controls the operation of the TAB key.
-If t, hitting TAB always just indents the current line.  If nil,
-hitting TAB indents the current line if point is at the left margin or
-in the line's indentation, otherwise it insert a `real' tab character
-\(see note\).  If the symbol `other', then tab is inserted only within
-literals -- defined as comments and strings -- and inside preprocessor
-directives, but the line is always reindented.
+If t, hitting TAB always just indents the current line.  If nil, hitting
+TAB indents the current line if point is at the left margin or in the
+line's indentation, otherwise it inserts a `real' tab character \(see
+note\).  If some other value (not nil or t), then tab is inserted only
+within literals \(comments and strings), but the line is always
+reindented.
 
 Note: The value of `indent-tabs-mode' will determine whether a real
 tab character will be inserted, or the equivalent number of spaces.
@@ -180,11 +269,9 @@ When inserting a tab, actually the function stored in the variable
 Note: indentation of lines containing only comments is also controlled
 by the `c-comment-only-line-offset' variable."
   :type '(radio
-         :extra-offset 8
-         :format "%{C Tab Always Indent%}:\n   The TAB key:\n%v"
-         (const :tag "always indents, never inserts TAB" t)
-         (const :tag "indents in left margin, otherwise inserts TAB" nil)
-         (other :tag "inserts TAB in literals, otherwise indent" other))
+         (const :tag "TAB key always indents, never inserts TAB" t)
+         (const :tag "TAB key indents in left margin, otherwise inserts TAB" nil)
+         (other :tag "TAB key inserts TAB in literals, otherwise indents" other))
   :group 'c)
 
 (defcustom c-insert-tab-function 'insert-tab
@@ -195,18 +282,37 @@ should be inserted.  Value must be a function taking no arguments."
   :group 'c)
 
 (defcustom c-syntactic-indentation t
-  "*Whether the identation should be controlled by the syntactic context.
+  "*Whether the indentation should be controlled by the syntactic context.
 
-If t, the indentation functions indents according to the syntactic
+If t, the indentation functions indent according to the syntactic
 context, using the style settings specified by `c-offsets-alist'.
 
 If nil, every line is just indented to the same level as the previous
-one, and the \\[c-indent-command] command adjusts the indentation in steps
-specified by `c-basic-offset'.  The indentation style have no effect
-in this mode, nor any of the indentation associated variables,
+one, and the \\[c-indent-command] command adjusts the indentation in
+steps specified by `c-basic-offset'.  The indentation style has no
+effect in this mode, nor any of the indentation associated variables,
 e.g. `c-special-indent-hook'."
   :type 'boolean
   :group 'c)
+(make-variable-buffer-local 'c-syntactic-indentation)
+
+(defcustom c-syntactic-indentation-in-macros t
+  "*Enable syntactic analysis inside macros.
+If this is nil, all lines inside macro definitions are analyzed as
+`cpp-macro-cont'.  Otherwise they are analyzed syntactically, just
+like normal code, and `cpp-define-intro' is used to create the
+additional indentation of the bodies of \"#define\" macros.
+
+Having this enabled simplifies editing of large multiline macros, but
+it might complicate editing if CC Mode doesn't recognize the context
+of the macro content.  The default context inside the macro is the
+same as the top level, so if it contains \"bare\" statements they
+might be indented wrongly, although there are special cases that
+handle this in most cases.  If this problem occurs, it's usually
+countered easily by surrounding the statements by a block \(or even
+better with the \"do { ... } while \(0)\" trick)."
+  :type 'boolean
+  :group 'c)
 
 (defcustom-c-stylevar c-comment-only-line-offset 0
   "*Extra offset for line which contains only the start of a comment.
@@ -225,12 +331,90 @@ default)."
   :type '(choice (integer :tag "Non-anchored offset" 0)
                 (cons :tag "Non-anchored & anchored offset"
                       :value (0 . 0)
-                      :extra-offset 8
                       (integer :tag "Non-anchored offset")
                       (integer :tag "Anchored offset")))
   :group 'c)
 
-(defcustom c-indent-comments-syntactically-p nil
+(defcustom-c-stylevar c-indent-comment-alist
+  '((anchored-comment . (column . 0))
+    (end-block . (space . 1))
+    (cpp-end-block . (space . 2)))
+  "*Specifies how \\[indent-for-comment] calculates the comment start column.
+This is an association list that contains entries of the form:
+
+ (LINE-TYPE . INDENT-SPEC)
+
+LINE-TYPE specifies a type of line as described below, and INDENT-SPEC
+says what \\[indent-for-comment] should do when used on that type of line.
+
+The recognized values for LINE-TYPE are:
+
+ empty-line        -- The line is empty.
+ anchored-comment  -- The line contains a comment that starts in column 0.
+ end-block         -- The line contains a solitary block closing brace.
+ cpp-end-block     -- The line contains a preprocessor directive that
+                      closes a block, i.e. either \"#endif\" or \"#else\".
+ other             -- The line does not match any other entry
+                      currently on the list.
+
+An INDENT-SPEC is a cons cell of the form:
+
+ (ACTION . VALUE)
+
+ACTION says how \\[indent-for-comment] should align the comment, and
+VALUE is interpreted depending on ACTION.  ACTION can be any of the
+following:
+
+ space   -- Put VALUE spaces between the end of the line and the start
+            of the comment.
+ column  -- Start the comment at the column VALUE.  If the line is
+            longer than that, the comment is preceded by a single
+            space.  If VALUE is nil, `comment-column' is used.
+ align   -- Align the comment with one on the previous line, if there
+            is any.  If the line is too long, the comment is preceded
+            by a single space.  If there isn't a comment start on the
+            previous line, the behavior is specified by VALUE, which
+            in turn is interpreted as an INDENT-SPEC.
+
+If a LINE-TYPE is missing, then \\[indent-for-comment] indents the comment
+according to `comment-column'.
+
+Note that a non-nil value on `c-indent-comments-syntactically-p'
+overrides this variable, so empty lines are indentented syntactically
+in that case, i.e. as if \\[c-indent-command] was used instead."
+  :type
+  (let ((space '(cons :tag "space"
+                     :format "%v"
+                     :value (space . 1)
+                     (const :format "space  " space)
+                     (integer :format "%v")))
+       (column '(cons :tag "column"
+                      :format "%v"
+                      (const :format "column " column)
+                      (c-integer-or-nil :format "%v"))))
+    `(set ,@(mapcar
+            (lambda (elt)
+              `(cons :format "%v"
+                     (c-const-symbol :format "%v: "
+                                     :size 20
+                                     :value ,elt)
+                     (choice
+                      :format "%[Choice%] %v"
+                      :value (column . nil)
+                      ,space
+                      ,column
+                      (cons :tag "align"
+                            :format "%v"
+                            (const :format "align  " align)
+                            (choice
+                             :format "%[Choice%] %v"
+                             :value (column . nil)
+                             ,space
+                             ,column)))))
+            '(empty-line anchored-comment end-block cpp-end-block other))))
+  :group 'c)
+
+(defcustom-c-stylevar c-indent-comments-syntactically-p nil
   "*Specifies how \\[indent-for-comment] should handle comment-only lines.
 When this variable is non-nil, comment-only lines are indented
 according to syntactic analysis via `c-offsets-alist'.  Otherwise, the
@@ -240,6 +424,15 @@ comment-only lines."
   :type 'boolean
   :group 'c)
 
+(make-obsolete-variable 'c-comment-continuation-stars
+                       'c-block-comment-prefix)
+
+;; Although c-comment-continuation-stars is obsolete, we look at it in
+;; some places in CC Mode anyway, so make the compiler ignore it
+;; during our compilation.
+(cc-bytecomp-obsolete-var c-comment-continuation-stars)
+(cc-bytecomp-defvar c-comment-continuation-stars)
+
 (defcustom-c-stylevar c-block-comment-prefix
   (if (boundp 'c-comment-continuation-stars)
       c-comment-continuation-stars
@@ -259,25 +452,134 @@ style comments."
   :type 'string
   :group 'c)
 
-(make-obsolete-variable 'c-comment-continuation-stars
-                       'c-block-comment-prefix)
-
-(defcustom-c-stylevar c-comment-prefix-regexp "//+\\|\\**"
+(defcustom-c-stylevar c-comment-prefix-regexp
+  '((pike-mode . "//+!?\\|\\**")
+    (awk-mode . "#+")
+    (other . "//+\\|\\**"))
   "*Regexp to match the line prefix inside comments.
 This regexp is used to recognize the fill prefix inside comments for
 correct paragraph filling and other things.
 
-It should match the prefix used in both C++ style line comments and C
-style block comments, but it does not need to match a block comment
-starter.  In other words, it should at least match \"//\" for line
-comments and the string in `c-block-comment-prefix', which is
-sometimes inserted by CC Mode inside block comments.  It should not
-match any surrounding whitespace.
+If this variable is a string, it will be used in all CC Mode major
+modes.  It can also be an association list, to associate specific
+regexps to specific major modes.  The symbol for the major mode is
+looked up in the association list, and its value is used as the line
+prefix regexp.  If it's not found, then the symbol `other' is looked
+up and its value is used instead.
+
+The regexp should match the prefix used in both C++ style line
+comments and C style block comments, but it does not need to match a
+block comment starter.  In other words, it should at least match
+\"//\" for line comments and the string in `c-block-comment-prefix',
+which is sometimes inserted by CC Mode inside block comments.  It
+should not match any surrounding whitespace.
+
+Note that CC Mode uses this variable to set many other variables that
+handle the paragraph filling.  That's done at mode initialization or
+when you switch to a style which sets this variable.  Thus, if you
+change it in some other way, e.g. interactively in a CC Mode buffer,
+you will need to do \\[c-setup-paragraph-variables] afterwards so that
+the other variables are updated with the new value.
+
+Note also that when CC Mode starts up, all variables are initialized
+before the mode hooks are run.  It's therefore necessary to make a
+call to `c-setup-paragraph-variables' explicitly if you change this
+variable in a mode hook."
+  :type '(radio
+         (regexp :tag "Regexp for all modes")
+         (list
+          :tag "Mode-specific regexps"
+          (set
+           :inline t :format "%v"
+           (cons :format "%v"
+                 (const :format "C     " c-mode) (regexp :format "%v"))
+           (cons :format "%v"
+                 (const :format "C++   " c++-mode) (regexp :format "%v"))
+           (cons :format "%v"
+                 (const :format "ObjC  " objc-mode) (regexp :format "%v"))
+           (cons :format "%v"
+                 (const :format "Java  " java-mode) (regexp :format "%v"))
+           (cons :format "%v"
+                 (const :format "IDL   " idl-mode) (regexp :format "%v"))
+           (cons :format "%v"
+                 (const :format "Pike  " pike-mode) (regexp :format "%v"))
+            (cons :format "%v"
+                 (const :format "AWK   " awk-mode) (regexp :format "%v")))
+          (cons :format "    %v"
+                (const :format "Other " other) (regexp :format "%v"))))
+  :group 'c)
 
-Note that CC Mode modifies other variables from this one at mode
-initialization, so you might need to do \\[c-mode] (or whatever mode
-you're currently using) if you change it in a CC Mode buffer."
-  :type 'regexp
+(defcustom-c-stylevar c-doc-comment-style
+  '((java-mode . javadoc)
+    (pike-mode . autodoc)
+    (c-mode    . gtkdoc))
+  "*Specifies documentation comment style(s) to recognize.
+This is primarily used to fontify doc comments and the markup within
+them, e.g. Javadoc comments.
+
+The value can be any of the following symbols for various known doc
+comment styles:
+
+ javadoc -- Javadoc style for \"/** ... */\" comments (default in Java mode).
+ autodoc -- Pike autodoc style for \"//! ...\" comments (default in Pike mode).
+ gtkdoc  -- GtkDoc style for \"/** ... **/\" comments (default in C mode).
+
+The value may also be a list of doc comment styles, in which case all
+of them are recognized simultaneously (presumably with markup cues
+that don't conflict).
+
+The value may also be an association list to specify different doc
+comment styles for different languages.  The symbol for the major mode
+is then looked up in the alist, and the value of that element is
+interpreted as above if found.  If it isn't found then the symbol
+`other' is looked up and its value is used instead.
+
+Note that CC Mode uses this variable to set other variables that
+handle fontification etc.  That's done at mode initialization or when
+you switch to a style which sets this variable.  Thus, if you change
+it in some other way, e.g. interactively in a CC Mode buffer, you will
+need to do \\[java-mode] (or whatever mode you're currently using) to
+reinitialize.
+
+Note also that when CC Mode starts up, the other variables are
+modified before the mode hooks are run.  If you change this variable
+in a mode hook, you have to call `c-setup-doc-comment-style'
+afterwards to redo that work."
+  ;; Symbols other than those documented above may be used on this
+  ;; variable.  If a variable exists that has that name with
+  ;; "-font-lock-keywords" appended, it's value is prepended to the
+  ;; font lock keywords list.  If it's a function then it's called and
+  ;; the result is prepended.
+  :type '(radio
+         (c-symbol-list :tag "Doc style(s) in all modes")
+         (list
+          :tag "Mode-specific doc styles"
+          (set
+           :inline t :format "%v"
+           (cons :format "%v"
+                 (const :format "C     " c-mode)
+                 (c-symbol-list :format "%v"))
+           (cons :format "%v"
+                 (const :format "C++   " c++-mode)
+                 (c-symbol-list :format "%v"))
+           (cons :format "%v"
+                 (const :format "ObjC  " objc-mode)
+                 (c-symbol-list :format "%v"))
+           (cons :format "%v"
+                 (const :format "Java  " java-mode)
+                 (c-symbol-list :format "%v"))
+           (cons :format "%v"
+                 (const :format "IDL   " idl-mode)
+                 (c-symbol-list :format "%v"))
+           (cons :format "%v"
+                 (const :format "Pike  " pike-mode)
+                 (c-symbol-list :format "%v"))
+           (cons :format "%v"
+                 (const :format "AWK   " awk-mode)
+                 (c-symbol-list :format "%v"))
+           (cons :format "%v"
+                 (const :format "Other " other)
+                 (c-symbol-list :format "%v")))))
   :group 'c)
 
 (defcustom c-ignore-auto-fill '(string cpp code)
@@ -293,7 +595,6 @@ contexts are:
  cpp     -- inside a preprocessor directive
  code    -- anywhere else, i.e. in normal code"
   :type '(set
-         :extra-offset 8
          (const :tag "String literals" string)
          (const :tag "C style block comments" c)
          (const :tag "C++ style line comments" c++)
@@ -303,54 +604,99 @@ contexts are:
 
 (defcustom-c-stylevar c-cleanup-list '(scope-operator)
   "*List of various C/C++/ObjC constructs to \"clean up\".
-These clean ups only take place when the auto-newline feature is
-turned on, as evidenced by the `/a' or `/ah' appearing next to the
-mode name.  Valid symbols are:
+The following clean ups only take place when the auto-newline feature
+is turned on, as evidenced by the `/la' appearing next to the mode
+name:
 
- brace-else-brace    -- cleans up `} else {' constructs by placing entire
-                        construct on a single line.  This clean up
-                        only takes place when there is nothing but
+ brace-else-brace    -- Clean up \"} else {\" constructs by placing
+                        entire construct on a single line.  This clean
+                        up only takes place when there is nothing but
                         white space between the braces and the `else'.
                         Clean up occurs when the open brace after the
                         `else' is typed.
- brace-elseif-brace  -- similar to brace-else-brace, but cleans up
-                        `} else if (...) {' constructs.  Clean up occurs
-                        after the open parenthesis and the open brace.
- brace-catch-brace   -- similar to brace-elseif-brace, but cleans up
-                        `} catch (...) {' constructs.
- empty-defun-braces  -- cleans up empty defun braces by placing the
+ brace-elseif-brace  -- Similar to brace-else-brace, but clean up
+                        \"} else if (...) {\" constructs.  Clean up
+                        occurs after the open parenthesis and the open
+                        brace.
+ brace-catch-brace   -- Similar to brace-elseif-brace, but clean up
+                        \"} catch (...) {\" constructs.
+ empty-defun-braces  -- Clean up empty defun braces by placing the
                         braces on the same line.  Clean up occurs when
-                       the defun closing brace is typed.
- defun-close-semi    -- cleans up the terminating semi-colon on defuns
-                       by placing the semi-colon on the same line as
-                       the closing brace.  Clean up occurs when the
-                       semi-colon is typed.
- list-close-comma    -- cleans up commas following braces in array
+                        the defun closing brace is typed.
+ one-liner-defun     -- If the code inside a function body can fit in
+                        a single line, then remove any newlines
+                        between that line and the defun braces so that
+                        the whole body becomes a single line.
+                        `c-max-one-liner-length' gives the maximum
+                        length allowed for the resulting line.  Clean
+                        up occurs when the closing brace is typed.
+ defun-close-semi    -- Clean up the terminating semi-colon on defuns
+                        by placing the semi-colon on the same line as
+                        the closing brace.  Clean up occurs when the
+                        semi-colon is typed.
+ list-close-comma    -- Clean up commas following braces in array
                         and aggregate initializers.  Clean up occurs
-                       when the comma is typed.
- scope-operator      -- cleans up double colons which may designate
-                       a C++ scope operator split across multiple
-                       lines. Note that certain C++ constructs can
-                       generate ambiguous situations.  This clean up
-                       only takes place when there is nothing but
-                       whitespace between colons. Clean up occurs
-                       when the second colon is typed."
+                        when the comma is typed.
+ scope-operator      -- Clean up double colons which may designate
+                        a C++ scope operator split across multiple
+                        lines.  Note that certain C++ constructs can
+                        generate ambiguous situations.  This clean up
+                        only takes place when there is nothing but
+                        whitespace between colons.  Clean up occurs
+                        when the second colon is typed.
+
+The following clean ups always take place when they are on this list,
+regardless of the auto-newline feature, since they typically don't
+involve auto-newline inserted newlines:
+
+ space-before-funcall -- Insert exactly one space before the opening
+                        parenthesis of a function call.  Clean up
+                        occurs when the opening parenthesis is typed.
+ compact-empty-funcall -- Clean up any space before the function call
+                        opening parenthesis if and only if the
+                        argument list is empty.  This is typically
+                        useful together with `space-before-funcall' to
+                        get the style \"foo (bar)\" and \"foo()\".
+                        Clean up occurs when the closing parenthesis
+                        is typed.
+ comment-close-slash -- When a slash is typed after the comment prefix
+                        on a bare line in a c-style comment, the comment
+                        is closed by cleaning up preceding space and
+                        inserting a star if needed."
   :type '(set
-         :extra-offset 8
-         (const :tag "Put `} else {' on one line" brace-else-brace)
-         (const :tag "Put `} else if (...) {' on one line" brace-elseif-brace)
-         (const :tag "Put `} catch (...) {' on one line" brace-catch-brace)
-         (const :tag "Put empty defun braces on one line" empty-defun-braces)
-         (const :tag "Put `};' ending defuns on one line" defun-close-semi)
-         (const :tag "Put `},' in aggregates on one line" list-close-comma)
-         (const :tag "Put C++ style `::' on one line" scope-operator))
+         (const :tag "Put \"} else {\" on one line (brace-else-brace)"
+                brace-else-brace)
+         (const :tag "Put \"} else if (...) {\" on one line (brace-elseif-brace)"
+                brace-elseif-brace)
+         (const :tag "Put \"} catch (...) {\" on one line (brace-catch-brace)"
+                brace-catch-brace)
+         (const :tag "Put empty defun braces on one line (empty-defun-braces)"
+                empty-defun-braces)
+         (const :tag "Put short function bodies on one line (one-liner-defun)"
+                one-liner-defun)
+         (const :tag "Put \"};\" ending defuns on one line (defun-close-semi)"
+                defun-close-semi)
+         (const :tag "Put \"},\" in aggregates on one line (list-close-comma)"
+                list-close-comma)
+         (const :tag "Put C++ style \"::\" on one line (scope-operator)"
+                scope-operator)
+         (const :tag "Put a space before funcall parens, e.g. \"foo (bar)\" (space-before-funcall)"
+                space-before-funcall)
+         (const :tag "Remove space before empty funcalls, e.g. \"foo()\" (compact-empty-funcall)"
+                compact-empty-funcall)
+         (const :tag "Make / on a bare line of a C-style comment close it (comment-close-slash)"
+                comment-close-slash))
   :group 'c)
 
 (defcustom-c-stylevar c-hanging-braces-alist '((brace-list-open)
                                               (brace-entry-open)
+                                              (statement-cont)
                                               (substatement-open after)
                                               (block-close . c-snug-do-while)
                                               (extern-lang-open after)
+                                              (namespace-open after)
+                                              (module-open after)
+                                              (composition-open after)
                                               (inexpr-class-open after)
                                               (inexpr-class-close before))
   "*Controls the insertion of newlines before and after braces
@@ -364,16 +710,13 @@ associated ACTION is used to determine where newlines are inserted.
 If the context is not found, the default is to insert a newline both
 before and after the brace.
 
-SYNTACTIC-SYMBOL can be any of: defun-open, defun-close, class-open,
-class-close, inline-open, inline-close, block-open, block-close,
-substatement-open, statement-case-open, extern-lang-open,
-extern-lang-close, brace-list-open, brace-list-close,
-brace-list-intro, brace-entry-open, namespace-open, namespace-close,
-inexpr-class-open, or inexpr-class-close.  See `c-offsets-alist' for
-details, except for inexpr-class-open and inexpr-class-close, which
-doesn't have any corresponding symbols there.  Those two symbols are
-used for the opening and closing braces, respectively, of anonymous
-inner classes in Java.
+SYNTACTIC-SYMBOL can be statement-cont, brace-list-intro,
+inexpr-class-open, inexpr-class-close, and any of the *-open and
+*-close symbols.  See `c-offsets-alist' for details, except for
+inexpr-class-open and inexpr-class-close, which doesn't have any
+corresponding symbols there.  Those two symbols are used for the
+opening and closing braces, respectively, of anonymous inner classes
+in Java.
 
 ACTION can be either a function symbol or a list containing any
 combination of the symbols `before' or `after'.  If the list is empty,
@@ -393,7 +736,7 @@ syntactic context for the brace line."
                                    :size 20
                                    :value ,elt)
                    (choice :format "%[Choice%] %v"
-                    :value (before after)
+                           :value (before after)
                            (set :menu-tag "Before/after"
                                 :format "Newline %v brace\n"
                                 (const :format "%v, " before)
@@ -405,14 +748,22 @@ syntactic context for the brace line."
              class-open class-close
              inline-open inline-close
              block-open block-close
-             substatement-open statement-case-open
-             extern-lang-open extern-lang-close
+             statement-cont substatement-open statement-case-open
              brace-list-open brace-list-close
              brace-list-intro brace-entry-open
+             extern-lang-open extern-lang-close
              namespace-open namespace-close
+             module-open module-close
+             composition-open composition-close
              inexpr-class-open inexpr-class-close)))
     :group 'c)
 
+(defcustom c-max-one-liner-length 80
+  "Maximum length of line that clean-up \"one-liner-defun\" will compact to.
+Zero or nil means no limit."
+  :type 'integer
+  :group 'c)
+
 (defcustom-c-stylevar c-hanging-colons-alist nil
   "*Controls the insertion of newlines before and after certain colons.
 This variable contains an association list with elements of the
@@ -456,14 +807,32 @@ then no newline is inserted."
   :group 'c)
 
 (defcustom-c-stylevar c-backslash-column 48
-  "*Column to insert backslashes when macroizing a region."
+  "*Minimum alignment column for line continuation backslashes.
+This is used by the functions that automatically insert or align the
+line continuation backslashes in multiline macros.  If any line in the
+macro exceeds this column then the next tab stop from that line is
+used as alignment column instead.  See also `c-backslash-max-column'."
+  :type 'integer
+  :group 'c)
+;;;###autoload(put 'c-backslash-column 'safe-local-variable 'integerp)
+
+(defcustom-c-stylevar c-backslash-max-column 72
+  "*Maximum alignment column for line continuation backslashes.
+This is used by the functions that automatically insert or align the
+line continuation backslashes in multiline macros.  If any line in the
+macro exceeds this column then the backslashes for the other lines
+will be aligned at this column."
   :type 'integer
   :group 'c)
 
-(defcustom c-special-indent-hook nil
-  "*Hook for user defined special indentation adjustments.
-This hook gets called after a line is indented by the mode."
-  :type 'hook
+(defcustom c-auto-align-backslashes t
+  "*Align automatically inserted line continuation backslashes.
+When line continuation backslashes are inserted automatically for line
+breaks in multiline macros, e.g. by \\[c-context-line-break], they are
+aligned with the other backslashes in the same macro if this flag is
+set.  Otherwise the inserted backslashes are preceded by a single
+space."
+  :type 'boolean
   :group 'c)
 
 (defcustom c-backspace-function 'backward-delete-char-untabify
@@ -472,23 +841,66 @@ This hook gets called after a line is indented by the mode."
   :group 'c)
 
 (defcustom c-delete-function 'delete-char
-  "*Function called by `c-electric-delete' when deleting forwards."
+  "*Function called by `c-electric-delete-forward' when deleting forwards."
   :type 'function
   :group 'c)
 
+(defcustom c-require-final-newline
+  ;; C and C++ mandate that all nonempty files should end with a
+  ;; newline.  Objective-C refers to C for all things it doesn't
+  ;; specify, so the same holds there.  The other languages do not
+  ;; require it (at least not explicitly in a normative text).
+  '((c-mode    . t)
+    (c++-mode  . t)
+    (objc-mode . t))
+  "*Controls whether a final newline is ensured when the file is saved.
+The value is an association list that for each language mode specifies
+the value to give to `require-final-newline' at mode initialization;
+see that variable for details about the value.  If a language isn't
+present on the association list, CC Mode won't touch
+`require-final-newline' in buffers for that language."
+  :type `(set (cons :format "%v"
+                   (const :format "C     " c-mode)
+                   (symbol :format "%v" :value ,require-final-newline))
+             (cons :format "%v"
+                   (const :format "C++   " c++-mode)
+                   (symbol :format "%v" :value ,require-final-newline))
+             (cons :format "%v"
+                   (const :format "ObjC  " objc-mode)
+                   (symbol :format "%v" :value ,require-final-newline))
+             (cons :format "%v"
+                   (const :format "Java  " java-mode)
+                   (symbol :format "%v" :value ,require-final-newline))
+             (cons :format "%v"
+                   (const :format "IDL   " idl-mode)
+                   (symbol :format "%v" :value ,require-final-newline))
+             (cons :format "%v"
+                   (const :format "Pike  " pike-mode)
+                   (symbol :format "%v" :value ,require-final-newline))
+             (cons :format "%v"
+                   (const :format "AWK   " awk-mode)
+                   (symbol :format "%v" :value ,require-final-newline)))
+  :group 'c)
+
 (defcustom c-electric-pound-behavior nil
   "*List of behaviors for electric pound insertion.
 Only currently supported behavior is `alignleft'."
-  :type '(set :extra-offset 8 (const alignleft))
+  :type '(set (const alignleft))
+  :group 'c)
+
+(defcustom c-special-indent-hook nil
+  "*Hook for user defined special indentation adjustments.
+This hook gets called after each line is indented by the mode.  It is only
+called if `c-syntactic-indentation' is non-nil."
+  :type 'hook
   :group 'c)
 
 (defcustom-c-stylevar c-label-minimum-indentation 1
-  "*Minimum indentation for lines inside of top-level constructs.
+  "*Minimum indentation for lines inside code blocks.
 This variable typically only affects code using the `gnu' style, which
-mandates a minimum of one space in front of every line inside
-top-level constructs.  Specifically, the function
-`c-gnu-impose-minimum' on your `c-special-indent-hook' is what
-enforces this."
+mandates a minimum of one space in front of every line inside code
+blocks.  Specifically, the function `c-gnu-impose-minimum' on your
+`c-special-indent-hook' is what enforces this."
   :type 'integer
   :group 'c)
 
@@ -500,7 +912,8 @@ this variable to nil."
   :type 'integer
   :group 'c)
 
-(defcustom c-default-style "gnu"
+(defcustom c-default-style '((java-mode . "java") (awk-mode . "awk")
+                            (other . "gnu"))
   "*Style which gets installed by default when a file is visited.
 
 The value of this variable can be any style defined in
@@ -508,8 +921,7 @@ The value of this variable can be any style defined in
 association list of major mode symbols to style names.
 
 When the value is a string, all CC Mode major modes will install this
-style by default, except `java-mode', which always installs the
-\"java\" style (this is for backwards compatibility).
+style by default.
 
 When the value is an alist, the major mode symbol is looked up in it
 and the associated style is installed.  If the major mode is not
@@ -519,183 +931,201 @@ the alist, then \"gnu\" style is used.
 
 The default style gets installed before your mode hooks run, so you
 can always override the use of `c-default-style' by making calls to
-`c-set-style' in the appropriate mode hook.
-
-Tip: If you use different styles in different languages, you probably
-want to set `c-style-variables-are-local-p'."
+`c-set-style' in the appropriate mode hook."
   :type '(radio
-         (string :tag "Style in all modes (except Java)")
-         (repeat :tag "Mode-specific styles"
-                 :value ((other . "gnu"))
-                 (cons :format "%v"
-                       (choice :tag "Mode"
-                               (const c-mode) (const c++-mode)
-                               (const objc-mode) (const java-mode)
-                               (const idl-mode) (const pike-mode)
-                               (const other))
-                       (string :tag "Style")
-                       )))
-  :group 'c)
-
-(put 'c-offsets-alist 'c-stylevar-fallback
+         (string :tag "Style in all modes")
+         (set :tag "Mode-specific styles"
+           (cons :format "%v"
+                 (const :format "C     " c-mode) (string :format "%v"))
+           (cons :format "%v"
+                 (const :format "C++   " c++-mode) (string :format "%v"))
+           (cons :format "%v"
+                 (const :format "ObjC  " objc-mode) (string :format "%v"))
+           (cons :format "%v"
+                 (const :format "Java  " java-mode) (string :format "%v"))
+           (cons :format "%v"
+                 (const :format "IDL   " idl-mode) (string :format "%v"))
+           (cons :format "%v"
+                 (const :format "Pike  " pike-mode) (string :format "%v"))
+           (cons :format "%v"
+                 (const :format "AWK   " awk-mode) (string :format "%v"))
+           (cons :format "%v"
+                 (const :format "Other " other) (string :format "%v"))))
+  :group 'c)
+
+;; *) At the start of a statement or declaration means in more detail:
+;; At the closest preceding statement/declaration that starts at boi
+;; and doesn't have a label or comment at that position.  If there's
+;; no such statement within the same block, then back up to the
+;; surrounding block or statement, add the appropriate
+;; statement-block-intro, defun-block-intro or substatement syntax
+;; symbol and continue searching.
+(c-set-stylevar-fallback 'c-offsets-alist
      '((string                . c-lineup-dont-change)
-       ;; Relpos: Beg of previous line.
+       ;; Anchor pos: Beg of previous line.
        (c                     . c-lineup-C-comments)
-       ;; Relpos: Beg of the comment.
+       ;; Anchor pos: Beg of the comment.
        (defun-open            . 0)
-       ;; Relpos: Boi at the func decl start when inside classes, bol
-       ;; at the func decl start when at top level.
+       ;; Anchor pos: When inside a class: Boi at the func decl start.
+       ;; When at top level: Bol at the func decl start.  When inside
+       ;; a code block (only possible in Pike): At the func decl
+       ;; start(*).
        (defun-close           . 0)
-       ;; Relpos: Boi at the func decl start.
+       ;; Anchor pos: At the defun block open if it's at boi,
+       ;; otherwise boi at the func decl start.
        (defun-block-intro     . +)
-       ;; Relpos: Boi at the block open.
+       ;; Anchor pos: At the block open(*).
        (class-open            . 0)
-       ;; Relpos: Boi at the class decl start.
+       ;; Anchor pos: Boi at the class decl start.
        (class-close           . 0)
-       ;; Relpos: Boi at the class decl start.
+       ;; Anchor pos: Boi at the class decl start.
        (inline-open           . +)
-       ;; Relpos: None for functions (inclass got the relpos then),
-       ;; boi at the lambda start for lambdas.
+       ;; Anchor pos: None for functions (inclass got the relpos
+       ;; then), boi at the lambda start for lambdas.
        (inline-close          . 0)
-       ;; Relpos: For functions: Boi at the func decl start.  For
-       ;; lambdas: At the block open if it's at boi, at the boi of the
-       ;; lambda start otherwise.
+       ;; Anchor pos: Inexpr functions: At the lambda block open if
+       ;; it's at boi, else at the statement(*) at boi of the start of
+       ;; the lambda construct.  Otherwise: At the inline block open
+       ;; if it's at boi, otherwise boi at the func decl start.
        (func-decl-cont        . +)
-       ;; Relpos: Boi at the func decl start.
+       ;; Anchor pos: Boi at the func decl start.
        (knr-argdecl-intro     . +)
-       ;; Relpos: Boi at the current line.
+       ;; Anchor pos: Boi at the topmost intro line.
        (knr-argdecl           . 0)
-       ;; Relpos: Boi at the argdecl intro line.
+       ;; Anchor pos: At the beginning of the first K&R argdecl.
        (topmost-intro         . 0)
-       ;; Relpos: Bol at the last line of previous construct.
-       (topmost-intro-cont    . 0)
-       ;; Relpos: Boi at the topmost intro line.
+       ;; Anchor pos: Bol at the last line of previous construct.
+       (topmost-intro-cont    . c-lineup-topmost-intro-cont)
+       ;; Anchor pos: Boi at the topmost intro line.
        (member-init-intro     . +)
-       ;; Relpos: Boi at the func decl arglist open.
+       ;; Anchor pos: Boi at the func decl arglist open.
        (member-init-cont      . c-lineup-multi-inher)
-       ;; Relpos: Beg of the first member init.
+       ;; Anchor pos: Beg of the first member init.
        (inher-intro           . +)
-       ;; Relpos: Java: Boi at the class decl start.  Otherwise: Boi
-       ;; of current line (a bug?), unless it begins with an inher
-       ;; start colon, in which case boi of previous line is used.
+       ;; Anchor pos: Boi at the class decl start.
        (inher-cont            . c-lineup-multi-inher)
-       ;; Relpos: Java: At the implements/extends keyword start.
+       ;; Anchor pos: Java: At the implements/extends keyword start.
        ;; Otherwise: At the inher start colon, or boi at the class
        ;; decl start if the first inherit clause hangs and it's not a
        ;; func-local inherit clause (when does that occur?).
        (block-open            . 0)
-       ;; Relpos: Inexpr statement: Boi at the the preceding
-       ;; paren.  Otherwise: None.
+       ;; Anchor pos: Inexpr statement: At the statement(*) at boi of
+       ;; the start of the inexpr construct.  Otherwise: None.
        (block-close           . 0)
-       ;; Relpos: At the open brace if it's at boi.  Otherwise boi at
-       ;; the start of the statement the open brace hangs on, or boi
-       ;; at the preceding paren for inexpr statements.
+       ;; Anchor pos: Inexpr statement: At the inexpr block open if
+       ;; it's at boi, else at the statement(*) at boi of the start of
+       ;; the inexpr construct.  Block hanging on a case/default
+       ;; label: At the closest preceding label that starts at boi.
+       ;; Otherwise: At the block open(*).
        (brace-list-open       . 0)
-       ;; Relpos: Boi at the brace list decl start, but a starting
+       ;; Anchor pos: Boi at the brace list decl start, but a starting
        ;; "typedef" token is ignored.
        (brace-list-close      . 0)
-       ;; Relpos: Boi at the brace list open.
+       ;; Anchor pos: At the brace list decl start(*).
        (brace-list-intro      . +)
-       ;; Relpos: Boi at the brace list open.
+       ;; Anchor pos: At the brace list decl start(*).
        (brace-list-entry      . 0)
-       ;; Relpos: At the first non-ws char after the open paren if the
-       ;; first token is on the same line, otherwise boi at that
+       ;; Anchor pos: At the first non-ws char after the open paren if
+       ;; the first token is on the same line, otherwise boi at that
        ;; token.
        (brace-entry-open      . 0)
-       ;; Relpos: Same as brace-list-entry.
+       ;; Anchor pos: Same as brace-list-entry.
        (statement             . 0)
-       ;; Relpos: After a ';' in the condition clause of a for
+       ;; Anchor pos: After a `;' in the condition clause of a for
        ;; statement: At the first token after the starting paren.
-       ;; Otherwise: Boi at the start of the closest non-hanging
-       ;; previous statement, but after any switch label.
+       ;; Otherwise: At the preceding statement(*).
        (statement-cont        . +)
-       ;; Relpos: After the first token in the condition clause of a
-       ;; for statement: At the first token after the starting paren.
-       ;; On the first line in a continued expression that starts with
-       ;; a stream op and there's no stream op on the previous line:
-       ;; Boi of previous line.  Otherwise: Boi at the beginning of
-       ;; the statement, but after any type of label.
+       ;; Anchor pos: After the first token in the condition clause of
+       ;; a for statement: At the first token after the starting
+       ;; paren.  Otherwise: At the containing statement(*).
        (statement-block-intro . +)
-       ;; Relpos: At the block start if it's at boi, otherwise boi at
-       ;; the start of the statement the open brace hangs on, or boi
-       ;; at the preceding paren for inexpr statements.
+       ;; Anchor pos: In inexpr statement block: At the inexpr block
+       ;; open if it's at boi, else at the statement(*) at boi of the
+       ;; start of the inexpr construct.  In a block hanging on a
+       ;; case/default label: At the closest preceding label that
+       ;; starts at boi.  Otherwise: At the start of the containing
+       ;; block(*).
        (statement-case-intro  . +)
-       ;; Relpos: At the label keyword (always at boi).
+       ;; Anchor pos: At the case/default label(*).
        (statement-case-open   . 0)
-       ;; Relpos: At the label keyword (always at boi).
+       ;; Anchor pos: At the case/default label(*).
        (substatement          . +)
-       ;; Relpos: Boi at the containing statement or else clause.
+       ;; Anchor pos: At the containing statement(*).
        (substatement-open     . +)
-       ;; Relpos: Boi at the containing statement or else clause.
+       ;; Anchor pos: At the containing statement(*).
+       (substatement-label    . 2)
+       ;; Anchor pos: At the containing statement(*).
        (case-label            . 0)
-       ;; Relpos: At the switch block start if it's at boi, otherwise
-       ;; boi at the start of the switch condition clause.
+       ;; Anchor pos: At the start of the switch block(*).
        (access-label          . -)
-       ;; Relpos: Eol (a bug?).
+       ;; Anchor pos: Same as inclass.
        (label                 . 2)
-       ;; Relpos: At the start of the containing block if it's at boi,
-       ;; otherwise boi at the start of the sexp before the block.
+       ;; Anchor pos: At the start of the containing block(*).
        (do-while-closure      . 0)
-       ;; Relpos: Boi at the corresponding while keyword.
+       ;; Anchor pos: At the corresponding while statement(*).
        (else-clause           . 0)
-       ;; Relpos: Boi at the corresponding if keyword.
+       ;; Anchor pos: At the corresponding if statement(*).
        (catch-clause          . 0)
-       ;; Relpos: Boi at the previous try or catch keyword in the try
-       ;; statement.
-       (comment-intro         . c-lineup-comment)
-       ;; Relpos: None.
+       ;; Anchor pos: At the previous try or catch statement clause(*).
+       (comment-intro         . (c-lineup-knr-region-comment c-lineup-comment))
+       ;; Anchor pos: None.
        (arglist-intro         . +)
-       ;; Relpos: Boi at the open paren, or at the first non-ws after
-       ;; the open paren of the surrounding sexp, whichever is later.
-       (arglist-cont          . 0)
-       ;; Relpos: At the first token after the open paren.
-       (arglist-cont-nonempty . c-lineup-arglist)
-       ;; Relpos: Boi at the open paren, or at the first non-ws after
-       ;; the open paren of the surrounding sexp, whichever is later.
+       ;; Anchor pos: At the containing statement(*).
+       ;; 2nd pos: At the open paren.
+       (arglist-cont          . (c-lineup-gcc-asm-reg 0))
+       ;; Anchor pos: At the first token after the open paren.
+       (arglist-cont-nonempty . (c-lineup-gcc-asm-reg c-lineup-arglist))
+       ;; Anchor pos: At the containing statement(*).
+       ;; 2nd pos: At the open paren.
        (arglist-close         . +)
-       ;; Relpos: Boi at the open paren, or at the first non-ws after
-       ;; the open paren of the surrounding sexp, whichever is later.
+       ;; Anchor pos: At the containing statement(*).
+       ;; 2nd pos: At the open paren.
        (stream-op             . c-lineup-streamop)
-       ;; Relpos: Boi at the first stream op in the statement.
+       ;; Anchor pos: Boi at the first stream op in the statement.
        (inclass               . +)
-       ;; Relpos: At the class open brace if it's at boi, otherwise
-       ;; boi at the class decl start.
-       (cpp-macro             . -1000)
-       ;; Relpos: None.
-       (cpp-macro-cont        . c-lineup-dont-change)
-       ;; Relpos: At the macro start (always at boi).
+       ;; Anchor pos: At the class open brace if it's at boi,
+       ;; otherwise boi at the class decl start.
+       (cpp-macro             . [0])
+       ;; Anchor pos: None.
+       (cpp-macro-cont        . +)
+       ;; Anchor pos: At the macro start (always at boi).
+       (cpp-define-intro      . (c-lineup-cpp-define +))
+       ;; Anchor pos: None.
        (friend                . 0)
-       ;; Relpos: None.
-       (objc-method-intro     . -1000)
-       ;; Relpos: Boi.
+       ;; Anchor pos: None.
+       (objc-method-intro     . [0])
+       ;; Anchor pos: Boi.
        (objc-method-args-cont . c-lineup-ObjC-method-args)
-       ;; Relpos: At the method start (always at boi).
+       ;; Anchor pos: At the method start (always at boi).
        (objc-method-call-cont . c-lineup-ObjC-method-call)
-       ;; Relpos: At the open bracket.
+       ;; Anchor pos: At the open bracket.
        (extern-lang-open      . 0)
-       ;; Relpos: Boi at the extern keyword.
-       (extern-lang-close     . 0)
-       ;; Relpos: Boi at the corresponding extern keyword.
-       (inextern-lang         . +)
-       ;; Relpos: At the extern block open brace if it's at boi,
-       ;; otherwise boi at the extern keyword.
        (namespace-open        . 0)
-       ;; Relpos: Boi at the namespace keyword.
+       (module-open           . 0)
+       (composition-open      . 0)
+       ;; Anchor pos: Boi at the extern/namespace/etc keyword.
+       (extern-lang-close     . 0)
        (namespace-close       . 0)
-       ;; Relpos: Boi at the corresponding namespace keyword.
+       (module-close          . 0)
+       (composition-close     . 0)
+       ;; Anchor pos: Boi at the corresponding extern/namespace/etc keyword.
+       (inextern-lang         . +)
        (innamespace           . +)
-       ;; Relpos: At the namespace block open brace if it's at boi,
-       ;; otherwise boi at the namespace keyword.
+       (inmodule              . +)
+       (incomposition         . +)
+       ;; Anchor pos: At the extern/namespace/etc block open brace if
+       ;; it's at boi, otherwise boi at the keyword.
        (template-args-cont    . (c-lineup-template-args +))
-       ;; Relpos: Boi at the decl start.
+       ;; Anchor pos: Boi at the decl start.  This might be changed;
+       ;; the logical position is clearly the opening '<'.
        (inlambda              . c-lineup-inexpr-block)
-       ;; Relpos: None.
+       ;; Anchor pos: None.
        (lambda-intro-cont     . +)
-       ;; Relpos: Boi at the lambda start.
-       (inexpr-statement      . 0)
-       ;; Relpos: None.
+       ;; Anchor pos: Boi at the lambda start.
+       (inexpr-statement      . +)
+       ;; Anchor pos: None.
        (inexpr-class          . +)
-       ;; Relpos: None.
+       ;; Anchor pos: None.
        ))
 (defcustom c-offsets-alist nil
   "Association list of syntactic element symbols and indentation offsets.
@@ -705,44 +1135,70 @@ As described below, each cons cell in this list has the form:
 
 When a line is indented, CC Mode first determines the syntactic
 context of it by generating a list of symbols called syntactic
-elements.  This list can contain more than one syntactic element and
-the global variable `c-syntactic-context' contains the context list
-for the line being indented.  Each element in this list is actually a
-cons cell of the syntactic symbol and a buffer position.  This buffer
-position is called the relative indent point for the line.  Some
-syntactic symbols may not have a relative indent point associated with
-them.
-
-After the syntactic context list for a line is generated, CC Mode
-calculates the absolute indentation for the line by looking at each
-syntactic element in the list.  It compares the syntactic element
-against the SYNTACTIC-SYMBOL's in `c-offsets-alist'.  When it finds a
-match, it adds the OFFSET to the column of the relative indent point.
-The sum of this calculation for each element in the syntactic list is
+elements.  The global variable `c-syntactic-context' is bound to the
+that list.  Each element in the list is in turn a list where the first
+element is a syntactic symbol which tells what kind of construct the
+indentation point is located within.  More elements in the syntactic
+element lists are optional.  If there is one more and it isn't nil,
+then it's the anchor position for that construct.
+
+After generating the syntactic context for the line, CC Mode
+calculates the absolute indentation: First the base indentation is
+found by using the anchor position for the first syntactic element
+that provides one.  If none does, zero is used as base indentation.
+Then CC Mode looks at each syntactic element in the context in turn.
+It compares the car of the syntactic element against the
+SYNTACTIC-SYMBOL's in `c-offsets-alist'.  When it finds a match, it
+adds OFFSET to the base indentation.  The sum of this calculation is
 the absolute offset for line being indented.
 
 If the syntactic element does not match any in the `c-offsets-alist',
-an error is generated if `c-strict-syntax-p' is non-nil, otherwise the
-element is ignored.
-
-Actually, OFFSET can be an integer, a function, a variable, or one of
-the following symbols: `+', `-', `++', `--', `*', or `/'.  These
-latter designate positive or negative multiples of `c-basic-offset',
-respectively: 1, -1, 2, -2, 0.5, and -0.5.  If OFFSET is a function,
-it is called with a single argument containing the cons of the
-syntactic element symbol and the relative indent point.  The function
-should return an integer offset or nil if it can't decide.
-
-OFFSET can also be a list, in which case it is recursively evaluated
-using the semantics described above.  The first element of the list to 
-return a non-nil value succeeds.  If none of the elements returns a
-non-nil value, then what happends depends on the value of
-`c-strict-syntax-p'.  When `c-strict-syntax-p' is nil, then an offset
-of zero is used, otherwise an error is generated.
+the element is ignored.
+
+OFFSET can specify an offset in several different ways:
+
+  If OFFSET is nil then it's ignored.
+
+  If OFFSET is an integer then it's used as relative offset, i.e. it's
+  added to the base indentation.
+
+  If OFFSET is one of the symbols `+', `-', `++', `--', `*', or `/'
+  then a positive or negative multiple of `c-basic-offset' is added to
+  the base indentation; 1, -1, 2, -2, 0.5, and -0.5, respectively.
+
+  If OFFSET is a symbol with a value binding then that value, which
+  must be an integer, is used as relative offset.
+
+  If OFFSET is a vector then its first element, which must be an
+  integer, is used as an absolute indentation column.  This overrides
+  the previous base indentation and the relative offsets applied to
+  it, and it becomes the new base indentation.
+
+  If OFFSET is a function or a lambda expression then it's called with
+  a single argument containing the cons of the syntactic symbol and
+  the anchor position (or nil if there is none).  The return value
+  from the function is then reinterpreted as an offset specification.
+
+  If OFFSET is a list then its elements are evaluated recursively as
+  offset specifications.  If the first element is any of the symbols
+  below then it isn't evaluated but instead specifies how the
+  remaining offsets in the list should be combined.  If it's something
+  else then the list is combined according the method `first'.  The
+  valid combination methods are:
+
+  `first' -- Use the first offset (that doesn't evaluate to nil).
+  `min'   -- Use the minimum of all the offsets.  All must be either
+             relative or absolute - they can't be mixed.
+  `max'   -- Use the maximum of all the offsets.  All must be either
+             relative or absolute - they can't be mixed.
+  `add'   -- Add all the evaluated offsets together.  Exactly one of
+             them may be absolute, in which case the result is
+             absolute.  Any relative offsets that preceded the
+             absolute one in the list will be ignored in that case.
 
 `c-offsets-alist' is a style variable.  This means that the offsets on
 this variable are normally taken from the style system in CC Mode
-\(see `c-default-style' and `c-styles-alist').  However, any offsets
+\(see `c-default-style' and `c-style-alist').  However, any offsets
 put explicitly on this list will override the style system when a CC
 Mode buffer is initialized \(there is a variable
 `c-old-style-variable-behavior' that changes this, though).
@@ -787,12 +1243,13 @@ Here is the current list of valid syntactic element symbols:
  statement-case-open    -- The first line in a case block starting with brace.
  substatement           -- The first line after an if/while/for/do/else.
  substatement-open      -- The brace that opens a substatement block.
- case-label             -- A `case' or `default' label.
+ substatement-label     -- Labelled line after an if/while/for/do/else.
+ case-label             -- A \"case\" or \"default\" label.
  access-label           -- C++ private/protected/public access label.
  label                  -- Any ordinary label.
- do-while-closure       -- The `while' that ends a do/while construct.
- else-clause            -- The `else' of an if/else construct.
- catch-clause           -- The `catch' or `finally' of a try/catch construct.
+ do-while-closure       -- The \"while\" that ends a do/while construct.
+ else-clause            -- The \"else\" of an if/else construct.
+ catch-clause           -- The \"catch\" or \"finally\" of a try/catch construct.
  comment-intro          -- A line containing only a comment introduction.
  arglist-intro          -- The first line in an argument list.
  arglist-cont           -- Subsequent argument list lines when no
@@ -806,20 +1263,24 @@ Here is the current list of valid syntactic element symbols:
  inclass                -- The construct is nested inside a class definition.
                            Used together with e.g. `topmost-intro'.
  cpp-macro              -- The start of a C preprocessor macro definition.
- cpp-macro-cont         -- Subsequent lines in a multi-line C preprocessor
-                           macro definition.
+ cpp-macro-cont         -- Inside a multi-line C preprocessor macro definition.
  friend                 -- A C++ friend declaration.
  objc-method-intro      -- The first line of an Objective-C method definition.
  objc-method-args-cont  -- Lines continuing an Objective-C method definition.
  objc-method-call-cont  -- Lines continuing an Objective-C method call.
- extern-lang-open       -- Brace that opens an external language block.
- extern-lang-close      -- Brace that closes an external language block.
+ extern-lang-open       -- Brace that opens an \"extern\" block.
+ extern-lang-close      -- Brace that closes an \"extern\" block.
  inextern-lang          -- Analogous to the `inclass' syntactic symbol,
-                           but used inside extern constructs.
- namespace-open         -- Brace that opens a C++ namespace block.
- namespace-close        -- Brace that closes a C++ namespace block.
- innamespace            -- Analogous to the `inextern-lang' syntactic
-                           symbol, but used inside C++ namespace constructs.
+                           but used inside \"extern\" blocks.
+ namespace-open, namespace-close, innamespace
+                        -- Similar to the three `extern-lang' symbols, but for
+                           C++ \"namespace\" blocks.
+ module-open, module-close, inmodule
+                        -- Similar to the three `extern-lang' symbols, but for
+                           CORBA IDL \"module\" blocks.
+ composition-open, composition-close, incomposition
+                        -- Similar to the three `extern-lang' symbols, but for
+                           CORBA CIDL \"composition\" blocks.
  template-args-cont     -- C++ template argument list continuations.
  inlambda               -- In the header or body of a lambda function.
  lambda-intro-cont      -- Continuation of the header of a lambda function.
@@ -846,6 +1307,14 @@ Here is the current list of valid syntactic element symbols:
           (get 'c-offsets-alist 'c-stylevar-fallback)))
   :group 'c)
 
+;; The syntactic symbols that can occur inside code blocks. Used by
+;; `c-gnu-impose-minimum'.
+(defconst c-inside-block-syms
+  '(defun-block-intro block-open block-close statement statement-cont
+    statement-block-intro statement-case-intro statement-case-open
+    substatement substatement-open substatement-label case-label label
+    do-while-closure else-clause catch-clause inlambda))
+
 (defcustom c-style-variables-are-local-p t
   "*Whether style variables should be buffer local by default.
 If non-nil, then all indentation style related variables will be made
@@ -853,18 +1322,24 @@ buffer local by default.  If nil, they will remain global.  Variables
 are made buffer local when this file is loaded, and once buffer
 localized, they cannot be made global again.
 
+This variable must be set appropriately before CC Mode is loaded.
+
 The list of variables to buffer localize are:
-    c-offsets-alist
     c-basic-offset
     c-comment-only-line-offset
+    c-indent-comment-alist
+    c-indent-comments-syntactically-p
     c-block-comment-prefix
     c-comment-prefix-regexp
+    c-doc-comment-style
     c-cleanup-list
     c-hanging-braces-alist
     c-hanging-colons-alist
     c-hanging-semi&comma-criteria
     c-backslash-column
+    c-backslash-max-column
     c-label-minimum-indentation
+    c-offsets-alist
     c-special-indent-hook
     c-indentation-style"
   :type 'boolean
@@ -900,9 +1375,14 @@ The list of variables to buffer localize are:
   :type 'hook
   :group 'c)
 
+(defcustom awk-mode-hook nil
+  "*Hook called by `awk-mode'."
+  :type 'hook
+  :group 'c)
+
 (defcustom c-mode-common-hook nil
   "*Hook called by all CC Mode modes for common initializations."
-  :type '(hook :format "%{CC Mode Common Hook%}:\n%v")
+  :type 'hook
   :group 'c)
 
 (defcustom c-initialization-hook nil
@@ -919,14 +1399,16 @@ Java coding styles) this can improve performance between 3 and 60
 times for core indentation functions (e.g. `c-parse-state').  For
 styles that conform to the Emacs recommendation of putting these
 braces in column zero, this can degrade performance about as much.
-This variable only has effect in XEmacs.")
+This variable only has effect in XEmacs."
+  :type 'boolean
+  :group 'c)
 
-(defcustom c-old-style-variable-behavior nil
+(defvar c-old-style-variable-behavior nil
   "*Enables the old style variable behavior when non-nil.
 
 Normally the values of the style variables will override the style
 settings specified by the variables `c-default-style' and
-`c-styles-alist'.  However, in CC Mode 5.25 and earlier, it was the
+`c-style-alist'.  However, in CC Mode 5.25 and earlier, it was the
 other way around, meaning that changes made to the style variables
 from e.g. Customize would not take effect unless special precautions
 were taken.  That was confusing, especially for novice users.
@@ -937,6 +1419,122 @@ all style variables are per default set in a special non-override
 state.  Set this variable only if your configuration has stopped
 working due to this change.")
 
+(define-widget 'c-extra-types-widget 'radio
+  "Internal CC Mode widget for the `*-font-lock-extra-types' variables."
+  :args '((const :tag "none" nil)
+         (repeat :tag "types" regexp)))
+
+(defun c-make-font-lock-extra-types-blurb (mode1 mode2 example)
+  (concat "\
+*List of extra types (aside from the type keywords) to recognize in "
+mode1 " mode.
+Each list item should be a regexp matching a single identifier.
+" example "
+
+Note that items on this list that don't include any regexp special
+characters are automatically optimized using `regexp-opt', so you
+should not use `regexp-opt' explicitly to build regexps here.
+
+On decoration level 3 (and higher, where applicable), a method is used
+that finds most types and declarations by syntax alone.  This variable
+is still used as a first step, but other types are recognized
+correctly anyway in most cases.  Therefore this variable should be
+fairly restrictive and not contain patterns that are uncertain.
+
+Note that this variable is only consulted when the major mode is
+initialized.  If you change it later you have to reinitialize CC Mode
+by doing \\[" mode2 "].
+
+Despite the name, this variable is not only used for font locking but
+also elsewhere in CC Mode to tell types from other identifiers."))
+
+;; Note: Most of the variables below are also defined in font-lock.el
+;; in older versions of Emacs, so depending on the load order we might
+;; not install the values below.  There's no kludge to cope with this
+;; (as opposed to the *-font-lock-keywords-* variables) since the old
+;; values work fairly well anyway.
+
+(defcustom c-font-lock-extra-types
+  '("\\sw+_t"
+    ;; Defined in C99:
+    "bool" "complex" "imaginary"
+    ;; Standard library types (except those matched by the _t pattern):
+    "FILE" "lconv" "tm" "va_list" "jmp_buf"
+    ;; I do not appreciate the following very Emacs-specific luggage
+    ;; in the default value, but otoh it can hardly get in the way for
+    ;; other users, and removing it would cause unnecessary grief for
+    ;; the old timers that are used to it. /mast
+    "Lisp_Object")
+  (c-make-font-lock-extra-types-blurb "C" "c-mode"
+"For example, a value of (\"FILE\" \"\\\\sw+_t\") means the word \"FILE\"
+and words ending in \"_t\" are treated as type names.")
+  :type 'c-extra-types-widget
+  :group 'c)
+
+(defcustom c++-font-lock-extra-types
+  '("\\sw+_t"
+    ;; C library types (except those matched by the _t pattern):
+    "FILE" "lconv" "tm" "va_list" "jmp_buf"
+    ;; Some standard C++ types that came from font-lock.el.
+    ;; Experienced C++ users says there's no clear benefit in
+    ;; extending this to all the types in the standard library, at
+    ;; least not when they'll be recognized without "std::" too.
+    "istream" "istreambuf"
+    "ostream" "ostreambuf"
+    "ifstream" "ofstream" "fstream"
+    "strstream" "strstreambuf" "istrstream" "ostrstream"
+    "ios"
+    "string" "rope"
+    "list" "slist"
+    "deque" "vector" "bit_vector"
+    "set" "multiset"
+    "map" "multimap"
+    "hash"
+    "hash_set" "hash_multiset"
+    "hash_map" "hash_multimap"
+    "stack" "queue" "priority_queue"
+    "type_info"
+    "iterator" "const_iterator" "reverse_iterator" "const_reverse_iterator"
+    "reference" "const_reference")
+  (c-make-font-lock-extra-types-blurb "C++" "c++-mode"
+"For example, a value of (\"string\") means the word \"string\" is treated
+as a type name.")
+  :type 'c-extra-types-widget
+  :group 'c)
+
+(defcustom objc-font-lock-extra-types
+  (list (concat "[" c-upper "]\\sw*[" c-lower "]\\sw*"))
+  (c-make-font-lock-extra-types-blurb "ObjC" "objc-mode" (concat
+"For example, a value of (\"[" c-upper "]\\\\sw*[" c-lower "]\\\\sw*\") means
+capitalized words are treated as type names (the requirement for a
+lower case char is to avoid recognizing all-caps macro and constant
+names)."))
+  :type 'c-extra-types-widget
+  :group 'c)
+
+(defcustom java-font-lock-extra-types
+  (list (concat "[" c-upper "]\\sw*[" c-lower "]\\sw*"))
+  (c-make-font-lock-extra-types-blurb "Java" "java-mode" (concat
+"For example, a value of (\"[" c-upper "]\\\\sw*[" c-lower "]\\\\sw*\") means
+capitalized words are treated as type names (the requirement for a
+lower case char is to avoid recognizing all-caps constant names)."))
+  :type 'c-extra-types-widget
+  :group 'c)
+
+(defcustom idl-font-lock-extra-types nil
+  (c-make-font-lock-extra-types-blurb "IDL" "idl-mode" "")
+  :type 'c-extra-types-widget
+  :group 'c)
+
+(defcustom pike-font-lock-extra-types
+  (list (concat "[" c-upper "]\\sw*[" c-lower "]\\sw*"))
+  (c-make-font-lock-extra-types-blurb "Pike" "pike-mode" (concat
+"For example, a value of (\"[" c-upper "]\\\\sw*[" c-lower "]\\\\sw*\") means
+capitalized words are treated as type names (the requirement for a
+lower case char is to avoid recognizing all-caps macro and constant
+names)."))
+  :type 'c-extra-types-widget
+  :group 'c)
 
 \f
 ;; Non-customizable variables, still part of the interface to CC Mode
@@ -949,6 +1547,7 @@ will set the style of the file to this value automatically.
 Note that file style settings are applied before file offset settings
 as designated in the variable `c-file-offsets'.")
 (make-variable-buffer-local 'c-file-style)
+;;;###autoload(put 'c-file-style 'safe-local-variable 'string-or-null-p)
 
 (defvar c-file-offsets nil
   "Variable interface for setting offsets via File Local Variables.
@@ -961,57 +1560,85 @@ Note that file offset settings are applied after file style settings
 as designated in the variable `c-file-style'.")
 (make-variable-buffer-local 'c-file-offsets)
 
-(defvar c-syntactic-context nil
-  "Variable containing syntactic analysis list during indentation.")
+;; It isn't possible to specify a doc-string without specifying an
+;; initial value with `defvar', so the following two variables have been
+;; given doc-strings by setting the property `variable-documentation'
+;; directly.  C-h v will read this documentation only for versions of GNU
+;; Emacs from 22.1.  It's really good not to have an initial value for
+;; variables like these that always should be dynamically bound, so it's
+;; worth the inconvenience.
+
+(cc-bytecomp-defvar c-syntactic-context)
+(defvar c-syntactic-context)
+(put 'c-syntactic-context 'variable-documentation
+  "Variable containing the syntactic analysis list for a line of code.
+
+It is a list with one element for each syntactic symbol pertinent to the
+line, for example \"((defun-block-intro 1) (comment-intro))\".
+
+It is dynamically bound when calling \(i) a brace hanging \"action
+function\"; \(ii) a semicolon/comma hanging \"criteria function\"; \(iii) a
+\"line-up function\"; \(iv) a c-special-indent-hook function.  It is also
+used internally by CC Mode.
+
+c-syntactic-context is always bound dynamically.  It must NEVER be set
+statically (e.g. with `setq').")
+
+
+(cc-bytecomp-defvar c-syntactic-element)
+(defvar c-syntactic-element)
+(put 'c-syntactic-element 'variable-documentation
+     "Variable containing the current syntactic element during calls to
+the lineup functions.  The value is one of the elements in the list in
+`c-syntactic-context' and is a list with the symbol name in the first
+position, followed by zero or more elements containing any additional
+info associated with the syntactic symbol.  There are accessor functions
+`c-langelem-sym', `c-langelem-pos', `c-langelem-col', and
+`c-langelem-2nd-pos' to access the list.
+
+Specifically, the element returned by `c-langelem-pos' is the anchor
+position, or nil if there isn't any.  See the comments in the
+`c-offsets-alist' variable and the CC Mode manual for more detailed info
+about the data each syntactic symbol provides.
+
+This is always bound dynamically.  It should never be set
+statically (e.g. with `setq').")
 
 (defvar c-indentation-style nil
-  "Name of the currently installed style.")
-
+  "Name of the currently installed style.
+Don't change this directly; call `c-set-style' instead, or set the variable
+`c-file-style' in the file's Local Variable list.")
+
+(defvar c-current-comment-prefix nil
+  "The current comment prefix regexp.
+Set from `c-comment-prefix-regexp' at mode initialization.")
+(make-variable-buffer-local 'c-current-comment-prefix)
+
+;; N.B. The next three variables are initialized in
+;; c-setup-paragraph-variables.  Their initializations here are "just in
+;; case".  ACM, 2004/2/15.  They are NOT buffer local (yet?).
+(defvar c-string-par-start
+;;   (concat "\\(" (default-value 'paragraph-start) "\\)\\|[ \t]*\\\\$")
+  "\f\\|[ \t]*\\\\?$"
+  "Value of paragraph-start used when scanning strings.
+It treats escaped EOLs as whitespace.")
+
+(defvar c-string-par-separate
+  ;; (concat "\\(" (default-value 'paragraph-separate) "\\)\\|[ \t]*\\\\$")
+  "[ \t\f]*\\\\?$"
+  "Value of paragraph-separate used when scanning strings.
+It treats escaped EOLs as whitespace.")
+
+(defvar c-sentence-end-with-esc-eol
+  (concat "\\(\\(" (c-default-value-sentence-end) "\\)"
+               ;; N.B.:  "$" would be illegal when not enclosed like "\\($\\)".
+               "\\|" "[.?!][]\"')}]* ?\\\\\\($\\)[ \t\n]*"
+               "\\)")
+  "Value used like sentence-end used when scanning strings.
+It treats escaped EOLs as whitespace.")
 
 \f
-;; Figure out what features this Emacs has
-;;;###autoload
-(defconst c-emacs-features
-  (let ((infodock-p (boundp 'infodock-version))
-       (comments
-        ;; XEmacs 19 and beyond use 8-bit modify-syntax-entry flags.
-        ;; Emacs 19 uses a 1-bit flag.  We will have to set up our
-        ;; syntax tables differently to handle this.
-        (let ((table (copy-syntax-table))
-              entry)
-          (modify-syntax-entry ?a ". 12345678" table)
-          (cond
-           ;; XEmacs 19, and beyond Emacs 19.34
-           ((arrayp table)
-            (setq entry (aref table ?a))
-            ;; In Emacs, table entries are cons cells
-            (if (consp entry) (setq entry (car entry))))
-           ;; XEmacs 20
-           ((fboundp 'get-char-table) (setq entry (get-char-table ?a table)))
-           ;; before and including Emacs 19.34
-           ((and (fboundp 'char-table-p)
-                 (char-table-p table))
-            (setq entry (car (char-table-range table [?a]))))
-           ;; incompatible
-           (t (error "CC Mode is incompatible with this version of Emacs")))
-          (if (= (logand (lsh entry -16) 255) 255)
-              '8-bit
-            '1-bit))))
-    (if infodock-p
-       (list comments 'infodock)
-      (list comments)))
-  "A list of features extant in the Emacs you are using.
-There are many flavors of Emacs out there, each with different
-features supporting those needed by CC Mode.  Here's the current
-supported list, along with the values for this variable:
-
- XEmacs 19, 20, 21:          (8-bit)
- Emacs 19, 20:               (1-bit)
-
-Infodock (based on XEmacs) has an additional symbol on this list:
-`infodock'.")
+(cc-provide 'cc-vars)
 
-
-\f
-(provide 'cc-vars)
+;;; arch-tag: d62e9a55-c9fe-409b-b5b6-050b6aa202c9
 ;;; cc-vars.el ends here