Merge from emacs-24; up to 2014-05-29T17:16:00Z!dmantipov@yandex.ru
[bpt/emacs.git] / lisp / progmodes / cc-vars.el
index d56c112..a8d627f 100644 (file)
@@ -1,6 +1,6 @@
 ;;; cc-vars.el --- user customization variables for CC Mode
 
-;; Copyright (C) 1985, 1987, 1992-201 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1992-2014 Free Software Foundation, Inc.
 
 ;; Authors:    2002- Alan Mackenzie
 ;;             1998- Martin Stjernholm
 
 (cc-require 'cc-defs)
 
-;; Silence the compiler.
-(cc-bytecomp-defun get-char-table)     ; XEmacs
-
 (cc-eval-when-compile
   (require 'custom)
   (require 'widget))
 
 ;;; Helpers
 
-;; 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.
+
+;; Emacs has 'other since at least version 21.1.
+;; FIXME this is probably broken, since the widget is defined
+;; in wid-edit, which this file does not load.  So we will always
+;; define the widget, even when we don't need to.
+(when (featurep 'xemacs)
+  (or (get 'other 'widget-type)
+      (define-widget 'other 'sexp
+       "Matches everything, but doesn't let the user edit the value.
 Useful as last item in a `choice' widget."
-      :tag "Other"
-      :format "%t%n"
-      :value 'other))
+       :tag "Other"
+       :format "%t%n"
+       :value 'other)))
 
 ;; The next defun will supersede c-const-symbol.
 (eval-and-compile
@@ -1622,11 +1624,30 @@ names)."))
 )
 (make-variable-buffer-local 'c-macro-with-semi-re)
 
+(defvar c-macro-names-with-semicolon
+  '("Q_OBJECT" "Q_PROPERTY" "Q_DECLARE" "Q_ENUMS")
+  "List of #defined symbols whose expansion ends with a semicolon.
+Alternatively it can be a string, a regular expression which
+matches all such symbols.
+
+The \"symbols\" must be syntactically valid identifiers in the
+target language \(C, C++, Objective C), or \(as the case may be)
+the regular expression must match only valid identifiers.
+
+If you change this variable's value, call the function
+`c-make-macros-with-semi-re' to set the necessary internal
+variables.
+
+Note that currently \(2008-11-04) this variable is a prototype,
+and is likely to disappear or change its form soon.")
+(make-variable-buffer-local 'c-macro-names-with-semicolon)
+
 (defun c-make-macro-with-semi-re ()
   ;; Convert `c-macro-names-with-semicolon' into the regexp
   ;; `c-macro-with-semi-re' (or just copy it if it's already a re).
   (setq c-macro-with-semi-re
        (and
+        (boundp 'c-opt-cpp-macro-define)
         c-opt-cpp-macro-define
         (cond
          ((stringp c-macro-names-with-semicolon)
@@ -1643,24 +1664,6 @@ names)."))
 c-macro-names-with-semicolon: %s"
                    c-macro-names-with-semicolon))))))
 
-(defvar c-macro-names-with-semicolon
-  '("Q_OBJECT" "Q_PROPERTY" "Q_DECLARE" "Q_ENUMS")
-  "List of #defined symbols whose expansion ends with a semicolon.
-Alternatively it can be a string, a regular expression which
-matches all such symbols.
-
-The \"symbols\" must be syntactically valid identifiers in the
-target language \(C, C++, Objective C), or \(as the case may be)
-the regular expression must match only valid identifiers.
-
-If you change this variable's value, call the function
-`c-make-macros-with-semi-re' to set the necessary internal
-variables.
-
-Note that currently \(2008-11-04) this variable is a prototype,
-and is likely to disappear or change its form soon.")
-(make-variable-buffer-local 'c-macro-names-with-semicolon)
-
 (defvar c-file-style nil
   "Variable interface for setting style via File Local Variables.
 In a file's Local Variable section, you can set this variable to a