]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/cc-langs.el
Merge branch 'emacs-25-merge'
[gnu-emacs] / lisp / progmodes / cc-langs.el
index 4d16a9b9d33a48761eb877dcbce1aedf20279c2c..1a07c4cd699597dd4bee2983d16d307f2579370f 100644 (file)
 
 
 ;; This file is not always loaded.  See note above.
-(cc-external-require 'cl)
+(cc-external-require (if (eq c--mapcan-status 'cl-mapcan) 'cl-lib 'cl))
 
 \f
 ;;; Setup for the `c-lang-defvar' system.
@@ -251,19 +251,19 @@ the evaluated constant value at compile time."
     (unless xlate
       (setq xlate 'identity))
     (c-with-syntax-table (c-lang-const c-mode-syntax-table)
-      (delete-duplicates
-       (mapcan (lambda (opgroup)
-                (when (if (symbolp (car opgroup))
-                          (when (funcall opgroup-filter (car opgroup))
-                            (setq opgroup (cdr opgroup))
-                            t)
-                        t)
-                  (mapcan (lambda (op)
-                            (when (funcall op-filter op)
-                              (let ((res (funcall xlate op)))
-                                (if (listp res) res (list res)))))
-                          opgroup)))
-              ops)
+      (c--delete-duplicates
+       (c--mapcan (lambda (opgroup)
+                   (when (if (symbolp (car opgroup))
+                             (when (funcall opgroup-filter (car opgroup))
+                               (setq opgroup (cdr opgroup))
+                               t)
+                           t)
+                     (c--mapcan (lambda (op)
+                                  (when (funcall op-filter op)
+                                    (let ((res (funcall xlate op)))
+                                      (if (listp res) res (list res)))))
+                                opgroup)))
+                 ops)
        :test 'equal))))
 
 \f
@@ -327,7 +327,7 @@ the evaluated constant value at compile time."
 
 (defun c-populate-syntax-table (table)
   "Populate the given syntax table as necessary for a C-like language.
-This includes setting ' and \" as string delimiters, and setting up
+This includes setting \\=' and \" as string delimiters, and setting up
 the comment syntax to handle both line style \"//\" and block style
 \"/*\" \"*/\" comments."
 
@@ -403,7 +403,9 @@ The syntax tables aren't stored directly since they're quite large."
           table)))
 (c-lang-defvar c++-template-syntax-table
   (and (c-lang-const c++-make-template-syntax-table)
-       (funcall (c-lang-const c++-make-template-syntax-table))))
+       ;; The next eval remove a superfluous ' from '(lambda.  This
+       ;; gets rid of compilation warnings.
+       (funcall (eval (c-lang-const c++-make-template-syntax-table)))))
 
 (c-lang-defconst c-make-no-parens-syntax-table
   ;; A variant of the standard syntax table which is used to find matching
@@ -426,7 +428,8 @@ The syntax tables aren't stored directly since they're quite large."
          table))))
 (c-lang-defvar c-no-parens-syntax-table
   (and (c-lang-const c-make-no-parens-syntax-table)
-       (funcall (c-lang-const c-make-no-parens-syntax-table))))
+       ;; See comment in `c++template-syntax-table' about the next `eval'.
+       (funcall (eval (c-lang-const c-make-no-parens-syntax-table)))))
 
 (c-lang-defconst c-identifier-syntax-modifications
   "A list that describes the modifications that should be done to the
@@ -457,7 +460,7 @@ the new syntax, as accepted by `modify-syntax-entry'."
       (modify-syntax-entry (car mod) (cdr mod) table))
     table)
   "Syntax table built on the mode syntax table but additionally
-classifies symbol constituents like '_' and '$' as word constituents,
+classifies symbol constituents like `_' and `$' as word constituents,
 so that all identifiers are recognized as words.")
 
 (c-lang-defconst c-get-state-before-change-functions
@@ -495,9 +498,9 @@ parameters \(point-min) and \(point-max).")
 (c-lang-defconst c-before-font-lock-functions
   ;; For documentation see the following c-lang-defvar of the same name.
   ;; The value here may be a list of functions or a single function.
-  t 'c-change-set-fl-decl-start
+  t 'c-change-expand-fl-region
   (c c++ objc) '(c-neutralize-syntax-in-and-mark-CPP
-                c-change-set-fl-decl-start)
+                c-change-expand-fl-region)
   awk 'c-awk-extend-and-syntax-tablify-region)
 (c-lang-defvar c-before-font-lock-functions
               (let ((fs (c-lang-const c-before-font-lock-functions)))
@@ -524,7 +527,7 @@ parameters \(point-min), \(point-max) and <buffer size>.")
 
 (c-lang-defconst c-before-context-fontification-functions
   awk nil
-  t 'c-context-set-fl-decl-start)
+  t 'c-context-expand-fl-region)
   ;; For documentation see the following c-lang-defvar of the same name.
   ;; The value here may be a list of functions or a single function.
 (c-lang-defvar c-before-context-fontification-functions
@@ -578,8 +581,8 @@ EOL terminated statements."
 (c-lang-defvar c-has-bitfields (c-lang-const c-has-bitfields))
 
 (c-lang-defconst c-modified-constant
-  "Regexp that matches a \"modified\" constant literal such as \"L'a'\",
-a \"long character\".  In particular, this recognizes forms of constant
+  "Regexp that matches a “modified” constant literal such as \"L\\='a\\='\",
+a “long character”.  In particular, this recognizes forms of constant
 which `c-backward-sexp' needs to be called twice to move backwards over."
   t nil
   (c c++ objc) "L'\\([^\\'\t\f\n\r]\\|\\\\.\\)'")
@@ -870,7 +873,7 @@ definition, or nil if the language doesn't have any."
   t (if (c-lang-const c-opt-cpp-macro-define)
        (concat (c-lang-const c-opt-cpp-prefix)
                (c-lang-const c-opt-cpp-macro-define)
-               "[ \t]+\\(\\(\\sw\\|_\\)+\\)\\(\([^\)]*\)\\)?"
+               "[ \t]+\\(\\(\\sw\\|_\\)+\\)\\(([^)]*)\\)?"
                ;;       ^                 ^ #defined name
                "\\([ \t]\\|\\\\\n\\)*")))
 (c-lang-defvar c-opt-cpp-macro-define-start
@@ -926,14 +929,14 @@ following elements.  The car of each element describes the type of the
 operator group, and the cdr is a list of the operator tokens in it.
 The operator group types are:
 
-'prefix         Unary prefix operators.
-'postfix        Unary postfix operators.
-'postfix-if-paren
+`prefix'        Unary prefix operators.
+`postfix'       Unary postfix operators.
+`postfix-if-paren'
                Unary postfix operators if and only if the chars have
                parenthesis syntax.
-'left-assoc     Binary left associative operators (i.e. a+b+c means (a+b)+c).
-'right-assoc    Binary right associative operators (i.e. a=b=c means a=(b=c)).
-'right-assoc-sequence
+`left-assoc'    Binary left associative operators (i.e. a+b+c means (a+b)+c).
+`right-assoc'   Binary right associative operators (i.e. a=b=c means a=(b=c)).
+`right-assoc-sequence'
                 Right associative operator that constitutes of a
                 sequence of tokens that separate expressions.  All the
                 tokens in the group are in this case taken as
@@ -1165,9 +1168,9 @@ operators."
 (c-lang-defconst c-all-op-syntax-tokens
   ;; List of all tokens in the punctuation and parenthesis syntax
   ;; classes.
-  t (delete-duplicates (append (c-lang-const c-other-op-syntax-tokens)
-                              (c-lang-const c-operator-list))
-                      :test 'string-equal))
+  t (c--delete-duplicates (append (c-lang-const c-other-op-syntax-tokens)
+                                 (c-lang-const c-operator-list))
+                         :test 'string-equal))
 
 (c-lang-defconst c-nonsymbol-token-char-list
   ;; List containing all chars not in the word, symbol or
@@ -1190,7 +1193,7 @@ operators."
   t (c-make-keywords-re nil
       (c-filter-ops (c-lang-const c-all-op-syntax-tokens)
                    t
-                   "\\`\\(\\s.\\|\\s\(\\|\\s\)\\)+\\'")))
+                   "\\`\\(\\s.\\)+\\'")))
 (c-lang-defvar c-nonsymbol-token-regexp
   (c-lang-const c-nonsymbol-token-regexp))
 
@@ -1204,9 +1207,9 @@ operators."
         "=\\([^=]\\|$\\)"
         "\\|"
         (c-make-keywords-re nil
-          (set-difference (c-lang-const c-assignment-operators)
-                          '("=")
-                          :test 'string-equal)))
+          (c--set-difference (c-lang-const c-assignment-operators)
+                             '("=")
+                             :test 'string-equal)))
       "\\<\\>"))
 (c-lang-defvar c-assignment-op-regexp
   (c-lang-const c-assignment-op-regexp))
@@ -1256,7 +1259,7 @@ operators."
   ;; multicharacter tokens that begin with ">" except for those beginning with
   ;; ">>".
   t (c-make-keywords-re nil
-      (set-difference
+      (c--set-difference
        (c-lang-const c->-op-cont-tokens)
        (c-filter-ops (c-lang-const c-all-op-syntax-tokens)
                     t
@@ -1430,6 +1433,14 @@ properly."
            "\\)\\s *"))
 (c-lang-setvar comment-start-skip (c-lang-const comment-start-skip))
 
+(c-lang-defconst comment-end-can-be-escaped
+  "When non-nil, escaped EOLs inside comments are valid.
+This works in Emacs >= 25.1."
+  t nil
+  (c c++ objc) t)
+(c-lang-setvar comment-end-can-be-escaped
+              (c-lang-const comment-end-can-be-escaped))
+
 (c-lang-defconst c-syntactic-ws-start
   ;; Regexp matching any sequence that can start syntactic whitespace.
   ;; The only uncertain case is '#' when there are cpp directives.
@@ -1694,7 +1705,7 @@ be a subset of `c-primitive-type-kwds'."
            "strong"))
 
 (c-lang-defconst c-typedef-kwds
-  "Prefix keyword\(s\) like \"typedef\" which make a type declaration out
+  "Prefix keyword(s) like \"typedef\" which make a type declaration out
 of a variable declaration."
   t        '("typedef")
   (awk idl java) nil)
@@ -1765,10 +1776,10 @@ not the type face."
 (c-lang-defconst c-type-start-kwds
   ;; All keywords that can start a type (i.e. are either a type prefix
   ;; or a complete type).
-  t (delete-duplicates (append (c-lang-const c-primitive-type-kwds)
-                              (c-lang-const c-type-prefix-kwds)
-                              (c-lang-const c-type-modifier-kwds))
-                      :test 'string-equal))
+  t (c--delete-duplicates (append (c-lang-const c-primitive-type-kwds)
+                                 (c-lang-const c-type-prefix-kwds)
+                                 (c-lang-const c-type-modifier-kwds))
+                         :test 'string-equal))
 
 (c-lang-defconst c-class-decl-kwds
   "Keywords introducing declarations where the following block (if any)
@@ -2030,16 +2041,16 @@ one of `c-type-list-kwds', `c-ref-list-kwds',
   ;; something is a type or just some sort of macro in front of the
   ;; declaration.  They might be ambiguous with types or type
   ;; prefixes.
-  t (delete-duplicates (append (c-lang-const c-class-decl-kwds)
-                              (c-lang-const c-brace-list-decl-kwds)
-                              (c-lang-const c-other-block-decl-kwds)
-                              (c-lang-const c-typedef-decl-kwds)
-                              (c-lang-const c-typeless-decl-kwds)
-                              (c-lang-const c-modifier-kwds)
-                              (c-lang-const c-other-decl-kwds)
-                              (c-lang-const c-decl-start-kwds)
-                              (c-lang-const c-decl-hangon-kwds))
-                      :test 'string-equal))
+  t (c--delete-duplicates (append (c-lang-const c-class-decl-kwds)
+                                 (c-lang-const c-brace-list-decl-kwds)
+                                 (c-lang-const c-other-block-decl-kwds)
+                                 (c-lang-const c-typedef-decl-kwds)
+                                 (c-lang-const c-typeless-decl-kwds)
+                                 (c-lang-const c-modifier-kwds)
+                                 (c-lang-const c-other-decl-kwds)
+                                 (c-lang-const c-decl-start-kwds)
+                                 (c-lang-const c-decl-hangon-kwds))
+                         :test 'string-equal))
 
 (c-lang-defconst c-prefix-spec-kwds-re
   ;; Adorned regexp of `c-prefix-spec-kwds'.
@@ -2052,10 +2063,10 @@ one of `c-type-list-kwds', `c-ref-list-kwds',
   ;; ambiguous with types or type prefixes.  These are the keywords (like
   ;; extern, namespace, but NOT template) that can modify a declaration.
   t (c-make-keywords-re t
-      (set-difference (c-lang-const c-prefix-spec-kwds)
-                     (append (c-lang-const c-type-start-kwds)
-                             (c-lang-const c-<>-arglist-kwds))
-                     :test 'string-equal)))
+      (c--set-difference (c-lang-const c-prefix-spec-kwds)
+                        (append (c-lang-const c-type-start-kwds)
+                                (c-lang-const c-<>-arglist-kwds))
+                        :test 'string-equal)))
 (c-lang-defvar c-specifier-key (c-lang-const c-specifier-key))
 
 (c-lang-defconst c-postfix-spec-kwds
@@ -2068,19 +2079,19 @@ one of `c-type-list-kwds', `c-ref-list-kwds',
   ;; Adorned regexp matching all keywords that can't appear at the
   ;; start of a declaration.
   t (c-make-keywords-re t
-      (set-difference (c-lang-const c-keywords)
-                     (append (c-lang-const c-type-start-kwds)
-                             (c-lang-const c-prefix-spec-kwds)
-                             (c-lang-const c-typeof-kwds))
-                     :test 'string-equal)))
+      (c--set-difference (c-lang-const c-keywords)
+                        (append (c-lang-const c-type-start-kwds)
+                                (c-lang-const c-prefix-spec-kwds)
+                                (c-lang-const c-typeof-kwds))
+                        :test 'string-equal)))
 (c-lang-defvar c-not-decl-init-keywords
   (c-lang-const c-not-decl-init-keywords))
 
 (c-lang-defconst c-not-primitive-type-keywords
   "List of all keywords apart from primitive types (like \"int\")."
-  t (set-difference (c-lang-const c-keywords)
-                   (c-lang-const c-primitive-type-kwds)
-                   :test 'string-equal)
+  t (c--set-difference (c-lang-const c-keywords)
+                      (c-lang-const c-primitive-type-kwds)
+                      :test 'string-equal)
   ;; The "more" for C++ is the QT keyword (as in "more slots:").
   ;; This variable is intended for use in c-beginning-of-statement-1.
   c++ (append (c-lang-const c-not-primitive-type-keywords) '("more")))
@@ -2101,7 +2112,7 @@ one of `c-type-list-kwds', `c-ref-list-kwds',
   "Keywords introducing declarations that can contain a block which
 might be followed by variable declarations, e.g. like \"foo\" in
 \"class Foo { ... } foo;\".  So if there is a block in a declaration
-like that, it ends with the following ';' and not right away.
+like that, it ends with the following `;' and not right away.
 
 The keywords on list are assumed to also be present on one of the
 `*-decl-kwds' lists."
@@ -2202,7 +2213,7 @@ regexp if `c-colon-type-list-kwds' isn't nil."
        ;; before the ":" that starts the inherit list after "class"
        ;; or "struct" in C++.  (Also used as default for other
        ;; languages.)
-       "[^\]\[{}();,/#=:]*:"))
+       "[^][{}();,/#=:]*:"))
 (c-lang-defvar c-colon-type-list-re (c-lang-const c-colon-type-list-re))
 
 (c-lang-defconst c-paren-nontype-kwds
@@ -2224,9 +2235,9 @@ type identifiers separated by arbitrary tokens."
   pike '("array" "function" "int" "mapping" "multiset" "object" "program"))
 
 (c-lang-defconst c-paren-any-kwds
-  t (delete-duplicates (append (c-lang-const c-paren-nontype-kwds)
-                              (c-lang-const c-paren-type-kwds))
-                      :test 'string-equal))
+  t (c--delete-duplicates (append (c-lang-const c-paren-nontype-kwds)
+                                 (c-lang-const c-paren-type-kwds))
+                         :test 'string-equal))
 
 (c-lang-defconst c-<>-type-kwds
   "Keywords that may be followed by an angle bracket expression
@@ -2250,9 +2261,9 @@ assumed to be set if this isn't nil."
 
 (c-lang-defconst c-<>-sexp-kwds
   ;; All keywords that can be followed by an angle bracket sexp.
-  t (delete-duplicates (append (c-lang-const c-<>-type-kwds)
-                              (c-lang-const c-<>-arglist-kwds))
-                      :test 'string-equal))
+  t (c--delete-duplicates (append (c-lang-const c-<>-type-kwds)
+                                 (c-lang-const c-<>-arglist-kwds))
+                         :test 'string-equal))
 
 (c-lang-defconst c-opt-<>-sexp-key
   ;; Adorned regexp matching keywords that can be followed by an angle
@@ -2310,9 +2321,9 @@ Keywords here should also be in `c-block-stmt-1-kwds'."
 
 (c-lang-defconst c-block-stmt-kwds
   ;; Union of `c-block-stmt-1-kwds' and `c-block-stmt-2-kwds'.
-  t (delete-duplicates (append (c-lang-const c-block-stmt-1-kwds)
-                              (c-lang-const c-block-stmt-2-kwds))
-                      :test 'string-equal))
+  t (c--delete-duplicates (append (c-lang-const c-block-stmt-1-kwds)
+                                 (c-lang-const c-block-stmt-2-kwds))
+                         :test 'string-equal))
 
 (c-lang-defconst c-opt-block-stmt-key
   ;; Regexp matching the start of any statement that has a
@@ -2344,7 +2355,7 @@ Keywords here should also be in `c-block-stmt-1-kwds'."
 
 (c-lang-defconst c-paren-stmt-kwds
   "Statement keywords followed by a parenthesis expression that
-nevertheless contains a list separated with ';' and not ','."
+nevertheless contains a list separated with `;' and not `,'."
   t    '("for")
   idl  nil)
 
@@ -2366,7 +2377,7 @@ nevertheless contains a list separated with ';' and not ','."
 (c-lang-defvar c-opt-asm-stmt-key (c-lang-const c-opt-asm-stmt-key))
 
 (c-lang-defconst c-case-kwds
-  "The keyword\(s) which introduce a \"case\" like construct.
+  "The keyword(s) which introduce a \"case\" like construct.
 This construct is \"<keyword> <expression> :\"."
   t '("case")
   awk nil)
@@ -2400,7 +2411,7 @@ This construct is \"<keyword> <expression> :\"."
            "false" "true")             ; Defined in C99.
   c++     (append
            '("nullptr")
-           (c-lang-const c-constant-kwds))
+           (c-lang-const c-constant-kwds c))
   objc    '("nil" "Nil" "YES" "NO" "NS_DURING" "NS_HANDLER" "NS_ENDHANDLER")
   idl     '("TRUE" "FALSE")
   java    '("true" "false" "null") ; technically "literals", not keywords
@@ -2417,7 +2428,7 @@ This construct is \"<keyword> <expression> :\"."
 (c-lang-defconst c-expr-kwds
   ;; Keywords that can occur anywhere in expressions.  Built from
   ;; `c-primary-expr-kwds' and all keyword operators in `c-operators'.
-  t (delete-duplicates
+  t (c--delete-duplicates
      (append (c-lang-const c-primary-expr-kwds)
             (c-filter-ops (c-lang-const c-operator-list)
                           t
@@ -2468,12 +2479,12 @@ Note that Java specific rules are currently applied to tell this from
   t (let* ((decl-kwds (append (c-lang-const c-class-decl-kwds)
                              (c-lang-const c-other-block-decl-kwds)
                              (c-lang-const c-inexpr-class-kwds)))
-          (unambiguous (set-difference decl-kwds
-                                       (c-lang-const c-type-start-kwds)
-                                       :test 'string-equal))
-          (ambiguous (intersection decl-kwds
-                                   (c-lang-const c-type-start-kwds)
-                                   :test 'string-equal)))
+          (unambiguous (c--set-difference decl-kwds
+                                          (c-lang-const c-type-start-kwds)
+                                          :test 'string-equal))
+          (ambiguous (c--intersection decl-kwds
+                                      (c-lang-const c-type-start-kwds)
+                                      :test 'string-equal)))
       (if ambiguous
          (concat (c-make-keywords-re t unambiguous)
                  "\\|"
@@ -2521,7 +2532,7 @@ Note that Java specific rules are currently applied to tell this from
 
 (c-lang-defconst c-keywords
   ;; All keywords as a list.
-  t (delete-duplicates
+  t (c--delete-duplicates
      (c-lang-defconst-eval-immediately
       `(append ,@(mapcar (lambda (kwds-lang-const)
                           `(c-lang-const ,kwds-lang-const))
@@ -2585,6 +2596,7 @@ Note that Java specific rules are currently applied to tell this from
       (setplist (intern kwd obarray)
                ;; Emacs has an odd bug that causes `mapcan' to fail
                ;; with unintelligible errors.  (XEmacs works.)
+               ;; (2015-06-24): This bug has not yet been fixed.
                ;;(mapcan (lambda (lang-const)
                ;;            (list lang-const t))
                ;;          lang-const-list)
@@ -2597,10 +2609,10 @@ Note that Java specific rules are currently applied to tell this from
   ;; Adorned regexp matching all keywords that should be fontified
   ;; with the keywords face.  I.e. that aren't types or constants.
   t (c-make-keywords-re t
-      (set-difference (c-lang-const c-keywords)
-                     (append (c-lang-const c-primitive-type-kwds)
-                             (c-lang-const c-constant-kwds))
-                     :test 'string-equal)))
+      (c--set-difference (c-lang-const c-keywords)
+                        (append (c-lang-const c-primitive-type-kwds)
+                                (c-lang-const c-constant-kwds))
+                        :test 'string-equal)))
 (c-lang-defvar c-regular-keywords-regexp
   (c-lang-const c-regular-keywords-regexp))
 
@@ -2635,12 +2647,12 @@ Note that Java specific rules are currently applied to tell this from
                            right-assoc-sequence)
                          t))
 
-          (unambiguous-prefix-ops (set-difference nonkeyword-prefix-ops
-                                                  in-or-postfix-ops
-                                                  :test 'string-equal))
-          (ambiguous-prefix-ops (intersection nonkeyword-prefix-ops
-                                              in-or-postfix-ops
-                                              :test 'string-equal)))
+          (unambiguous-prefix-ops (c--set-difference nonkeyword-prefix-ops
+                                                     in-or-postfix-ops
+                                                     :test 'string-equal))
+          (ambiguous-prefix-ops (c--intersection nonkeyword-prefix-ops
+                                                 in-or-postfix-ops
+                                                 :test 'string-equal)))
 
       (concat
        "\\("
@@ -2648,14 +2660,14 @@ Note that Java specific rules are currently applied to tell this from
        ;; first submatch from them together with `c-primary-expr-kwds'.
        (c-make-keywords-re t
         (append (c-lang-const c-primary-expr-kwds)
-                (set-difference prefix-ops nonkeyword-prefix-ops
-                                :test 'string-equal)))
+                (c--set-difference prefix-ops nonkeyword-prefix-ops
+                                   :test 'string-equal)))
 
        "\\|"
        ;; Match all ambiguous operators.
        (c-make-keywords-re nil
-        (intersection nonkeyword-prefix-ops in-or-postfix-ops
-                      :test 'string-equal))
+        (c--intersection nonkeyword-prefix-ops in-or-postfix-ops
+                         :test 'string-equal))
        "\\)"
 
        "\\|"
@@ -2670,8 +2682,8 @@ Note that Java specific rules are currently applied to tell this from
        "\\|"
        ;; The unambiguous operators from `prefix-ops'.
        (c-make-keywords-re nil
-        (set-difference nonkeyword-prefix-ops in-or-postfix-ops
-                        :test 'string-equal))
+        (c--set-difference nonkeyword-prefix-ops in-or-postfix-ops
+                           :test 'string-equal))
 
        "\\|"
        ;; Match string and character literals.
@@ -2728,25 +2740,25 @@ more info."
   ;; more quickly.  We match ")" in C for K&R region declarations, and
   ;; in all languages except Java for when a cpp macro definition
   ;; begins with a declaration.
-  t "\\([\{\}\(\);,]+\\)"
-  java "\\([\{\}\(;,<]+\\)"
+  t "\\([{}();,]+\\)"
+  java "\\([{}(;,<]+\\)"
   ;; Match "<" in C++ to get the first argument in a template arglist.
   ;; In that case there's an additional check in `c-find-decl-spots'
   ;; that it got open paren syntax.  Match ":" to aid in picking up
   ;; "public:", etc.  This involves additional checks in
   ;; `c-find-decl-prefix-search' to prevent a match of identifiers
   ;; or labels.
-  c++ "\\([\{\}\(\);:,<]+\\)"
+  c++ "\\([{}();:,<]+\\)"
   ;; Additionally match the protection directives in Objective-C.
   ;; Note that this doesn't cope with the longer directives, which we
   ;; would have to match from start to end since they don't end with
   ;; any easily recognized characters.
-  objc (concat "\\([\{\}\(\);,]+\\|"
+  objc (concat "\\([{}();,]+\\|"
               (c-make-keywords-re nil (c-lang-const c-protection-kwds))
               "\\)")
   ;; Pike is like C but we also match "[" for multiple value
   ;; assignments and type casts.
-  pike "\\([\{\}\(\)\[;,]+\\)")
+  pike "\\([{}()[;,]+\\)")
 (c-lang-defvar c-decl-prefix-re (c-lang-const c-decl-prefix-re)
   'dont-doc)
 
@@ -2791,7 +2803,7 @@ constructs."
   ;; languages without casts.
   t (c-filter-ops (c-lang-const c-operators)
                  '(prefix)
-                 "\\`\\s\(\\'"
+                 "\\`\\s(\\'"
                  (lambda (op) (elt op 0))))
 (c-lang-defvar c-cast-parens (c-lang-const c-cast-parens))
 
@@ -2805,7 +2817,7 @@ the \"class Foo: public Bar\" part of:
 If parens can occur, the chars inside those aren't filtered with this
 list.
 
-'<' and '>' should be disallowed even if angle bracket arglists can
+`<' and `>' should be disallowed even if angle bracket arglists can
 occur.  That since the search function needs to stop at them anyway to
 ensure they are given paren syntax.
 
@@ -2816,7 +2828,7 @@ possible for good performance."
 
   ;; Default to all chars that only occurs in nonsymbol tokens outside
   ;; identifiers.
-  t (set-difference
+  t (c--set-difference
      (c-lang-const c-nonsymbol-token-char-list)
      (c-filter-ops (append (c-lang-const c-identifier-ops)
                           (list (cons nil
@@ -2833,26 +2845,26 @@ possible for good performance."
 
   ;; Allow cpp operations (where applicable).
   t (if (c-lang-const c-opt-cpp-prefix)
-       (set-difference (c-lang-const c-block-prefix-disallowed-chars)
-                       '(?#))
+       (c--set-difference (c-lang-const c-block-prefix-disallowed-chars)
+                          '(?#))
       (c-lang-const c-block-prefix-disallowed-chars))
 
   ;; Allow ':' for inherit list starters.
-  (c++ objc idl) (set-difference (c-lang-const c-block-prefix-disallowed-chars)
-                                '(?:))
+  (c++ objc idl) (c--set-difference (c-lang-const c-block-prefix-disallowed-chars)
+                                   '(?:))
 
   ;; Allow ',' for multiple inherits.
-  (c++ java) (set-difference (c-lang-const c-block-prefix-disallowed-chars)
-                            '(?,))
+  (c++ java) (c--set-difference (c-lang-const c-block-prefix-disallowed-chars)
+                               '(?,))
 
   ;; Allow parentheses for anonymous inner classes in Java and class
   ;; initializer lists in Pike.
-  (java pike) (set-difference (c-lang-const c-block-prefix-disallowed-chars)
-                             '(?\( ?\)))
+  (java pike) (c--set-difference (c-lang-const c-block-prefix-disallowed-chars)
+                                '(?\( ?\)))
 
   ;; Allow '"' for extern clauses (e.g. extern "C" {...}).
-  (c c++ objc) (set-difference (c-lang-const c-block-prefix-disallowed-chars)
-                              '(?\" ?')))
+  (c c++ objc) (c--set-difference (c-lang-const c-block-prefix-disallowed-chars)
+                                 '(?\" ?')))
 
 (c-lang-defconst c-block-prefix-charset
   ;; `c-block-prefix-disallowed-chars' as an inverted charset suitable
@@ -2874,13 +2886,13 @@ Identifier syntax is in effect when this is matched \(see
   ;; Check that there's no "=" afterwards to avoid matching tokens
   ;; like "*=".
   (c objc) (concat "\\("
-                  "[*\(]"
+                  "[*(]"
                   "\\|"
                   (c-lang-const c-type-decl-prefix-key)
                   "\\)"
                   "\\([^=]\\|$\\)")
   c++  (concat "\\("
-              "[*\(&]"
+              "[*(&]"
               "\\|"
               (c-lang-const c-type-decl-prefix-key)
               "\\|"
@@ -2908,13 +2920,13 @@ is in effect when this is matched (see `c-identifier-syntax-table')."
   ;; Default to a regexp that matches `c-type-modifier-kwds' and a
   ;; function argument list parenthesis.
   t    (if (c-lang-const c-type-modifier-kwds)
-          (concat "\\(\(\\|"
+          (concat "\\((\\|"
                   (regexp-opt (c-lang-const c-type-modifier-kwds) t) "\\>"
                   "\\)")
-        "\\(\(\\)")
+        "\\((\\)")
   (c c++ objc) (concat
                "\\("
-               "[\)\[\(]"
+               "[)[(]"
                (if (c-lang-const c-type-modifier-kwds)
                    (concat
                     "\\|"
@@ -2925,8 +2937,8 @@ is in effect when this is matched (see `c-identifier-syntax-table')."
                     "\\>")
                  "")
                "\\)")
-  java "\\([\[\(\)]\\)"
-  idl "\\([\[\(]\\)")
+  java "\\([[()]\\)"
+  idl "\\([[(]\\)")
 (c-lang-defvar c-type-decl-suffix-key (c-lang-const c-type-decl-suffix-key)
   'dont-doc)
 
@@ -3110,7 +3122,7 @@ i.e. compound statements surrounded by parentheses inside expressions."
   t (if (c-lang-const c-opt-<>-arglist-start)
        (concat "\\("
                (c-lang-const c-opt-<>-arglist-start)
-               "\\)\\|\\s\)")))
+               "\\)\\|\\s)")))
 (c-lang-defvar c-opt-<>-arglist-start-in-paren
   (c-lang-const c-opt-<>-arglist-start-in-paren))
 
@@ -3157,17 +3169,17 @@ i.e. before \":\".  Only used if `c-recognize-colon-labels' is set."
   t (concat
      ;; All keywords except `c-label-kwds' and `c-protection-kwds'.
      (c-make-keywords-re t
-       (set-difference (c-lang-const c-keywords)
-                      (append (c-lang-const c-label-kwds)
-                              (c-lang-const c-protection-kwds))
-                      :test 'string-equal)))
+       (c--set-difference (c-lang-const c-keywords)
+                         (append (c-lang-const c-label-kwds)
+                                 (c-lang-const c-protection-kwds))
+                         :test 'string-equal)))
   ;; Don't allow string literals, except in AWK.  Character constants are OK.
   (c objc java pike idl) (concat "\"\\|"
                                 (c-lang-const c-nonlabel-token-key))
   ;; Also check for open parens in C++, to catch member init lists in
   ;; constructors.  We normally allow it so that macros with arguments
   ;; work in labels.
-  c++ (concat "\\s\(\\|\"\\|" (c-lang-const c-nonlabel-token-key)))
+  c++ (concat "\\s(\\|\"\\|" (c-lang-const c-nonlabel-token-key)))
 (c-lang-defvar c-nonlabel-token-key (c-lang-const c-nonlabel-token-key))
 
 (c-lang-defconst c-nonlabel-token-2-key
@@ -3215,7 +3227,7 @@ way."
        "\\([+-]\\)"
        (c-lang-const c-simple-ws) "*"
        (concat "\\("                   ; Return type.
-               "([^\)]*)"
+               "([^)]*)"
                (c-lang-const c-simple-ws) "*"
                "\\)?")
        "\\(" (c-lang-const c-symbol-key) "\\)"))
@@ -3280,16 +3292,16 @@ accomplish that conveniently."
                             ;; `c-lang-const' will expand to the evaluated
                             ;; constant immediately in `c--macroexpand-all'
                             ;; below.
-                             (mapcan
+                             (c--mapcan
                               (lambda (init)
                                 `(current-var ',(car init)
-                                  ,(car init) ,(c--macroexpand-all
-                                                (elt init 1))))
+                                              ,(car init) ,(c--macroexpand-all
+                                                            (elt init 1))))
                               ;; Note: The following `append' copies the
                               ;; first argument.  That list is small, so
                               ;; this doesn't matter too much.
-                             (append (cdr c-emacs-variable-inits)
-                                     (cdr c-lang-variable-inits)))))
+                              (append (cdr c-emacs-variable-inits)
+                                      (cdr c-lang-variable-inits)))))
 
                 ;; This diagnostic message isn't useful for end
                 ;; users, so it's disabled.
@@ -3303,10 +3315,9 @@ accomplish that conveniently."
                 (setq source-eval t)
                 (let ((init ',(append (cdr c-emacs-variable-inits)
                                       (cdr c-lang-variable-inits))))
-                  (while init
-                    (setq current-var (caar init))
-                    (set (caar init) (eval (cadar init)))
-                    (setq init (cdr init)))))
+                  (dolist (var-init init)
+                    (setq current-var (car var-init))
+                    (set (car var-init) (eval (cadr var-init))))))
 
             (error
              (if current-var
@@ -3332,10 +3343,9 @@ accomplish that conveniently."
         (c-make-emacs-variables-local)
         (condition-case err
 
-            (while init
-              (setq current-var (caar init))
-              (set (caar init) (eval (cadar init)))
-              (setq init (cdr init)))
+            (dolist (var-init init)
+              (setq current-var (car var-init))
+              (set (car var-init) (eval (cadr var-init))))
 
           (error
            (if current-var
@@ -3355,8 +3365,8 @@ evaluated and should not be quoted."
 \f
 (cc-provide 'cc-langs)
 
-;;; Local Variables:
-;;; indent-tabs-mode: t
-;;; tab-width: 8
-;;; End:
+;; Local Variables:
+;; indent-tabs-mode: t
+;; tab-width: 8
+;; End:
 ;;; cc-langs.el ends here