Mercurial > emacs
annotate lisp/progmodes/cc-vars.el @ 80613:9110741da209
Merge from gnus--rel--5.10
Revision: emacs@sv.gnu.org/emacs--rel--22--patch-281
author | Miles Bader <miles@gnu.org> |
---|---|
date | Thu, 17 Jul 2008 23:21:03 +0000 |
parents | 996fec9cb719 |
children |
rev | line source |
---|---|
18720 | 1 ;;; cc-vars.el --- user customization variables for CC Mode |
2 | |
74372 | 3 ;; Copyright (C) 1985, 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, |
79717 | 4 ;; 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 |
75347 | 5 ;; Free Software Foundation, Inc. |
18720 | 6 |
75307 | 7 ;; Authors: 2002- Alan Mackenzie |
8 ;; 1998- Martin Stjernholm | |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
9 ;; 1992-1999 Barry A. Warsaw |
18720 | 10 ;; 1987 Dave Detlefs and Stewart Clamen |
11 ;; 1985 Richard M. Stallman | |
24282 | 12 ;; Maintainer: bug-cc-mode@gnu.org |
18720 | 13 ;; Created: 22-Apr-1997 (split from cc-mode.el) |
20144
56d81cc7b4f5
(c-progress-interval): Document new semantics
Karl Heuer <kwzh@gnu.org>
parents:
20140
diff
changeset
|
14 ;; Version: See cc-mode.el |
18720 | 15 ;; Keywords: c languages oop |
16 | |
17 ;; This file is part of GNU Emacs. | |
18 | |
19 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
20 ;; it under the terms of the GNU General Public License as published by | |
78234
c1ec1c8a8d2e
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
76948
diff
changeset
|
21 ;; the Free Software Foundation; either version 3, or (at your option) |
18720 | 22 ;; any later version. |
23 | |
24 ;; GNU Emacs is distributed in the hope that it will be useful, | |
25 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
26 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
27 ;; GNU General Public License for more details. | |
28 | |
29 ;; You should have received a copy of the GNU General Public License | |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
30 ;; along with this program; see the file COPYING. If not, write to |
64085 | 31 ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
32 ;; Boston, MA 02110-1301, USA. | |
18720 | 33 |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36920
diff
changeset
|
34 ;;; Commentary: |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36920
diff
changeset
|
35 |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36920
diff
changeset
|
36 ;;; Code: |
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36920
diff
changeset
|
37 |
24282 | 38 (eval-when-compile |
26817 | 39 (let ((load-path |
36920 | 40 (if (and (boundp 'byte-compile-dest-file) |
41 (stringp byte-compile-dest-file)) | |
42 (cons (file-name-directory byte-compile-dest-file) load-path) | |
26817 | 43 load-path))) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
44 (load "cc-bytecomp" nil t))) |
36920 | 45 |
46 (cc-require 'cc-defs) | |
47 | |
48 ;; Silence the compiler. | |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
49 (cc-bytecomp-defun get-char-table) ; XEmacs |
24282 | 50 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
51 (cc-eval-when-compile |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
52 (require 'custom) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
53 (require 'widget)) |
18720 | 54 |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
55 (cc-eval-when-compile |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
56 ;; Need the function form of `backquote', which isn't standardized |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
57 ;; between Emacsen. It's called `bq-process' in XEmacs, and |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
58 ;; `backquote-process' in Emacs. `backquote-process' returns a |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
59 ;; slightly more convoluted form, so let `bq-process' be the norm. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
60 (if (fboundp 'backquote-process) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
61 (cc-bytecomp-defmacro bq-process (form) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
62 `(cdr (backquote-process ,form))))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
63 |
18720 | 64 |
26817 | 65 ;;; Helpers |
18720 | 66 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
67 ;; This widget exists in newer versions of the Custom library |
24282 | 68 (or (get 'other 'widget-type) |
69 (define-widget 'other 'sexp | |
70 "Matches everything, but doesn't let the user edit the value. | |
71 Useful as last item in a `choice' widget." | |
72 :tag "Other" | |
73 :format "%t%n" | |
74 :value 'other)) | |
75 | |
79841
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
76 ;; The next defun will supersede c-const-symbol. |
79860
9f6170e094c3
(c-constant-symbol): Put this defun inside an eval-and-compile, so as to
Alan Mackenzie <acm@muc.de>
parents:
79841
diff
changeset
|
77 (eval-and-compile |
9f6170e094c3
(c-constant-symbol): Put this defun inside an eval-and-compile, so as to
Alan Mackenzie <acm@muc.de>
parents:
79841
diff
changeset
|
78 (defun c-constant-symbol (sym len) |
9f6170e094c3
(c-constant-symbol): Put this defun inside an eval-and-compile, so as to
Alan Mackenzie <acm@muc.de>
parents:
79841
diff
changeset
|
79 "Create an uneditable symbol for customization buffers. |
79841
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
80 SYM is the name of the symbol, LEN the length of the field (in |
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
81 characters) the symbol will be displayed in. LEN must be big |
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
82 enough. |
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
83 |
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
84 This returns a (const ....) structure, suitable for embedding |
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
85 within a customization type." |
79860
9f6170e094c3
(c-constant-symbol): Put this defun inside an eval-and-compile, so as to
Alan Mackenzie <acm@muc.de>
parents:
79841
diff
changeset
|
86 (or (symbolp sym) (error "c-constant-symbol: %s is not a symbol" sym)) |
9f6170e094c3
(c-constant-symbol): Put this defun inside an eval-and-compile, so as to
Alan Mackenzie <acm@muc.de>
parents:
79841
diff
changeset
|
87 (let* ((name (symbol-name sym)) |
9f6170e094c3
(c-constant-symbol): Put this defun inside an eval-and-compile, so as to
Alan Mackenzie <acm@muc.de>
parents:
79841
diff
changeset
|
88 (l (length name)) |
9f6170e094c3
(c-constant-symbol): Put this defun inside an eval-and-compile, so as to
Alan Mackenzie <acm@muc.de>
parents:
79841
diff
changeset
|
89 (disp (concat name ":" (make-string (- len l 1) ?\ )))) |
9f6170e094c3
(c-constant-symbol): Put this defun inside an eval-and-compile, so as to
Alan Mackenzie <acm@muc.de>
parents:
79841
diff
changeset
|
90 `(const |
9f6170e094c3
(c-constant-symbol): Put this defun inside an eval-and-compile, so as to
Alan Mackenzie <acm@muc.de>
parents:
79841
diff
changeset
|
91 :size ,len |
9f6170e094c3
(c-constant-symbol): Put this defun inside an eval-and-compile, so as to
Alan Mackenzie <acm@muc.de>
parents:
79841
diff
changeset
|
92 :format ,disp |
9f6170e094c3
(c-constant-symbol): Put this defun inside an eval-and-compile, so as to
Alan Mackenzie <acm@muc.de>
parents:
79841
diff
changeset
|
93 :value ,sym)))) |
79841
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
94 |
26817 | 95 (define-widget 'c-const-symbol 'item |
79841
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
96 "An uneditable lisp symbol. This is obsolete - |
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
97 use c-constant-symbol instead." |
26817 | 98 :value nil |
99 :tag "Symbol" | |
100 :format "%t: %v\n%d" | |
101 :match (lambda (widget value) (symbolp value)) | |
102 :value-to-internal | |
103 (lambda (widget value) | |
104 (let ((s (if (symbolp value) | |
105 (symbol-name value) | |
106 value)) | |
107 (l (widget-get widget :size))) | |
108 (if l | |
109 (setq s (concat s (make-string (- l (length s)) ?\ )))) | |
110 s)) | |
111 :value-to-external | |
112 (lambda (widget value) | |
113 (if (stringp value) | |
114 (intern (progn | |
115 (string-match "\\`[^ ]*" value) | |
116 (match-string 0 value))) | |
117 value))) | |
118 | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
119 (define-widget 'c-integer-or-nil 'sexp |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
120 "An integer or the value nil." |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
121 :value nil |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
122 :tag "Optional integer" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
123 :match (lambda (widget value) (or (integerp value) (null value)))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
124 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
125 (define-widget 'c-symbol-list 'sexp |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
126 "A single symbol or a list of symbols." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
127 :tag "Symbols separated by spaces" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
128 :validate 'widget-field-validate |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
129 :match |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
130 (lambda (widget value) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
131 (or (symbolp value) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
132 (catch 'ok |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
133 (while (listp value) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
134 (unless (symbolp (car value)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
135 (throw 'ok nil)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
136 (setq value (cdr value))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
137 (null value)))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
138 :value-to-internal |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
139 (lambda (widget value) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
140 (cond ((null value) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
141 "") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
142 ((symbolp value) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
143 (symbol-name value)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
144 ((consp value) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
145 (mapconcat (lambda (symbol) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
146 (symbol-name symbol)) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
147 value |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
148 " ")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
149 (t |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
150 value))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
151 :value-to-external |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
152 (lambda (widget value) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
153 (if (stringp value) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
154 (let (list end) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
155 (while (string-match "\\S +" value end) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
156 (setq list (cons (intern (match-string 0 value)) list) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
157 end (match-end 0))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
158 (if (and list (not (cdr list))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
159 (car list) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
160 (nreverse list))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
161 value))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
162 |
26817 | 163 (defvar c-style-variables |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
164 '(c-basic-offset c-comment-only-line-offset c-indent-comment-alist |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
165 c-indent-comments-syntactically-p c-block-comment-prefix |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
166 c-comment-prefix-regexp c-doc-comment-style c-cleanup-list |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
167 c-hanging-braces-alist c-hanging-colons-alist |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
168 c-hanging-semi&comma-criteria c-backslash-column c-backslash-max-column |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
169 c-special-indent-hook c-label-minimum-indentation c-offsets-alist) |
26817 | 170 "List of the style variables.") |
171 | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
172 (defvar c-fallback-style nil) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
173 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
174 (defsubst c-set-stylevar-fallback (name val) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
175 (put name 'c-stylevar-fallback val) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
176 (setq c-fallback-style (cons (cons name val) c-fallback-style))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
177 |
26817 | 178 (defmacro defcustom-c-stylevar (name val doc &rest args) |
79582
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
179 "Defines a style variable." |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
180 `(let ((-value- ,val)) |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
181 (c-set-stylevar-fallback ',name -value-) |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
182 (custom-declare-variable |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
183 ',name ''set-from-style |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
184 ,(concat doc " |
26817 | 185 |
186 This is a style variable. Apart from the valid values described | |
79582
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
187 above, it can be set to the symbol `set-from-style'. In that case, it |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
188 takes its value from the style system (see `c-default-style' and |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
189 `c-style-alist') when a CC Mode buffer is initialized. Otherwise, |
26817 | 190 the value set here overrides the style system (there is a variable |
79582
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
191 `c-old-style-variable-behavior' that changes this, though).") |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
192 ,@(plist-put |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
193 args ':type |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
194 `(` (radio |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
195 (const :tag "Use style settings" |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
196 set-from-style) |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
197 ,(, (let ((type (eval (plist-get args ':type)))) |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
198 (unless (consp type) |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
199 (setq type (list type))) |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
200 (unless (c-safe (plist-get (cdr type) ':value)) |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
201 (setcdr type (append '(:value (, -value-)) |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
202 (cdr type)))) |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
203 (unless (c-safe (plist-get (cdr type) ':tag)) |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
204 (setcdr type (append '(:tag "Override style settings") |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
205 (cdr type)))) |
cdddf0f8a2de
(defcustom-c-stylevar): Revert to pre-2007-12-12 version.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
79580
diff
changeset
|
206 (bq-process type))))))))) |
26817 | 207 |
208 (defun c-valid-offset (offset) | |
78487
419c5c316b51
Replace `iff' in doc-strings and comments.
Glenn Morris <rgm@gnu.org>
parents:
78234
diff
changeset
|
209 "Return non-nil if OFFSET is a valid offset for a syntactic symbol. |
26817 | 210 See `c-offsets-alist'." |
211 (or (eq offset '+) | |
212 (eq offset '-) | |
213 (eq offset '++) | |
214 (eq offset '--) | |
215 (eq offset '*) | |
216 (eq offset '/) | |
217 (integerp offset) | |
218 (functionp offset) | |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
219 (and (symbolp offset) (boundp offset)) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
220 (and (vectorp offset) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
221 (= (length offset) 1) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
222 (integerp (elt offset 0))) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
223 (and (consp offset) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
224 (not (eq (car offset) 'quote)) ; Detect misquoted lists. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
225 (progn |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
226 (when (memq (car offset) '(first min max add)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
227 (setq offset (cdr offset))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
228 (while (and (consp offset) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
229 (c-valid-offset (car offset))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
230 (setq offset (cdr offset))) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
231 (null offset))))) |
26817 | 232 |
233 | |
234 | |
235 ;;; User variables | |
236 | |
237 (defcustom c-strict-syntax-p nil | |
238 "*If non-nil, all syntactic symbols must be found in `c-offsets-alist'. | |
239 If the syntactic symbol for a particular line does not match a symbol | |
240 in the offsets alist, or if no non-nil offset value can be determined | |
241 for a symbol, an error is generated, otherwise no error is reported | |
242 and the syntactic symbol is ignored. | |
243 | |
244 This variable is considered obsolete; it doesn't work well with lineup | |
245 functions that return nil to support the feature of using lists on | |
246 syntactic symbols in `c-offsets-alist'. Please keep it set to nil." | |
247 :type 'boolean | |
248 :group 'c) | |
249 | |
250 (defcustom c-echo-syntactic-information-p nil | |
251 "*If non-nil, syntactic info is echoed when the line is indented." | |
252 :type 'boolean | |
253 :group 'c) | |
254 | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
255 (defcustom c-report-syntactic-errors nil |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
256 "*If non-nil, certain syntactic errors are reported with a ding |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
257 and a message, for example when an \"else\" is indented for which |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
258 there's no corresponding \"if\". |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
259 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
260 Note however that CC Mode doesn't make any special effort to check for |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
261 syntactic errors; that's the job of the compiler. The reason it can |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
262 report cases like the one above is that it can't find the correct |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
263 anchoring position to indent the line in that case." |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
264 :type 'boolean |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
265 :group 'c) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
266 |
26817 | 267 (defcustom-c-stylevar c-basic-offset 4 |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
268 "*Amount of basic offset used by + and - symbols in `c-offsets-alist'. |
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
269 Also used as the indentation step when `c-syntactic-indentation' is |
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
270 nil." |
26817 | 271 :type 'integer |
272 :group 'c) | |
70590
63b772bfba93
Move `safe-local-variable' declarations to the respective files.
Reiner Steib <Reiner.Steib@gmx.de>
parents:
69140
diff
changeset
|
273 ;;;###autoload(put 'c-basic-offset 'safe-local-variable 'integerp) |
26817 | 274 |
18720 | 275 (defcustom c-tab-always-indent t |
276 "*Controls the operation of the TAB key. | |
56646
b7446b6f097d
Updated CC Mode to 5.30.9.
Martin Stjernholm <mast@lysator.liu.se>
parents:
53073
diff
changeset
|
277 If t, hitting TAB always just indents the current line. If nil, hitting |
b7446b6f097d
Updated CC Mode to 5.30.9.
Martin Stjernholm <mast@lysator.liu.se>
parents:
53073
diff
changeset
|
278 TAB indents the current line if point is at the left margin or in the |
b7446b6f097d
Updated CC Mode to 5.30.9.
Martin Stjernholm <mast@lysator.liu.se>
parents:
53073
diff
changeset
|
279 line's indentation, otherwise it inserts a `real' tab character \(see |
b7446b6f097d
Updated CC Mode to 5.30.9.
Martin Stjernholm <mast@lysator.liu.se>
parents:
53073
diff
changeset
|
280 note\). If some other value (not nil or t), then tab is inserted only |
b7446b6f097d
Updated CC Mode to 5.30.9.
Martin Stjernholm <mast@lysator.liu.se>
parents:
53073
diff
changeset
|
281 within literals \(comments and strings), but the line is always |
b7446b6f097d
Updated CC Mode to 5.30.9.
Martin Stjernholm <mast@lysator.liu.se>
parents:
53073
diff
changeset
|
282 reindented. |
18720 | 283 |
284 Note: The value of `indent-tabs-mode' will determine whether a real | |
26817 | 285 tab character will be inserted, or the equivalent number of spaces. |
18720 | 286 When inserting a tab, actually the function stored in the variable |
287 `c-insert-tab-function' is called. | |
288 | |
289 Note: indentation of lines containing only comments is also controlled | |
290 by the `c-comment-only-line-offset' variable." | |
291 :type '(radio | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
292 (const :tag "TAB key always indents, never inserts TAB" t) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
293 (const :tag "TAB key indents in left margin, otherwise inserts TAB" nil) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
294 (other :tag "TAB key inserts TAB in literals, otherwise indents" other)) |
18720 | 295 :group 'c) |
296 | |
297 (defcustom c-insert-tab-function 'insert-tab | |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
298 "*Function used when inserting a tab for \\[c-indent-command]. |
18720 | 299 Only used when `c-tab-always-indent' indicates a `real' tab character |
300 should be inserted. Value must be a function taking no arguments." | |
301 :type 'function | |
302 :group 'c) | |
303 | |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
304 (defcustom c-syntactic-indentation t |
36920 | 305 "*Whether the indentation should be controlled by the syntactic context. |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
306 |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
307 If t, the indentation functions indent according to the syntactic |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
308 context, using the style settings specified by `c-offsets-alist'. |
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
309 |
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
310 If nil, every line is just indented to the same level as the previous |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
311 one, and the \\[c-indent-command] command adjusts the indentation in |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
312 steps specified by `c-basic-offset'. The indentation style has no |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
313 effect in this mode, nor any of the indentation associated variables, |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
314 e.g. `c-special-indent-hook'." |
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
315 :type 'boolean |
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
316 :group 'c) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
317 (make-variable-buffer-local 'c-syntactic-indentation) |
79885
897a4cc5c95d
* progmodes/sh-script.el (sh-basic-offset):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
79860
diff
changeset
|
318 (put 'c-syntactic-indentation 'safe-local-variable 'booleanp) |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
319 |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
320 (defcustom c-syntactic-indentation-in-macros t |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
321 "*Enable syntactic analysis inside macros. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
322 If this is nil, all lines inside macro definitions are analyzed as |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
323 `cpp-macro-cont'. Otherwise they are analyzed syntactically, just |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
324 like normal code, and `cpp-define-intro' is used to create the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
325 additional indentation of the bodies of \"#define\" macros. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
326 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
327 Having this enabled simplifies editing of large multiline macros, but |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
328 it might complicate editing if CC Mode doesn't recognize the context |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
329 of the macro content. The default context inside the macro is the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
330 same as the top level, so if it contains \"bare\" statements they |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
331 might be indented wrongly, although there are special cases that |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
332 handle this in most cases. If this problem occurs, it's usually |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
333 countered easily by surrounding the statements by a block \(or even |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
334 better with the \"do { ... } while \(0)\" trick)." |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
335 :type 'boolean |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
336 :group 'c) |
79885
897a4cc5c95d
* progmodes/sh-script.el (sh-basic-offset):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
79860
diff
changeset
|
337 (put 'c-syntactic-indentation-in-macros 'safe-local-variable 'booleanp) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
338 |
26817 | 339 (defcustom-c-stylevar c-comment-only-line-offset 0 |
18720 | 340 "*Extra offset for line which contains only the start of a comment. |
341 Can contain an integer or a cons cell of the form: | |
342 | |
343 (NON-ANCHORED-OFFSET . ANCHORED-OFFSET) | |
344 | |
345 Where NON-ANCHORED-OFFSET is the amount of offset given to | |
346 non-column-zero anchored comment-only lines, and ANCHORED-OFFSET is | |
347 the amount of offset to give column-zero anchored comment-only lines. | |
26817 | 348 Just an integer as value is equivalent to (<val> . -1000). |
349 | |
350 Note that this variable only has effect when the `c-lineup-comment' | |
351 lineup function is used on the `comment-intro' syntactic symbol (the | |
352 default)." | |
353 :type '(choice (integer :tag "Non-anchored offset" 0) | |
18720 | 354 (cons :tag "Non-anchored & anchored offset" |
355 :value (0 . 0) | |
356 (integer :tag "Non-anchored offset") | |
357 (integer :tag "Anchored offset"))) | |
358 :group 'c) | |
359 | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
360 (defcustom-c-stylevar c-indent-comment-alist |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
361 '((anchored-comment . (column . 0)) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
362 (end-block . (space . 1)) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
363 (cpp-end-block . (space . 2))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
364 "*Specifies how \\[indent-for-comment] calculates the comment start column. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
365 This is an association list that contains entries of the form: |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
366 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
367 (LINE-TYPE . INDENT-SPEC) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
368 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
369 LINE-TYPE specifies a type of line as described below, and INDENT-SPEC |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
370 says what \\[indent-for-comment] should do when used on that type of line. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
371 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
372 The recognized values for LINE-TYPE are: |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
373 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
374 empty-line -- The line is empty. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
375 anchored-comment -- The line contains a comment that starts in column 0. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
376 end-block -- The line contains a solitary block closing brace. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
377 cpp-end-block -- The line contains a preprocessor directive that |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
378 closes a block, i.e. either \"#endif\" or \"#else\". |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
379 other -- The line does not match any other entry |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
380 currently on the list. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
381 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
382 An INDENT-SPEC is a cons cell of the form: |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
383 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
384 (ACTION . VALUE) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
385 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
386 ACTION says how \\[indent-for-comment] should align the comment, and |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
387 VALUE is interpreted depending on ACTION. ACTION can be any of the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
388 following: |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
389 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
390 space -- Put VALUE spaces between the end of the line and the start |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
391 of the comment. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
392 column -- Start the comment at the column VALUE. If the line is |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
393 longer than that, the comment is preceded by a single |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
394 space. If VALUE is nil, `comment-column' is used. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
395 align -- Align the comment with one on the previous line, if there |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
396 is any. If the line is too long, the comment is preceded |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
397 by a single space. If there isn't a comment start on the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
398 previous line, the behavior is specified by VALUE, which |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
399 in turn is interpreted as an INDENT-SPEC. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
400 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
401 If a LINE-TYPE is missing, then \\[indent-for-comment] indents the comment |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
402 according to `comment-column'. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
403 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
404 Note that a non-nil value on `c-indent-comments-syntactically-p' |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
405 overrides this variable, so empty lines are indentented syntactically |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
406 in that case, i.e. as if \\[c-indent-command] was used instead." |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
407 :type |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
408 (let ((space '(cons :tag "space" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
409 :format "%v" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
410 :value (space . 1) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
411 (const :format "space " space) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
412 (integer :format "%v"))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
413 (column '(cons :tag "column" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
414 :format "%v" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
415 (const :format "column " column) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
416 (c-integer-or-nil :format "%v")))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
417 `(set ,@(mapcar |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
418 (lambda (elt) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
419 `(cons :format "%v" |
79841
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
420 ,(c-constant-symbol elt 20) |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
421 (choice |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
422 :format "%[Choice%] %v" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
423 :value (column . nil) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
424 ,space |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
425 ,column |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
426 (cons :tag "align" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
427 :format "%v" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
428 (const :format "align " align) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
429 (choice |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
430 :format "%[Choice%] %v" |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
431 :value (column . nil) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
432 ,space |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
433 ,column))))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
434 '(empty-line anchored-comment end-block cpp-end-block other)))) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
435 :group 'c) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
436 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
437 (defcustom-c-stylevar c-indent-comments-syntactically-p nil |
26817 | 438 "*Specifies how \\[indent-for-comment] should handle comment-only lines. |
18720 | 439 When this variable is non-nil, comment-only lines are indented |
26817 | 440 according to syntactic analysis via `c-offsets-alist'. Otherwise, the |
441 comment is indented as if it was preceded by code. Note that this | |
442 variable does not affect how the normal line indentation treats | |
443 comment-only lines." | |
18720 | 444 :type 'boolean |
445 :group 'c) | |
446 | |
36920 | 447 (make-obsolete-variable 'c-comment-continuation-stars |
448 'c-block-comment-prefix) | |
449 | |
450 ;; Although c-comment-continuation-stars is obsolete, we look at it in | |
451 ;; some places in CC Mode anyway, so make the compiler ignore it | |
452 ;; during our compilation. | |
453 (cc-bytecomp-obsolete-var c-comment-continuation-stars) | |
454 (cc-bytecomp-defvar c-comment-continuation-stars) | |
455 | |
26817 | 456 (defcustom-c-stylevar c-block-comment-prefix |
457 (if (boundp 'c-comment-continuation-stars) | |
458 c-comment-continuation-stars | |
459 "* ") | |
460 "*Specifies the line prefix of continued C-style block comments. | |
19298
4a99e63dc4a9
(c-buffer-is-cc-mode): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19255
diff
changeset
|
461 You should set this variable to the literal string that gets inserted |
4a99e63dc4a9
(c-buffer-is-cc-mode): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19255
diff
changeset
|
462 at the front of continued block style comment lines. This should |
26817 | 463 either be the empty string, or some characters without preceding |
464 spaces. To adjust the alignment under the comment starter, put an | |
465 appropriate value on the `c' syntactic symbol (see the | |
466 `c-offsets-alist' variable). | |
467 | |
468 It's only used when a one-line block comment is broken into two or | |
469 more lines for the first time; otherwise the appropriate prefix is | |
470 adapted from the comment. This variable is not used for C++ line | |
471 style comments." | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
472 :type 'string |
19298
4a99e63dc4a9
(c-buffer-is-cc-mode): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19255
diff
changeset
|
473 :group 'c) |
4a99e63dc4a9
(c-buffer-is-cc-mode): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19255
diff
changeset
|
474 |
36920 | 475 (defcustom-c-stylevar c-comment-prefix-regexp |
476 '((pike-mode . "//+!?\\|\\**") | |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
477 (awk-mode . "#+") |
36920 | 478 (other . "//+\\|\\**")) |
26817 | 479 "*Regexp to match the line prefix inside comments. |
480 This regexp is used to recognize the fill prefix inside comments for | |
481 correct paragraph filling and other things. | |
482 | |
36920 | 483 If this variable is a string, it will be used in all CC Mode major |
484 modes. It can also be an association list, to associate specific | |
485 regexps to specific major modes. The symbol for the major mode is | |
486 looked up in the association list, and its value is used as the line | |
487 prefix regexp. If it's not found, then the symbol `other' is looked | |
488 up and its value is used instead. | |
489 | |
490 The regexp should match the prefix used in both C++ style line | |
491 comments and C style block comments, but it does not need to match a | |
492 block comment starter. In other words, it should at least match | |
493 \"//\" for line comments and the string in `c-block-comment-prefix', | |
494 which is sometimes inserted by CC Mode inside block comments. It | |
495 should not match any surrounding whitespace. | |
26817 | 496 |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
497 Note that CC Mode uses this variable to set many other variables that |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
498 handle the paragraph filling. That's done at mode initialization or |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
499 when you switch to a style which sets this variable. Thus, if you |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
500 change it in some other way, e.g. interactively in a CC Mode buffer, |
52609
ce6cc36ebb7c
(c-comment-prefix-regexp): Document that `c-setup-paragraph-variables'
Martin Stjernholm <mast@lysator.liu.se>
parents:
52401
diff
changeset
|
501 you will need to do \\[c-setup-paragraph-variables] afterwards so that |
ce6cc36ebb7c
(c-comment-prefix-regexp): Document that `c-setup-paragraph-variables'
Martin Stjernholm <mast@lysator.liu.se>
parents:
52401
diff
changeset
|
502 the other variables are updated with the new value. |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
503 |
52609
ce6cc36ebb7c
(c-comment-prefix-regexp): Document that `c-setup-paragraph-variables'
Martin Stjernholm <mast@lysator.liu.se>
parents:
52401
diff
changeset
|
504 Note also that when CC Mode starts up, all variables are initialized |
ce6cc36ebb7c
(c-comment-prefix-regexp): Document that `c-setup-paragraph-variables'
Martin Stjernholm <mast@lysator.liu.se>
parents:
52401
diff
changeset
|
505 before the mode hooks are run. It's therefore necessary to make a |
ce6cc36ebb7c
(c-comment-prefix-regexp): Document that `c-setup-paragraph-variables'
Martin Stjernholm <mast@lysator.liu.se>
parents:
52401
diff
changeset
|
506 call to `c-setup-paragraph-variables' explicitly if you change this |
ce6cc36ebb7c
(c-comment-prefix-regexp): Document that `c-setup-paragraph-variables'
Martin Stjernholm <mast@lysator.liu.se>
parents:
52401
diff
changeset
|
507 variable in a mode hook." |
36920 | 508 :type '(radio |
509 (regexp :tag "Regexp for all modes") | |
510 (list | |
511 :tag "Mode-specific regexps" | |
512 (set | |
513 :inline t :format "%v" | |
514 (cons :format "%v" | |
515 (const :format "C " c-mode) (regexp :format "%v")) | |
516 (cons :format "%v" | |
517 (const :format "C++ " c++-mode) (regexp :format "%v")) | |
518 (cons :format "%v" | |
519 (const :format "ObjC " objc-mode) (regexp :format "%v")) | |
520 (cons :format "%v" | |
521 (const :format "Java " java-mode) (regexp :format "%v")) | |
522 (cons :format "%v" | |
523 (const :format "IDL " idl-mode) (regexp :format "%v")) | |
524 (cons :format "%v" | |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
525 (const :format "Pike " pike-mode) (regexp :format "%v")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
526 (cons :format "%v" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
527 (const :format "AWK " awk-mode) (regexp :format "%v"))) |
36920 | 528 (cons :format " %v" |
529 (const :format "Other " other) (regexp :format "%v")))) | |
26817 | 530 :group 'c) |
531 | |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
532 (defcustom-c-stylevar c-doc-comment-style |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
533 '((java-mode . javadoc) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
534 (pike-mode . autodoc) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
535 (c-mode . gtkdoc)) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
536 "*Specifies documentation comment style(s) to recognize. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
537 This is primarily used to fontify doc comments and the markup within |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
538 them, e.g. Javadoc comments. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
539 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
540 The value can be any of the following symbols for various known doc |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
541 comment styles: |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
542 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
543 javadoc -- Javadoc style for \"/** ... */\" comments (default in Java mode). |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
544 autodoc -- Pike autodoc style for \"//! ...\" comments (default in Pike mode). |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
545 gtkdoc -- GtkDoc style for \"/** ... **/\" comments (default in C mode). |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
546 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
547 The value may also be a list of doc comment styles, in which case all |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
548 of them are recognized simultaneously (presumably with markup cues |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
549 that don't conflict). |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
550 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
551 The value may also be an association list to specify different doc |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
552 comment styles for different languages. The symbol for the major mode |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
553 is then looked up in the alist, and the value of that element is |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
554 interpreted as above if found. If it isn't found then the symbol |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
555 `other' is looked up and its value is used instead. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
556 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
557 Note that CC Mode uses this variable to set other variables that |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
558 handle fontification etc. That's done at mode initialization or when |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
559 you switch to a style which sets this variable. Thus, if you change |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
560 it in some other way, e.g. interactively in a CC Mode buffer, you will |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
561 need to do \\[java-mode] (or whatever mode you're currently using) to |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
562 reinitialize. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
563 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
564 Note also that when CC Mode starts up, the other variables are |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
565 modified before the mode hooks are run. If you change this variable |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
566 in a mode hook, you have to call `c-setup-doc-comment-style' |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
567 afterwards to redo that work." |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
568 ;; Symbols other than those documented above may be used on this |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
569 ;; variable. If a variable exists that has that name with |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
570 ;; "-font-lock-keywords" appended, it's value is prepended to the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
571 ;; font lock keywords list. If it's a function then it's called and |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
572 ;; the result is prepended. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
573 :type '(radio |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
574 (c-symbol-list :tag "Doc style(s) in all modes") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
575 (list |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
576 :tag "Mode-specific doc styles" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
577 (set |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
578 :inline t :format "%v" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
579 (cons :format "%v" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
580 (const :format "C " c-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
581 (c-symbol-list :format "%v")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
582 (cons :format "%v" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
583 (const :format "C++ " c++-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
584 (c-symbol-list :format "%v")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
585 (cons :format "%v" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
586 (const :format "ObjC " objc-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
587 (c-symbol-list :format "%v")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
588 (cons :format "%v" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
589 (const :format "Java " java-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
590 (c-symbol-list :format "%v")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
591 (cons :format "%v" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
592 (const :format "IDL " idl-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
593 (c-symbol-list :format "%v")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
594 (cons :format "%v" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
595 (const :format "Pike " pike-mode) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
596 (c-symbol-list :format "%v")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
597 (cons :format "%v" |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
598 (const :format "AWK " awk-mode) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
599 (c-symbol-list :format "%v")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
600 (cons :format "%v" |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
601 (const :format "Other " other) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
602 (c-symbol-list :format "%v"))))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
603 :group 'c) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
604 |
26817 | 605 (defcustom c-ignore-auto-fill '(string cpp code) |
606 "*List of contexts in which automatic filling never occurs. | |
607 If Auto Fill mode is active, it will be temporarily disabled if point | |
608 is in any context on this list. It's e.g. useful to enable Auto Fill | |
609 in comments only, but not in strings or normal code. The valid | |
610 contexts are: | |
611 | |
612 string -- inside a string or character literal | |
613 c -- inside a C style block comment | |
614 c++ -- inside a C++ style line comment | |
615 cpp -- inside a preprocessor directive | |
616 code -- anywhere else, i.e. in normal code" | |
617 :type '(set | |
618 (const :tag "String literals" string) | |
619 (const :tag "C style block comments" c) | |
620 (const :tag "C++ style line comments" c++) | |
621 (const :tag "Preprocessor directives" cpp) | |
622 (const :tag "Normal code" code)) | |
623 :group 'c) | |
624 | |
625 (defcustom-c-stylevar c-cleanup-list '(scope-operator) | |
18720 | 626 "*List of various C/C++/ObjC constructs to \"clean up\". |
36920 | 627 The following clean ups only take place when the auto-newline feature |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
628 is turned on, as evidenced by the `/la' appearing next to the mode |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
629 name: |
18720 | 630 |
36920 | 631 brace-else-brace -- Clean up \"} else {\" constructs by placing |
632 entire construct on a single line. This clean | |
633 up only takes place when there is nothing but | |
18720 | 634 white space between the braces and the `else'. |
26817 | 635 Clean up occurs when the open brace after the |
18720 | 636 `else' is typed. |
36920 | 637 brace-elseif-brace -- Similar to brace-else-brace, but clean up |
638 \"} else if (...) {\" constructs. Clean up | |
639 occurs after the open parenthesis and the open | |
640 brace. | |
641 brace-catch-brace -- Similar to brace-elseif-brace, but clean up | |
642 \"} catch (...) {\" constructs. | |
643 empty-defun-braces -- Clean up empty defun braces by placing the | |
18720 | 644 braces on the same line. Clean up occurs when |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
645 the defun closing brace is typed. |
75027
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74372
diff
changeset
|
646 one-liner-defun -- If the code inside a function body can fit in |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74372
diff
changeset
|
647 a single line, then remove any newlines |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74372
diff
changeset
|
648 between that line and the defun braces so that |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74372
diff
changeset
|
649 the whole body becomes a single line. |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
650 `c-max-one-liner-length' gives the maximum |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
651 length allowed for the resulting line. Clean |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
652 up occurs when the closing brace is typed. |
36920 | 653 defun-close-semi -- Clean up the terminating semi-colon on defuns |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
654 by placing the semi-colon on the same line as |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
655 the closing brace. Clean up occurs when the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
656 semi-colon is typed. |
36920 | 657 list-close-comma -- Clean up commas following braces in array |
18720 | 658 and aggregate initializers. Clean up occurs |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
659 when the comma is typed. |
36920 | 660 scope-operator -- Clean up double colons which may designate |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
661 a C++ scope operator split across multiple |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
662 lines. Note that certain C++ constructs can |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
663 generate ambiguous situations. This clean up |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
664 only takes place when there is nothing but |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
665 whitespace between colons. Clean up occurs |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
666 when the second colon is typed. |
36920 | 667 |
668 The following clean ups always take place when they are on this list, | |
669 regardless of the auto-newline feature, since they typically don't | |
670 involve auto-newline inserted newlines: | |
671 | |
672 space-before-funcall -- Insert exactly one space before the opening | |
673 parenthesis of a function call. Clean up | |
674 occurs when the opening parenthesis is typed. | |
675 compact-empty-funcall -- Clean up any space before the function call | |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
676 opening parenthesis if and only if the |
36920 | 677 argument list is empty. This is typically |
678 useful together with `space-before-funcall' to | |
679 get the style \"foo (bar)\" and \"foo()\". | |
680 Clean up occurs when the closing parenthesis | |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
681 is typed. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
682 comment-close-slash -- When a slash is typed after the comment prefix |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
683 on a bare line in a c-style comment, the comment |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
684 is closed by cleaning up preceding space and |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
685 inserting a star if needed." |
18720 | 686 :type '(set |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
687 (const :tag "Put \"} else {\" on one line (brace-else-brace)" |
36920 | 688 brace-else-brace) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
689 (const :tag "Put \"} else if (...) {\" on one line (brace-elseif-brace)" |
36920 | 690 brace-elseif-brace) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
691 (const :tag "Put \"} catch (...) {\" on one line (brace-catch-brace)" |
36920 | 692 brace-catch-brace) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
693 (const :tag "Put empty defun braces on one line (empty-defun-braces)" |
36920 | 694 empty-defun-braces) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
695 (const :tag "Put short function bodies on one line (one-liner-defun)" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
696 one-liner-defun) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
697 (const :tag "Put \"};\" ending defuns on one line (defun-close-semi)" |
36920 | 698 defun-close-semi) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
699 (const :tag "Put \"},\" in aggregates on one line (list-close-comma)" |
36920 | 700 list-close-comma) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
701 (const :tag "Put C++ style \"::\" on one line (scope-operator)" |
36920 | 702 scope-operator) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
703 (const :tag "Put a space before funcall parens, e.g. \"foo (bar)\" (space-before-funcall)" |
36920 | 704 space-before-funcall) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
705 (const :tag "Remove space before empty funcalls, e.g. \"foo()\" (compact-empty-funcall)" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
706 compact-empty-funcall) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
707 (const :tag "Make / on a bare line of a C-style comment close it (comment-close-slash)" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
708 comment-close-slash)) |
18720 | 709 :group 'c) |
710 | |
26817 | 711 (defcustom-c-stylevar c-hanging-braces-alist '((brace-list-open) |
712 (brace-entry-open) | |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
713 (statement-cont) |
26817 | 714 (substatement-open after) |
715 (block-close . c-snug-do-while) | |
716 (extern-lang-open after) | |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
717 (namespace-open after) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
718 (module-open after) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
719 (composition-open after) |
26817 | 720 (inexpr-class-open after) |
79936
996fec9cb719
Introduce elements for the syntactic symbol arglist-cont-nonempty into
Alan Mackenzie <acm@muc.de>
parents:
79885
diff
changeset
|
721 (inexpr-class-close before) |
996fec9cb719
Introduce elements for the syntactic symbol arglist-cont-nonempty into
Alan Mackenzie <acm@muc.de>
parents:
79885
diff
changeset
|
722 (arglist-cont-nonempty)) |
26817 | 723 "*Controls the insertion of newlines before and after braces |
724 when the auto-newline feature is active. This variable contains an | |
725 association list with elements of the following form: | |
726 \(SYNTACTIC-SYMBOL . ACTION). | |
18720 | 727 |
728 When a brace (either opening or closing) is inserted, the syntactic | |
729 context it defines is looked up in this list, and if found, the | |
730 associated ACTION is used to determine where newlines are inserted. | |
731 If the context is not found, the default is to insert a newline both | |
732 before and after the brace. | |
733 | |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
734 SYNTACTIC-SYMBOL can be statement-cont, brace-list-intro, |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
735 inexpr-class-open, inexpr-class-close, and any of the *-open and |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
736 *-close symbols. See `c-offsets-alist' for details, except for |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
737 inexpr-class-open and inexpr-class-close, which doesn't have any |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
738 corresponding symbols there. Those two symbols are used for the |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
739 opening and closing braces, respectively, of anonymous inner classes |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
740 in Java. |
18720 | 741 |
742 ACTION can be either a function symbol or a list containing any | |
743 combination of the symbols `before' or `after'. If the list is empty, | |
744 no newlines are inserted either before or after the brace. | |
745 | |
746 When ACTION is a function symbol, the function is called with a two | |
747 arguments: the syntactic symbol for the brace and the buffer position | |
748 at which the brace was inserted. The function must return a list as | |
749 described in the preceding paragraph. Note that during the call to | |
750 the function, the variable `c-syntactic-context' is set to the entire | |
751 syntactic context for the brace line." | |
26817 | 752 :type |
753 `(set ,@(mapcar | |
754 (lambda (elt) | |
755 `(cons :format "%v" | |
79841
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
756 ,(c-constant-symbol elt 24) |
26817 | 757 (choice :format "%[Choice%] %v" |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
758 :value (before after) |
26817 | 759 (set :menu-tag "Before/after" |
79841
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
760 :format "Newline %v brace\n" |
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
761 (const :format "%v, " before) |
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
762 (const :format "%v " after)) |
26817 | 763 (function :menu-tag "Function" |
79841
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
764 :format "Run function: %v")))) |
26817 | 765 '(defun-open defun-close |
766 class-open class-close | |
767 inline-open inline-close | |
768 block-open block-close | |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
769 statement-cont substatement-open statement-case-open |
26817 | 770 brace-list-open brace-list-close |
771 brace-list-intro brace-entry-open | |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
772 extern-lang-open extern-lang-close |
26817 | 773 namespace-open namespace-close |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
774 module-open module-close |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
775 composition-open composition-close |
79936
996fec9cb719
Introduce elements for the syntactic symbol arglist-cont-nonempty into
Alan Mackenzie <acm@muc.de>
parents:
79885
diff
changeset
|
776 inexpr-class-open inexpr-class-close |
996fec9cb719
Introduce elements for the syntactic symbol arglist-cont-nonempty into
Alan Mackenzie <acm@muc.de>
parents:
79885
diff
changeset
|
777 arglist-cont-nonempty))) |
26817 | 778 :group 'c) |
18720 | 779 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
780 (defcustom c-max-one-liner-length 80 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
781 "Maximum length of line that clean-up \"one-liner-defun\" will compact to. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
782 Zero or nil means no limit." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
783 :type 'integer |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
784 :group 'c) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
785 |
26817 | 786 (defcustom-c-stylevar c-hanging-colons-alist nil |
18720 | 787 "*Controls the insertion of newlines before and after certain colons. |
788 This variable contains an association list with elements of the | |
789 following form: (SYNTACTIC-SYMBOL . ACTION). | |
790 | |
791 SYNTACTIC-SYMBOL can be any of: case-label, label, access-label, | |
792 member-init-intro, or inher-intro. | |
793 | |
794 See the variable `c-hanging-braces-alist' for the semantics of this | |
795 variable. Note however that making ACTION a function symbol is | |
796 currently not supported for this variable." | |
26817 | 797 :type |
798 `(set ,@(mapcar | |
799 (lambda (elt) | |
800 `(cons :format "%v" | |
79841
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
801 ,(c-constant-symbol elt 20) |
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
802 (set :format "Newline %v colon\n" |
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
803 (const :format "%v, " before) |
26817 | 804 (const :format "%v" after)))) |
805 '(case-label label access-label member-init-intro inher-intro))) | |
18720 | 806 :group 'c) |
807 | |
26817 | 808 (defcustom-c-stylevar c-hanging-semi&comma-criteria |
809 '(c-semi&comma-inside-parenlist) | |
18720 | 810 "*List of functions that decide whether to insert a newline or not. |
811 The functions in this list are called, in order, whenever the | |
812 auto-newline minor mode is activated (as evidenced by a `/a' or `/ah' | |
813 string in the mode line), and a semicolon or comma is typed (see | |
814 `c-electric-semi&comma'). Each function in this list is called with | |
815 no arguments, and should return one of the following values: | |
816 | |
817 nil -- no determination made, continue checking | |
818 'stop -- do not insert a newline, and stop checking | |
819 (anything else) -- insert a newline, and stop checking | |
820 | |
821 If every function in the list is called with no determination made, | |
822 then no newline is inserted." | |
823 :type '(repeat function) | |
824 :group 'c) | |
825 | |
26817 | 826 (defcustom-c-stylevar c-backslash-column 48 |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
827 "*Minimum alignment column for line continuation backslashes. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
828 This is used by the functions that automatically insert or align the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
829 line continuation backslashes in multiline macros. If any line in the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
830 macro exceeds this column then the next tab stop from that line is |
74205
b3f1ef7ff72f
(c-backslash-column): Add . at end of sentence.
Jan Djärv <jan.h.d@swipnet.se>
parents:
74179
diff
changeset
|
831 used as alignment column instead. See also `c-backslash-max-column'." |
18720 | 832 :type 'integer |
833 :group 'c) | |
70773
35e35b506682
(c-backslash-column): Mark as safe if its value is an integer.
Eli Zaretskii <eliz@gnu.org>
parents:
70590
diff
changeset
|
834 ;;;###autoload(put 'c-backslash-column 'safe-local-variable 'integerp) |
18720 | 835 |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
836 (defcustom-c-stylevar c-backslash-max-column 72 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
837 "*Maximum alignment column for line continuation backslashes. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
838 This is used by the functions that automatically insert or align the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
839 line continuation backslashes in multiline macros. If any line in the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
840 macro exceeds this column then the backslashes for the other lines |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
841 will be aligned at this column." |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
842 :type 'integer |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
843 :group 'c) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
844 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
845 (defcustom c-auto-align-backslashes t |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
846 "*Align automatically inserted line continuation backslashes. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
847 When line continuation backslashes are inserted automatically for line |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
848 breaks in multiline macros, e.g. by \\[c-context-line-break], they are |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
849 aligned with the other backslashes in the same macro if this flag is |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
850 set. Otherwise the inserted backslashes are preceded by a single |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
851 space." |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
852 :type 'boolean |
18720 | 853 :group 'c) |
854 | |
855 (defcustom c-backspace-function 'backward-delete-char-untabify | |
856 "*Function called by `c-electric-backspace' when deleting backwards." | |
857 :type 'function | |
858 :group 'c) | |
859 | |
860 (defcustom c-delete-function 'delete-char | |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
861 "*Function called by `c-electric-delete-forward' when deleting forwards." |
18720 | 862 :type 'function |
863 :group 'c) | |
864 | |
49496
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
865 (defcustom c-require-final-newline |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
866 ;; C and C++ mandate that all nonempty files should end with a |
49496
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
867 ;; newline. Objective-C refers to C for all things it doesn't |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
868 ;; specify, so the same holds there. The other languages do not |
49496
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
869 ;; require it (at least not explicitly in a normative text). |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
870 '((c-mode . t) |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
871 (c++-mode . t) |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
872 (objc-mode . t)) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
873 "*Controls whether a final newline is ensured when the file is saved. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
874 The value is an association list that for each language mode specifies |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
875 the value to give to `require-final-newline' at mode initialization; |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
876 see that variable for details about the value. If a language isn't |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
877 present on the association list, CC Mode won't touch |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
878 `require-final-newline' in buffers for that language." |
49496
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
879 :type `(set (cons :format "%v" |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
880 (const :format "C " c-mode) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
881 (symbol :format "%v" :value ,require-final-newline)) |
49496
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
882 (cons :format "%v" |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
883 (const :format "C++ " c++-mode) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
884 (symbol :format "%v" :value ,require-final-newline)) |
49496
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
885 (cons :format "%v" |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
886 (const :format "ObjC " objc-mode) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
887 (symbol :format "%v" :value ,require-final-newline)) |
49496
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
888 (cons :format "%v" |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
889 (const :format "Java " java-mode) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
890 (symbol :format "%v" :value ,require-final-newline)) |
49496
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
891 (cons :format "%v" |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
892 (const :format "IDL " idl-mode) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
893 (symbol :format "%v" :value ,require-final-newline)) |
49496
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
894 (cons :format "%v" |
2c05c557df6c
(c-require-final-newline): Made this variable an alist to specify a value
Martin Stjernholm <mast@lysator.liu.se>
parents:
49479
diff
changeset
|
895 (const :format "Pike " pike-mode) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
896 (symbol :format "%v" :value ,require-final-newline)) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
897 (cons :format "%v" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
898 (const :format "AWK " awk-mode) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
899 (symbol :format "%v" :value ,require-final-newline))) |
49470
13365bab7fce
(c-require-final-newline): Added a variable to make the initialization of
Martin Stjernholm <mast@lysator.liu.se>
parents:
48656
diff
changeset
|
900 :group 'c) |
13365bab7fce
(c-require-final-newline): Added a variable to make the initialization of
Martin Stjernholm <mast@lysator.liu.se>
parents:
48656
diff
changeset
|
901 |
18720 | 902 (defcustom c-electric-pound-behavior nil |
903 "*List of behaviors for electric pound insertion. | |
904 Only currently supported behavior is `alignleft'." | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
905 :type '(set (const alignleft)) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
906 :group 'c) |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
907 |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
908 (defcustom c-special-indent-hook nil |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
909 "*Hook for user defined special indentation adjustments. |
76948
7322915e700b
* (c-special-indent-hook): Amend doc-string to mention
Alan Mackenzie <acm@muc.de>
parents:
75516
diff
changeset
|
910 This hook gets called after each line is indented by the mode. It is only |
7322915e700b
* (c-special-indent-hook): Amend doc-string to mention
Alan Mackenzie <acm@muc.de>
parents:
75516
diff
changeset
|
911 called if `c-syntactic-indentation' is non-nil." |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
912 :type 'hook |
18720 | 913 :group 'c) |
914 | |
26817 | 915 (defcustom-c-stylevar c-label-minimum-indentation 1 |
53073
49f65e04ba8e
CC Mode update (5.30.8).
Martin Stjernholm <mast@lysator.liu.se>
parents:
52609
diff
changeset
|
916 "*Minimum indentation for lines inside code blocks. |
18720 | 917 This variable typically only affects code using the `gnu' style, which |
53073
49f65e04ba8e
CC Mode update (5.30.8).
Martin Stjernholm <mast@lysator.liu.se>
parents:
52609
diff
changeset
|
918 mandates a minimum of one space in front of every line inside code |
49f65e04ba8e
CC Mode update (5.30.8).
Martin Stjernholm <mast@lysator.liu.se>
parents:
52609
diff
changeset
|
919 blocks. Specifically, the function `c-gnu-impose-minimum' on your |
49f65e04ba8e
CC Mode update (5.30.8).
Martin Stjernholm <mast@lysator.liu.se>
parents:
52609
diff
changeset
|
920 `c-special-indent-hook' is what enforces this." |
18720 | 921 :type 'integer |
922 :group 'c) | |
923 | |
924 (defcustom c-progress-interval 5 | |
925 "*Interval used to update progress status during long re-indentation. | |
926 If a number, percentage complete gets updated after each interval of | |
20144
56d81cc7b4f5
(c-progress-interval): Document new semantics
Karl Heuer <kwzh@gnu.org>
parents:
20140
diff
changeset
|
927 that many seconds. To inhibit all messages during indentation, set |
56d81cc7b4f5
(c-progress-interval): Document new semantics
Karl Heuer <kwzh@gnu.org>
parents:
20140
diff
changeset
|
928 this variable to nil." |
18720 | 929 :type 'integer |
930 :group 'c) | |
931 | |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
932 (defcustom c-default-style '((java-mode . "java") (awk-mode . "awk") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
933 (other . "gnu")) |
24282 | 934 "*Style which gets installed by default when a file is visited. |
20919
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
935 |
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
936 The value of this variable can be any style defined in |
24282 | 937 `c-style-alist', including styles you add. The value can also be an |
938 association list of major mode symbols to style names. | |
939 | |
940 When the value is a string, all CC Mode major modes will install this | |
36920 | 941 style by default. |
20919
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
942 |
26817 | 943 When the value is an alist, the major mode symbol is looked up in it |
944 and the associated style is installed. If the major mode is not | |
945 listed in the alist, then the symbol `other' is looked up in it, and | |
946 if found, the style in that entry is used. If `other' is not found in | |
947 the alist, then \"gnu\" style is used. | |
948 | |
949 The default style gets installed before your mode hooks run, so you | |
950 can always override the use of `c-default-style' by making calls to | |
36920 | 951 `c-set-style' in the appropriate mode hook." |
26817 | 952 :type '(radio |
36920 | 953 (string :tag "Style in all modes") |
954 (set :tag "Mode-specific styles" | |
955 (cons :format "%v" | |
956 (const :format "C " c-mode) (string :format "%v")) | |
957 (cons :format "%v" | |
958 (const :format "C++ " c++-mode) (string :format "%v")) | |
959 (cons :format "%v" | |
960 (const :format "ObjC " objc-mode) (string :format "%v")) | |
961 (cons :format "%v" | |
962 (const :format "Java " java-mode) (string :format "%v")) | |
963 (cons :format "%v" | |
964 (const :format "IDL " idl-mode) (string :format "%v")) | |
965 (cons :format "%v" | |
966 (const :format "Pike " pike-mode) (string :format "%v")) | |
967 (cons :format "%v" | |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
968 (const :format "AWK " awk-mode) (string :format "%v")) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
969 (cons :format "%v" |
36920 | 970 (const :format "Other " other) (string :format "%v")))) |
26817 | 971 :group 'c) |
20919
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
972 |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
973 ;; *) At the start of a statement or declaration means in more detail: |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
974 ;; At the closest preceding statement/declaration that starts at boi |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
975 ;; and doesn't have a label or comment at that position. If there's |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
976 ;; no such statement within the same block, then back up to the |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
977 ;; surrounding block or statement, add the appropriate |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
978 ;; statement-block-intro, defun-block-intro or substatement syntax |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
979 ;; symbol and continue searching. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
980 (c-set-stylevar-fallback 'c-offsets-alist |
26817 | 981 '((string . c-lineup-dont-change) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
982 ;; Anchor pos: Beg of previous line. |
26817 | 983 (c . c-lineup-C-comments) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
984 ;; Anchor pos: Beg of the comment. |
26817 | 985 (defun-open . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
986 ;; Anchor pos: When inside a class: Boi at the func decl start. |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
987 ;; When at top level: Bol at the func decl start. When inside |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
988 ;; a code block (only possible in Pike): At the func decl |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
989 ;; start(*). |
26817 | 990 (defun-close . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
991 ;; Anchor pos: At the defun block open if it's at boi, |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
992 ;; otherwise boi at the func decl start. |
26817 | 993 (defun-block-intro . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
994 ;; Anchor pos: At the block open(*). |
26817 | 995 (class-open . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
996 ;; Anchor pos: Boi at the class decl start. |
26817 | 997 (class-close . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
998 ;; Anchor pos: Boi at the class decl start. |
26817 | 999 (inline-open . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1000 ;; Anchor pos: None for functions (inclass got the relpos |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1001 ;; then), boi at the lambda start for lambdas. |
26817 | 1002 (inline-close . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1003 ;; Anchor pos: Inexpr functions: At the lambda block open if |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1004 ;; it's at boi, else at the statement(*) at boi of the start of |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1005 ;; the lambda construct. Otherwise: At the inline block open |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1006 ;; if it's at boi, otherwise boi at the func decl start. |
26817 | 1007 (func-decl-cont . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1008 ;; Anchor pos: Boi at the func decl start. |
26817 | 1009 (knr-argdecl-intro . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1010 ;; Anchor pos: Boi at the topmost intro line. |
26817 | 1011 (knr-argdecl . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1012 ;; Anchor pos: At the beginning of the first K&R argdecl. |
26817 | 1013 (topmost-intro . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1014 ;; Anchor pos: Bol at the last line of previous construct. |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1015 (topmost-intro-cont . c-lineup-topmost-intro-cont) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1016 ;; Anchor pos: Boi at the topmost intro line. |
26817 | 1017 (member-init-intro . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1018 ;; Anchor pos: Boi at the func decl arglist open. |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
1019 (member-init-cont . c-lineup-multi-inher) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1020 ;; Anchor pos: Beg of the first member init. |
26817 | 1021 (inher-intro . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1022 ;; Anchor pos: Boi at the class decl start. |
26817 | 1023 (inher-cont . c-lineup-multi-inher) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1024 ;; Anchor pos: Java: At the implements/extends keyword start. |
26817 | 1025 ;; Otherwise: At the inher start colon, or boi at the class |
1026 ;; decl start if the first inherit clause hangs and it's not a | |
1027 ;; func-local inherit clause (when does that occur?). | |
1028 (block-open . 0) | |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1029 ;; Anchor pos: Inexpr statement: At the statement(*) at boi of |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1030 ;; the start of the inexpr construct. Otherwise: None. |
26817 | 1031 (block-close . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1032 ;; Anchor pos: Inexpr statement: At the inexpr block open if |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1033 ;; it's at boi, else at the statement(*) at boi of the start of |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1034 ;; the inexpr construct. Block hanging on a case/default |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1035 ;; label: At the closest preceding label that starts at boi. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1036 ;; Otherwise: At the block open(*). |
26817 | 1037 (brace-list-open . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1038 ;; Anchor pos: Boi at the brace list decl start, but a starting |
26817 | 1039 ;; "typedef" token is ignored. |
1040 (brace-list-close . 0) | |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1041 ;; Anchor pos: At the brace list decl start(*). |
26817 | 1042 (brace-list-intro . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1043 ;; Anchor pos: At the brace list decl start(*). |
26817 | 1044 (brace-list-entry . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1045 ;; Anchor pos: At the first non-ws char after the open paren if |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1046 ;; the first token is on the same line, otherwise boi at that |
26817 | 1047 ;; token. |
1048 (brace-entry-open . 0) | |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1049 ;; Anchor pos: Same as brace-list-entry. |
26817 | 1050 (statement . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1051 ;; Anchor pos: After a `;' in the condition clause of a for |
26817 | 1052 ;; statement: At the first token after the starting paren. |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1053 ;; Otherwise: At the preceding statement(*). |
26817 | 1054 (statement-cont . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1055 ;; Anchor pos: After the first token in the condition clause of |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1056 ;; a for statement: At the first token after the starting |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1057 ;; paren. Otherwise: At the containing statement(*). |
26817 | 1058 (statement-block-intro . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1059 ;; Anchor pos: In inexpr statement block: At the inexpr block |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1060 ;; open if it's at boi, else at the statement(*) at boi of the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1061 ;; start of the inexpr construct. In a block hanging on a |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1062 ;; case/default label: At the closest preceding label that |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1063 ;; starts at boi. Otherwise: At the start of the containing |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1064 ;; block(*). |
26817 | 1065 (statement-case-intro . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1066 ;; Anchor pos: At the case/default label(*). |
26817 | 1067 (statement-case-open . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1068 ;; Anchor pos: At the case/default label(*). |
26817 | 1069 (substatement . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1070 ;; Anchor pos: At the containing statement(*). |
26817 | 1071 (substatement-open . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1072 ;; Anchor pos: At the containing statement(*). |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1073 (substatement-label . 2) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1074 ;; Anchor pos: At the containing statement(*). |
26817 | 1075 (case-label . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1076 ;; Anchor pos: At the start of the switch block(*). |
26817 | 1077 (access-label . -) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1078 ;; Anchor pos: Same as inclass. |
26817 | 1079 (label . 2) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1080 ;; Anchor pos: At the start of the containing block(*). |
26817 | 1081 (do-while-closure . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1082 ;; Anchor pos: At the corresponding while statement(*). |
26817 | 1083 (else-clause . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1084 ;; Anchor pos: At the corresponding if statement(*). |
26817 | 1085 (catch-clause . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1086 ;; Anchor pos: At the previous try or catch statement clause(*). |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1087 (comment-intro . (c-lineup-knr-region-comment c-lineup-comment)) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1088 ;; Anchor pos: None. |
26817 | 1089 (arglist-intro . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1090 ;; Anchor pos: At the containing statement(*). |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1091 ;; 2nd pos: At the open paren. |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1092 (arglist-cont . (c-lineup-gcc-asm-reg 0)) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1093 ;; Anchor pos: At the first token after the open paren. |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1094 (arglist-cont-nonempty . (c-lineup-gcc-asm-reg c-lineup-arglist)) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1095 ;; Anchor pos: At the containing statement(*). |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1096 ;; 2nd pos: At the open paren. |
26817 | 1097 (arglist-close . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1098 ;; Anchor pos: At the containing statement(*). |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1099 ;; 2nd pos: At the open paren. |
26817 | 1100 (stream-op . c-lineup-streamop) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1101 ;; Anchor pos: Boi at the first stream op in the statement. |
26817 | 1102 (inclass . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1103 ;; Anchor pos: At the class open brace if it's at boi, |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1104 ;; otherwise boi at the class decl start. |
36920 | 1105 (cpp-macro . [0]) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1106 ;; Anchor pos: None. |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1107 (cpp-macro-cont . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1108 ;; Anchor pos: At the macro start (always at boi). |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1109 (cpp-define-intro . (c-lineup-cpp-define +)) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1110 ;; Anchor pos: None. |
26817 | 1111 (friend . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1112 ;; Anchor pos: None. |
36920 | 1113 (objc-method-intro . [0]) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1114 ;; Anchor pos: Boi. |
26817 | 1115 (objc-method-args-cont . c-lineup-ObjC-method-args) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1116 ;; Anchor pos: At the method start (always at boi). |
26817 | 1117 (objc-method-call-cont . c-lineup-ObjC-method-call) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1118 ;; Anchor pos: At the open bracket. |
26817 | 1119 (extern-lang-open . 0) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1120 (namespace-open . 0) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1121 (module-open . 0) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1122 (composition-open . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1123 ;; Anchor pos: Boi at the extern/namespace/etc keyword. |
26817 | 1124 (extern-lang-close . 0) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1125 (namespace-close . 0) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1126 (module-close . 0) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1127 (composition-close . 0) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1128 ;; Anchor pos: Boi at the corresponding extern/namespace/etc keyword. |
26817 | 1129 (inextern-lang . +) |
1130 (innamespace . +) | |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1131 (inmodule . +) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1132 (incomposition . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1133 ;; Anchor pos: At the extern/namespace/etc block open brace if |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1134 ;; it's at boi, otherwise boi at the keyword. |
26817 | 1135 (template-args-cont . (c-lineup-template-args +)) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1136 ;; Anchor pos: Boi at the decl start. This might be changed; |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1137 ;; the logical position is clearly the opening '<'. |
26817 | 1138 (inlambda . c-lineup-inexpr-block) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1139 ;; Anchor pos: None. |
26817 | 1140 (lambda-intro-cont . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1141 ;; Anchor pos: Boi at the lambda start. |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1142 (inexpr-statement . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1143 ;; Anchor pos: None. |
26817 | 1144 (inexpr-class . +) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1145 ;; Anchor pos: None. |
26817 | 1146 )) |
1147 (defcustom c-offsets-alist nil | |
1148 "Association list of syntactic element symbols and indentation offsets. | |
1149 As described below, each cons cell in this list has the form: | |
24282 | 1150 |
26817 | 1151 (SYNTACTIC-SYMBOL . OFFSET) |
1152 | |
1153 When a line is indented, CC Mode first determines the syntactic | |
1154 context of it by generating a list of symbols called syntactic | |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1155 elements. The global variable `c-syntactic-context' is bound to the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1156 that list. Each element in the list is in turn a list where the first |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1157 element is a syntactic symbol which tells what kind of construct the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1158 indentation point is located within. More elements in the syntactic |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1159 element lists are optional. If there is one more and it isn't nil, |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1160 then it's the anchor position for that construct. |
26817 | 1161 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1162 After generating the syntactic context for the line, CC Mode |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1163 calculates the absolute indentation: First the base indentation is |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1164 found by using the anchor position for the first syntactic element |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1165 that provides one. If none does, zero is used as base indentation. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1166 Then CC Mode looks at each syntactic element in the context in turn. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1167 It compares the car of the syntactic element against the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1168 SYNTACTIC-SYMBOL's in `c-offsets-alist'. When it finds a match, it |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1169 adds OFFSET to the base indentation. The sum of this calculation is |
26817 | 1170 the absolute offset for line being indented. |
1171 | |
1172 If the syntactic element does not match any in the `c-offsets-alist', | |
36920 | 1173 the element is ignored. |
1174 | |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1175 OFFSET can specify an offset in several different ways: |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1176 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1177 If OFFSET is nil then it's ignored. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1178 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1179 If OFFSET is an integer then it's used as relative offset, i.e. it's |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1180 added to the base indentation. |
36920 | 1181 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1182 If OFFSET is one of the symbols `+', `-', `++', `--', `*', or `/' |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1183 then a positive or negative multiple of `c-basic-offset' is added to |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1184 the base indentation; 1, -1, 2, -2, 0.5, and -0.5, respectively. |
36920 | 1185 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1186 If OFFSET is a symbol with a value binding then that value, which |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1187 must be an integer, is used as relative offset. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1188 |
75516
befb5e26b9e7
(c-offsets-alist): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
75347
diff
changeset
|
1189 If OFFSET is a vector then its first element, which must be an |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1190 integer, is used as an absolute indentation column. This overrides |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1191 the previous base indentation and the relative offsets applied to |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1192 it, and it becomes the new base indentation. |
26817 | 1193 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1194 If OFFSET is a function or a lambda expression then it's called with |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1195 a single argument containing the cons of the syntactic symbol and |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1196 the anchor position (or nil if there is none). The return value |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1197 from the function is then reinterpreted as an offset specification. |
26817 | 1198 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1199 If OFFSET is a list then its elements are evaluated recursively as |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1200 offset specifications. If the first element is any of the symbols |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1201 below then it isn't evaluated but instead specifies how the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1202 remaining offsets in the list should be combined. If it's something |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1203 else then the list is combined according the method `first'. The |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1204 valid combination methods are: |
36920 | 1205 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1206 `first' -- Use the first offset (that doesn't evaluate to nil). |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1207 `min' -- Use the minimum of all the offsets. All must be either |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1208 relative or absolute - they can't be mixed. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1209 `max' -- Use the maximum of all the offsets. All must be either |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1210 relative or absolute - they can't be mixed. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1211 `add' -- Add all the evaluated offsets together. Exactly one of |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1212 them may be absolute, in which case the result is |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1213 absolute. Any relative offsets that preceded the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1214 absolute one in the list will be ignored in that case. |
26817 | 1215 |
1216 `c-offsets-alist' is a style variable. This means that the offsets on | |
1217 this variable are normally taken from the style system in CC Mode | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1218 \(see `c-default-style' and `c-style-alist'). However, any offsets |
26817 | 1219 put explicitly on this list will override the style system when a CC |
1220 Mode buffer is initialized \(there is a variable | |
1221 `c-old-style-variable-behavior' that changes this, though). | |
1222 | |
1223 Here is the current list of valid syntactic element symbols: | |
1224 | |
1225 string -- Inside multi-line string. | |
1226 c -- Inside a multi-line C style block comment. | |
1227 defun-open -- Brace that opens a function definition. | |
1228 defun-close -- Brace that closes a function definition. | |
1229 defun-block-intro -- The first line in a top-level defun. | |
1230 class-open -- Brace that opens a class definition. | |
1231 class-close -- Brace that closes a class definition. | |
1232 inline-open -- Brace that opens an in-class inline method. | |
1233 inline-close -- Brace that closes an in-class inline method. | |
1234 func-decl-cont -- The region between a function definition's | |
1235 argument list and the function opening brace | |
1236 (excluding K&R argument declarations). In C, you | |
1237 cannot put anything but whitespace and comments | |
1238 between them; in C++ and Java, throws declarations | |
1239 and other things can appear in this context. | |
1240 knr-argdecl-intro -- First line of a K&R C argument declaration. | |
1241 knr-argdecl -- Subsequent lines in a K&R C argument declaration. | |
1242 topmost-intro -- The first line in a topmost construct definition. | |
1243 topmost-intro-cont -- Topmost definition continuation lines. | |
1244 member-init-intro -- First line in a member initialization list. | |
1245 member-init-cont -- Subsequent member initialization list lines. | |
1246 inher-intro -- First line of a multiple inheritance list. | |
1247 inher-cont -- Subsequent multiple inheritance lines. | |
1248 block-open -- Statement block open brace. | |
1249 block-close -- Statement block close brace. | |
1250 brace-list-open -- Open brace of an enum or static array list. | |
1251 brace-list-close -- Close brace of an enum or static array list. | |
1252 brace-list-intro -- First line in an enum or static array list. | |
1253 brace-list-entry -- Subsequent lines in an enum or static array list. | |
1254 brace-entry-open -- Subsequent lines in an enum or static array | |
1255 list that start with an open brace. | |
1256 statement -- A C (or like) statement. | |
1257 statement-cont -- A continuation of a C (or like) statement. | |
1258 statement-block-intro -- The first line in a new statement block. | |
1259 statement-case-intro -- The first line in a case \"block\". | |
1260 statement-case-open -- The first line in a case block starting with brace. | |
1261 substatement -- The first line after an if/while/for/do/else. | |
1262 substatement-open -- The brace that opens a substatement block. | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1263 substatement-label -- Labelled line after an if/while/for/do/else. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1264 case-label -- A \"case\" or \"default\" label. |
26817 | 1265 access-label -- C++ private/protected/public access label. |
1266 label -- Any ordinary label. | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1267 do-while-closure -- The \"while\" that ends a do/while construct. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1268 else-clause -- The \"else\" of an if/else construct. |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1269 catch-clause -- The \"catch\" or \"finally\" of a try/catch construct. |
26817 | 1270 comment-intro -- A line containing only a comment introduction. |
1271 arglist-intro -- The first line in an argument list. | |
1272 arglist-cont -- Subsequent argument list lines when no | |
1273 arguments follow on the same line as the | |
1274 arglist opening paren. | |
1275 arglist-cont-nonempty -- Subsequent argument list lines when at | |
1276 least one argument follows on the same | |
1277 line as the arglist opening paren. | |
1278 arglist-close -- The solo close paren of an argument list. | |
1279 stream-op -- Lines continuing a stream operator construct. | |
1280 inclass -- The construct is nested inside a class definition. | |
1281 Used together with e.g. `topmost-intro'. | |
1282 cpp-macro -- The start of a C preprocessor macro definition. | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1283 cpp-macro-cont -- Inside a multi-line C preprocessor macro definition. |
26817 | 1284 friend -- A C++ friend declaration. |
1285 objc-method-intro -- The first line of an Objective-C method definition. | |
1286 objc-method-args-cont -- Lines continuing an Objective-C method definition. | |
1287 objc-method-call-cont -- Lines continuing an Objective-C method call. | |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1288 extern-lang-open -- Brace that opens an \"extern\" block. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1289 extern-lang-close -- Brace that closes an \"extern\" block. |
26817 | 1290 inextern-lang -- Analogous to the `inclass' syntactic symbol, |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1291 but used inside \"extern\" blocks. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1292 namespace-open, namespace-close, innamespace |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1293 -- Similar to the three `extern-lang' symbols, but for |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1294 C++ \"namespace\" blocks. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1295 module-open, module-close, inmodule |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1296 -- Similar to the three `extern-lang' symbols, but for |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1297 CORBA IDL \"module\" blocks. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1298 composition-open, composition-close, incomposition |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1299 -- Similar to the three `extern-lang' symbols, but for |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1300 CORBA CIDL \"composition\" blocks. |
26817 | 1301 template-args-cont -- C++ template argument list continuations. |
1302 inlambda -- In the header or body of a lambda function. | |
1303 lambda-intro-cont -- Continuation of the header of a lambda function. | |
1304 inexpr-statement -- The statement is inside an expression. | |
1305 inexpr-class -- The class is inside an expression. Used e.g. for | |
1306 Java anonymous classes." | |
1307 :type | |
1308 `(set :format "%{%t%}: | |
1309 Override style setting | |
1310 | Syntax Offset | |
1311 %v" | |
1312 ,@(mapcar | |
1313 (lambda (elt) | |
1314 `(cons :format "%v" | |
1315 :value ,elt | |
79841
3a06f32d85f6
* (c-constant-symbol): New function which supersedes c-const-symbol.
Alan Mackenzie <acm@muc.de>
parents:
79717
diff
changeset
|
1316 ,(c-constant-symbol (car elt) 25) |
26817 | 1317 (sexp :format "%v" |
1318 :validate | |
1319 (lambda (widget) | |
1320 (unless (c-valid-offset (widget-value widget)) | |
1321 (widget-put widget :error "Invalid offset") | |
1322 widget))))) | |
1323 (get 'c-offsets-alist 'c-stylevar-fallback))) | |
18720 | 1324 :group 'c) |
1325 | |
53073
49f65e04ba8e
CC Mode update (5.30.8).
Martin Stjernholm <mast@lysator.liu.se>
parents:
52609
diff
changeset
|
1326 ;; The syntactic symbols that can occur inside code blocks. Used by |
49f65e04ba8e
CC Mode update (5.30.8).
Martin Stjernholm <mast@lysator.liu.se>
parents:
52609
diff
changeset
|
1327 ;; `c-gnu-impose-minimum'. |
49f65e04ba8e
CC Mode update (5.30.8).
Martin Stjernholm <mast@lysator.liu.se>
parents:
52609
diff
changeset
|
1328 (defconst c-inside-block-syms |
49f65e04ba8e
CC Mode update (5.30.8).
Martin Stjernholm <mast@lysator.liu.se>
parents:
52609
diff
changeset
|
1329 '(defun-block-intro block-open block-close statement statement-cont |
49f65e04ba8e
CC Mode update (5.30.8).
Martin Stjernholm <mast@lysator.liu.se>
parents:
52609
diff
changeset
|
1330 statement-block-intro statement-case-intro statement-case-open |
49f65e04ba8e
CC Mode update (5.30.8).
Martin Stjernholm <mast@lysator.liu.se>
parents:
52609
diff
changeset
|
1331 substatement substatement-open substatement-label case-label label |
49f65e04ba8e
CC Mode update (5.30.8).
Martin Stjernholm <mast@lysator.liu.se>
parents:
52609
diff
changeset
|
1332 do-while-closure else-clause catch-clause inlambda)) |
49f65e04ba8e
CC Mode update (5.30.8).
Martin Stjernholm <mast@lysator.liu.se>
parents:
52609
diff
changeset
|
1333 |
30399
7b0a7b155fe2
(c-style-variables-are-local-p): Incompatible
Gerd Moellmann <gerd@gnu.org>
parents:
26817
diff
changeset
|
1334 (defcustom c-style-variables-are-local-p t |
18720 | 1335 "*Whether style variables should be buffer local by default. |
1336 If non-nil, then all indentation style related variables will be made | |
1337 buffer local by default. If nil, they will remain global. Variables | |
1338 are made buffer local when this file is loaded, and once buffer | |
1339 localized, they cannot be made global again. | |
1340 | |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1341 This variable must be set appropriately before CC Mode is loaded. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1342 |
18720 | 1343 The list of variables to buffer localize are: |
1344 c-basic-offset | |
1345 c-comment-only-line-offset | |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1346 c-indent-comment-alist |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1347 c-indent-comments-syntactically-p |
26817 | 1348 c-block-comment-prefix |
1349 c-comment-prefix-regexp | |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1350 c-doc-comment-style |
18720 | 1351 c-cleanup-list |
1352 c-hanging-braces-alist | |
1353 c-hanging-colons-alist | |
26817 | 1354 c-hanging-semi&comma-criteria |
18720 | 1355 c-backslash-column |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1356 c-backslash-max-column |
18720 | 1357 c-label-minimum-indentation |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1358 c-offsets-alist |
18720 | 1359 c-special-indent-hook |
1360 c-indentation-style" | |
1361 :type 'boolean | |
1362 :group 'c) | |
1363 | |
1364 (defcustom c-mode-hook nil | |
1365 "*Hook called by `c-mode'." | |
26817 | 1366 :type 'hook |
18720 | 1367 :group 'c) |
1368 | |
1369 (defcustom c++-mode-hook nil | |
1370 "*Hook called by `c++-mode'." | |
1371 :type 'hook | |
1372 :group 'c) | |
1373 | |
1374 (defcustom objc-mode-hook nil | |
1375 "*Hook called by `objc-mode'." | |
1376 :type 'hook | |
1377 :group 'c) | |
1378 | |
1379 (defcustom java-mode-hook nil | |
1380 "*Hook called by `java-mode'." | |
1381 :type 'hook | |
1382 :group 'c) | |
1383 | |
19255
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1384 (defcustom idl-mode-hook nil |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1385 "*Hook called by `idl-mode'." |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1386 :type 'hook |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1387 :group 'c) |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1388 |
26817 | 1389 (defcustom pike-mode-hook nil |
1390 "*Hook called by `pike-mode'." | |
1391 :type 'hook | |
1392 :group 'c) | |
1393 | |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1394 (defcustom awk-mode-hook nil |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1395 "*Hook called by `awk-mode'." |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1396 :type 'hook |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1397 :group 'c) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1398 |
18720 | 1399 (defcustom c-mode-common-hook nil |
1400 "*Hook called by all CC Mode modes for common initializations." | |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1401 :type 'hook |
18720 | 1402 :group 'c) |
1403 | |
19255
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1404 (defcustom c-initialization-hook nil |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1405 "*Hook called when the CC Mode package gets initialized. |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1406 This hook is only run once per Emacs session and can be used as a |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1407 `load-hook' or in place of using `eval-after-load'." |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1408 :type 'hook |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1409 :group 'c) |
40a9475f22ea
(idl-mode-hook): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
18848
diff
changeset
|
1410 |
24282 | 1411 (defcustom c-enable-xemacs-performance-kludge-p nil |
20919
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
1412 "*Enables a XEmacs only hack that may improve speed for some coding styles. |
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
1413 For styles that hang top-level opening braces (as is common with JDK |
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
1414 Java coding styles) this can improve performance between 3 and 60 |
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
1415 times for core indentation functions (e.g. `c-parse-state'). For |
9cffecf3b1ca
(c-enable-xemacs-performance-kludge-p): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
20144
diff
changeset
|
1416 styles that conform to the Emacs recommendation of putting these |
24282 | 1417 braces in column zero, this can degrade performance about as much. |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1418 This variable only has effect in XEmacs." |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1419 :type 'boolean |
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1420 :group 'c) |
18720 | 1421 |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1422 (defvar c-old-style-variable-behavior nil |
26817 | 1423 "*Enables the old style variable behavior when non-nil. |
1424 | |
1425 Normally the values of the style variables will override the style | |
1426 settings specified by the variables `c-default-style' and | |
44728
7a3ac6c387fe
CC Mode update to version 5.29. This is for testing; it's not a released
Martin Stjernholm <mast@lysator.liu.se>
parents:
44412
diff
changeset
|
1427 `c-style-alist'. However, in CC Mode 5.25 and earlier, it was the |
26817 | 1428 other way around, meaning that changes made to the style variables |
1429 from e.g. Customize would not take effect unless special precautions | |
1430 were taken. That was confusing, especially for novice users. | |
1431 | |
1432 It's believed that despite this change, the new behavior will still | |
1433 produce the same results for most old CC Mode configurations, since | |
1434 all style variables are per default set in a special non-override | |
1435 state. Set this variable only if your configuration has stopped | |
1436 working due to this change.") | |
1437 | |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1438 (define-widget 'c-extra-types-widget 'radio |
52340
600f01b30149
(c-extra-types-widget): The doc string is mandatory in
Martin Stjernholm <mast@lysator.liu.se>
parents:
51949
diff
changeset
|
1439 "Internal CC Mode widget for the `*-font-lock-extra-types' variables." |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1440 :args '((const :tag "none" nil) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1441 (repeat :tag "types" regexp))) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1442 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1443 (defun c-make-font-lock-extra-types-blurb (mode1 mode2 example) |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1444 (concat "\ |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1445 *List of extra types (aside from the type keywords) to recognize in " |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1446 mode1 " mode. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1447 Each list item should be a regexp matching a single identifier. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1448 " example " |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1449 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1450 Note that items on this list that don't include any regexp special |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1451 characters are automatically optimized using `regexp-opt', so you |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1452 should not use `regexp-opt' explicitly to build regexps here. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1453 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1454 On decoration level 3 (and higher, where applicable), a method is used |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1455 that finds most types and declarations by syntax alone. This variable |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1456 is still used as a first step, but other types are recognized |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1457 correctly anyway in most cases. Therefore this variable should be |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1458 fairly restrictive and not contain patterns that are uncertain. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1459 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1460 Note that this variable is only consulted when the major mode is |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1461 initialized. If you change it later you have to reinitialize CC Mode |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1462 by doing \\[" mode2 "]. |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1463 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1464 Despite the name, this variable is not only used for font locking but |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1465 also elsewhere in CC Mode to tell types from other identifiers.")) |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1466 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1467 ;; Note: Most of the variables below are also defined in font-lock.el |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1468 ;; in older versions of Emacs, so depending on the load order we might |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1469 ;; not install the values below. There's no kludge to cope with this |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1470 ;; (as opposed to the *-font-lock-keywords-* variables) since the old |
52340
600f01b30149
(c-extra-types-widget): The doc string is mandatory in
Martin Stjernholm <mast@lysator.liu.se>
parents:
51949
diff
changeset
|
1471 ;; values work fairly well anyway. |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1472 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1473 (defcustom c-font-lock-extra-types |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1474 '("\\sw+_t" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1475 ;; Defined in C99: |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1476 "bool" "complex" "imaginary" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1477 ;; Standard library types (except those matched by the _t pattern): |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1478 "FILE" "lconv" "tm" "va_list" "jmp_buf" |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1479 ;; I do not appreciate the following very Emacs-specific luggage |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1480 ;; in the default value, but otoh it can hardly get in the way for |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1481 ;; other users, and removing it would cause unnecessary grief for |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1482 ;; the old timers that are used to it. /mast |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1483 "Lisp_Object") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1484 (c-make-font-lock-extra-types-blurb "C" "c-mode" |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1485 "For example, a value of (\"FILE\" \"\\\\sw+_t\") means the word \"FILE\" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1486 and words ending in \"_t\" are treated as type names.") |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1487 :type 'c-extra-types-widget |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1488 :group 'c) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1489 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1490 (defcustom c++-font-lock-extra-types |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1491 '("\\sw+_t" |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1492 ;; C library types (except those matched by the _t pattern): |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1493 "FILE" "lconv" "tm" "va_list" "jmp_buf" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1494 ;; Some standard C++ types that came from font-lock.el. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1495 ;; Experienced C++ users says there's no clear benefit in |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1496 ;; extending this to all the types in the standard library, at |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1497 ;; least not when they'll be recognized without "std::" too. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1498 "istream" "istreambuf" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1499 "ostream" "ostreambuf" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1500 "ifstream" "ofstream" "fstream" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1501 "strstream" "strstreambuf" "istrstream" "ostrstream" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1502 "ios" |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1503 "string" "rope" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1504 "list" "slist" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1505 "deque" "vector" "bit_vector" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1506 "set" "multiset" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1507 "map" "multimap" |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1508 "hash" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1509 "hash_set" "hash_multiset" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1510 "hash_map" "hash_multimap" |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1511 "stack" "queue" "priority_queue" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1512 "type_info" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1513 "iterator" "const_iterator" "reverse_iterator" "const_reverse_iterator" |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1514 "reference" "const_reference") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1515 (c-make-font-lock-extra-types-blurb "C++" "c++-mode" |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1516 "For example, a value of (\"string\") means the word \"string\" is treated |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1517 as a type name.") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1518 :type 'c-extra-types-widget |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1519 :group 'c) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1520 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1521 (defcustom objc-font-lock-extra-types |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1522 (list (concat "[" c-upper "]\\sw*[" c-lower "]\\sw*")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1523 (c-make-font-lock-extra-types-blurb "ObjC" "objc-mode" (concat |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1524 "For example, a value of (\"[" c-upper "]\\\\sw*[" c-lower "]\\\\sw*\") means |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1525 capitalized words are treated as type names (the requirement for a |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1526 lower case char is to avoid recognizing all-caps macro and constant |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1527 names).")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1528 :type 'c-extra-types-widget |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1529 :group 'c) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1530 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1531 (defcustom java-font-lock-extra-types |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1532 (list (concat "[" c-upper "]\\sw*[" c-lower "]\\sw*")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1533 (c-make-font-lock-extra-types-blurb "Java" "java-mode" (concat |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1534 "For example, a value of (\"[" c-upper "]\\\\sw*[" c-lower "]\\\\sw*\") means |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1535 capitalized words are treated as type names (the requirement for a |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1536 lower case char is to avoid recognizing all-caps constant names).")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1537 :type 'c-extra-types-widget |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1538 :group 'c) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1539 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1540 (defcustom idl-font-lock-extra-types nil |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1541 (c-make-font-lock-extra-types-blurb "IDL" "idl-mode" "") |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1542 :type 'c-extra-types-widget |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1543 :group 'c) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1544 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1545 (defcustom pike-font-lock-extra-types |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1546 (list (concat "[" c-upper "]\\sw*[" c-lower "]\\sw*")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1547 (c-make-font-lock-extra-types-blurb "Pike" "pike-mode" (concat |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1548 "For example, a value of (\"[" c-upper "]\\\\sw*[" c-lower "]\\\\sw*\") means |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1549 capitalized words are treated as type names (the requirement for a |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1550 lower case char is to avoid recognizing all-caps macro and constant |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1551 names).")) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1552 :type 'c-extra-types-widget |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1553 :group 'c) |
26817 | 1554 |
18720 | 1555 |
1556 ;; Non-customizable variables, still part of the interface to CC Mode | |
1557 (defvar c-file-style nil | |
1558 "Variable interface for setting style via File Local Variables. | |
1559 In a file's Local Variable section, you can set this variable to a | |
1560 string suitable for `c-set-style'. When the file is visited, CC Mode | |
1561 will set the style of the file to this value automatically. | |
1562 | |
1563 Note that file style settings are applied before file offset settings | |
1564 as designated in the variable `c-file-offsets'.") | |
26817 | 1565 (make-variable-buffer-local 'c-file-style) |
70590
63b772bfba93
Move `safe-local-variable' declarations to the respective files.
Reiner Steib <Reiner.Steib@gmx.de>
parents:
69140
diff
changeset
|
1566 ;;;###autoload(put 'c-file-style 'safe-local-variable 'string-or-null-p) |
18720 | 1567 |
1568 (defvar c-file-offsets nil | |
1569 "Variable interface for setting offsets via File Local Variables. | |
1570 In a file's Local Variable section, you can set this variable to an | |
1571 association list similar to the values allowed in `c-offsets-alist'. | |
1572 When the file is visited, CC Mode will institute these offset settings | |
1573 automatically. | |
1574 | |
1575 Note that file offset settings are applied after file style settings | |
1576 as designated in the variable `c-file-style'.") | |
26817 | 1577 (make-variable-buffer-local 'c-file-offsets) |
18720 | 1578 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1579 ;; It isn't possible to specify a doc-string without specifying an |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1580 ;; initial value with `defvar', so the following two variables have been |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1581 ;; given doc-strings by setting the property `variable-documentation' |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1582 ;; directly. C-h v will read this documentation only for versions of GNU |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1583 ;; Emacs from 22.1. It's really good not to have an initial value for |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1584 ;; variables like these that always should be dynamically bound, so it's |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1585 ;; worth the inconvenience. |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1586 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1587 (cc-bytecomp-defvar c-syntactic-context) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1588 (defvar c-syntactic-context) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1589 (put 'c-syntactic-context 'variable-documentation |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1590 "Variable containing the syntactic analysis list for a line of code. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1591 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1592 It is a list with one element for each syntactic symbol pertinent to the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1593 line, for example \"((defun-block-intro 1) (comment-intro))\". |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1594 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1595 It is dynamically bound when calling \(i) a brace hanging \"action |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1596 function\"; \(ii) a semicolon/comma hanging \"criteria function\"; \(iii) a |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1597 \"line-up function\"; \(iv) a c-special-indent-hook function. It is also |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1598 used internally by CC Mode. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1599 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1600 c-syntactic-context is always bound dynamically. It must NEVER be set |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1601 statically (e.g. with `setq').") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1602 |
51714
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1603 |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1604 (cc-bytecomp-defvar c-syntactic-element) |
bc91cbf50c24
Updated CC Mode to version 5.30.
Martin Stjernholm <mast@lysator.liu.se>
parents:
49857
diff
changeset
|
1605 (defvar c-syntactic-element) |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1606 (put 'c-syntactic-element 'variable-documentation |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1607 "Variable containing the current syntactic element during calls to |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1608 the lineup functions. The value is one of the elements in the list in |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1609 `c-syntactic-context' and is a list with the symbol name in the first |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1610 position, followed by zero or more elements containing any additional |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1611 info associated with the syntactic symbol. There are accessor functions |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1612 `c-langelem-sym', `c-langelem-pos', `c-langelem-col', and |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1613 `c-langelem-2nd-pos' to access the list. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1614 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1615 Specifically, the element returned by `c-langelem-pos' is the anchor |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1616 position, or nil if there isn't any. See the comments in the |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1617 `c-offsets-alist' variable and the CC Mode manual for more detailed info |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1618 about the data each syntactic symbol provides. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1619 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1620 This is always bound dynamically. It should never be set |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1621 statically (e.g. with `setq').") |
18720 | 1622 |
26817 | 1623 (defvar c-indentation-style nil |
36920 | 1624 "Name of the currently installed style. |
75027
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74372
diff
changeset
|
1625 Don't change this directly; call `c-set-style' instead, or set the variable |
9f636bd65206
Update CC Mode to version 5.31.4. The detailed changes are those
Alan Mackenzie <acm@muc.de>
parents:
74372
diff
changeset
|
1626 `c-file-style' in the file's Local Variable list.") |
18720 | 1627 |
36920 | 1628 (defvar c-current-comment-prefix nil |
1629 "The current comment prefix regexp. | |
1630 Set from `c-comment-prefix-regexp' at mode initialization.") | |
1631 (make-variable-buffer-local 'c-current-comment-prefix) | |
19298
4a99e63dc4a9
(c-buffer-is-cc-mode): New variable.
Richard M. Stallman <rms@gnu.org>
parents:
19255
diff
changeset
|
1632 |
67252
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1633 ;; N.B. The next three variables are initialized in |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1634 ;; c-setup-paragraph-variables. Their initializations here are "just in |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1635 ;; case". ACM, 2004/2/15. They are NOT buffer local (yet?). |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1636 (defvar c-string-par-start |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1637 ;; (concat "\\(" (default-value 'paragraph-start) "\\)\\|[ \t]*\\\\$") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1638 "\f\\|[ \t]*\\\\?$" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1639 "Value of paragraph-start used when scanning strings. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1640 It treats escaped EOLs as whitespace.") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1641 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1642 (defvar c-string-par-separate |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1643 ;; (concat "\\(" (default-value 'paragraph-separate) "\\)\\|[ \t]*\\\\$") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1644 "[ \t\f]*\\\\?$" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1645 "Value of paragraph-separate used when scanning strings. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1646 It treats escaped EOLs as whitespace.") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1647 |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1648 (defvar c-sentence-end-with-esc-eol |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1649 (concat "\\(\\(" (c-default-value-sentence-end) "\\)" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1650 ;; N.B.: "$" would be illegal when not enclosed like "\\($\\)". |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1651 "\\|" "[.?!][]\"')}]* ?\\\\\\($\\)[ \t\n]*" |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1652 "\\)") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1653 "Value used like sentence-end used when scanning strings. |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1654 It treats escaped EOLs as whitespace.") |
04d2abb755d9
Update CC Mode to release 5.31.
Alan Mackenzie <acm@muc.de>
parents:
64699
diff
changeset
|
1655 |
18720 | 1656 |
36920 | 1657 (cc-provide 'cc-vars) |
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
36920
diff
changeset
|
1658 |
52401 | 1659 ;;; arch-tag: d62e9a55-c9fe-409b-b5b6-050b6aa202c9 |
18720 | 1660 ;;; cc-vars.el ends here |