diff options
author | Alan Mackenzie <acm@muc.de> | 2011-10-28 14:35:39 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2011-10-28 14:35:39 +0000 |
commit | 93b5b3bdc8b734132c530acd6ffae1196c0865bc (patch) | |
tree | da8ed72a56bfbf65d6f3cd9bdc3fa5d123dc4873 /lisp/progmodes/cc-vars.el | |
parent | 020716e178cdae443a3630c4307023cb3fc4c350 (diff) | |
parent | bc97a826f8ea89a269f6043be3148930f023e2b2 (diff) | |
download | emacs-93b5b3bdc8b734132c530acd6ffae1196c0865bc.tar.gz |
Boring merge from savannah.
Diffstat (limited to 'lisp/progmodes/cc-vars.el')
-rw-r--r-- | lisp/progmodes/cc-vars.el | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index 769bf63f63c..24361e3667a 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el @@ -1622,6 +1622,54 @@ names).")) ;; Non-customizable variables, still part of the interface to CC Mode +(defvar c-macro-with-semi-re nil + ;; Regular expression which matches a (#define'd) symbol whose expansion + ;; ends with a semicolon. + ;; + ;; This variable should be set by `c-make-macros-with-semi-re' rather than + ;; directly. +) +(make-variable-buffer-local 'c-macro-with-semi-re) + +(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 + c-opt-cpp-macro-define + (cond + ((stringp c-macro-names-with-semicolon) + (copy-sequence c-macro-names-with-semicolon)) + ((consp c-macro-names-with-semicolon) + (concat + "\\<" + (regexp-opt c-macro-names-with-semicolon) + "\\>")) ; N.B. the PAREN param of regexp-opt isn't supported by + ; all XEmacsen. + ((null c-macro-names-with-semicolon) + nil) + (t (error "c-make-macro-with-semi-re: invalid \ +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 |