aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-07-24 11:09:35 +0000
committerGerd Moellmann2000-07-24 11:09:35 +0000
commite96f5cb7478070e9c91b503d6d3e881ec2ce7dd7 (patch)
tree08d5b26b6c21d0d28c85cf5f121f8fb3fe45ed3d
parentafe93d01f211ba3361de1a7caa9f435f7fab722d (diff)
downloademacs-e96f5cb7478070e9c91b503d6d3e881ec2ce7dd7.tar.gz
emacs-e96f5cb7478070e9c91b503d6d3e881ec2ce7dd7.zip
(c-style-variables-are-local-p): Incompatible
change by defaulting this to t. It's motivated by the confusing behavior that otherwise arise from the style system when editing both java and non-java files at the same time (see the comments about style setting in c-common-init). (c-offsets-alist): Changed default for member-init-cont to c-lineup-multi-inher since it now handles member initializers and indents better for leading commas. (c-syntactic-indentation): New variable to turn off all syntactic indentation. (c-special-indent-hook): Don't use set-from-style on this.
-rw-r--r--lisp/progmodes/cc-vars.el42
1 files changed, 31 insertions, 11 deletions
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index 25608653c9e..a5cde4e96ba 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -1,8 +1,9 @@
1;;; cc-vars.el --- user customization variables for CC Mode 1;;; cc-vars.el --- user customization variables for CC Mode
2 2
3;; Copyright (C) 1985,1987,1992-1999 Free Software Foundation, Inc. 3;; Copyright (C) 1985,1987,1992-2000 Free Software Foundation, Inc.
4 4
5;; Authors: 1998-1999 Barry A. Warsaw and Martin Stjernholm 5;; Authors: 2000- Martin Stjernholm
6;; 1998-1999 Barry A. Warsaw and Martin Stjernholm
6;; 1992-1997 Barry A. Warsaw 7;; 1992-1997 Barry A. Warsaw
7;; 1987 Dave Detlefs and Stewart Clamen 8;; 1987 Dave Detlefs and Stewart Clamen
8;; 1985 Richard M. Stallman 9;; 1985 Richard M. Stallman
@@ -156,7 +157,9 @@ syntactic symbols in `c-offsets-alist'. Please keep it set to nil."
156 :group 'c) 157 :group 'c)
157 158
158(defcustom-c-stylevar c-basic-offset 4 159(defcustom-c-stylevar c-basic-offset 4
159 "*Amount of basic offset used by + and - symbols in `c-offsets-alist'." 160 "*Amount of basic offset used by + and - symbols in `c-offsets-alist'.
161Also used as the indentation step when `c-syntactic-indentation' is
162nil."
160 :type 'integer 163 :type 'integer
161 :group 'c) 164 :group 'c)
162 165
@@ -185,12 +188,26 @@ by the `c-comment-only-line-offset' variable."
185 :group 'c) 188 :group 'c)
186 189
187(defcustom c-insert-tab-function 'insert-tab 190(defcustom c-insert-tab-function 'insert-tab
188 "*Function used when inserting a tab for \\[TAB]. 191 "*Function used when inserting a tab for \\[c-indent-command].
189Only used when `c-tab-always-indent' indicates a `real' tab character 192Only used when `c-tab-always-indent' indicates a `real' tab character
190should be inserted. Value must be a function taking no arguments." 193should be inserted. Value must be a function taking no arguments."
191 :type 'function 194 :type 'function
192 :group 'c) 195 :group 'c)
193 196
197(defcustom c-syntactic-indentation t
198 "*Whether the identation should be controlled by the syntactic context.
199
200If t, the indentation functions indents according to the syntactic
201context, using the style settings specified by `c-offsets-alist'.
202
203If nil, every line is just indented to the same level as the previous
204one, and the \\[c-indent-command] command adjusts the indentation in steps
205specified by `c-basic-offset'. The indentation style have no effect
206in this mode, nor any of the indentation associated variables,
207e.g. `c-special-indent-hook'."
208 :type 'boolean
209 :group 'c)
210
194(defcustom-c-stylevar c-comment-only-line-offset 0 211(defcustom-c-stylevar c-comment-only-line-offset 0
195 "*Extra offset for line which contains only the start of a comment. 212 "*Extra offset for line which contains only the start of a comment.
196Can contain an integer or a cons cell of the form: 213Can contain an integer or a cons cell of the form:
@@ -509,7 +526,7 @@ want to set `c-style-variables-are-local-p'."
509 :type '(radio 526 :type '(radio
510 (string :tag "Style in all modes (except Java)") 527 (string :tag "Style in all modes (except Java)")
511 (repeat :tag "Mode-specific styles" 528 (repeat :tag "Mode-specific styles"
512 :value ((other . "user")) 529 :value ((other . "gnu"))
513 (cons :format "%v" 530 (cons :format "%v"
514 (choice :tag "Mode" 531 (choice :tag "Mode"
515 (const c-mode) (const c++-mode) 532 (const c-mode) (const c++-mode)
@@ -555,7 +572,7 @@ want to set `c-style-variables-are-local-p'."
555 ;; Relpos: Boi at the topmost intro line. 572 ;; Relpos: Boi at the topmost intro line.
556 (member-init-intro . +) 573 (member-init-intro . +)
557 ;; Relpos: Boi at the func decl arglist open. 574 ;; Relpos: Boi at the func decl arglist open.
558 (member-init-cont . 0) 575 (member-init-cont . c-lineup-multi-inher)
559 ;; Relpos: Beg of the first member init. 576 ;; Relpos: Beg of the first member init.
560 (inher-intro . +) 577 (inher-intro . +)
561 ;; Relpos: Java: Boi at the class decl start. Otherwise: Boi 578 ;; Relpos: Java: Boi at the class decl start. Otherwise: Boi
@@ -628,20 +645,23 @@ want to set `c-style-variables-are-local-p'."
628 (comment-intro . c-lineup-comment) 645 (comment-intro . c-lineup-comment)
629 ;; Relpos: None. 646 ;; Relpos: None.
630 (arglist-intro . +) 647 (arglist-intro . +)
631 ;; Relpos: Boi at the open paren. 648 ;; Relpos: Boi at the open paren, or at the first non-ws after
649 ;; the open paren of the surrounding sexp, whichever is later.
632 (arglist-cont . 0) 650 (arglist-cont . 0)
633 ;; Relpos: At the first token after the open paren. 651 ;; Relpos: At the first token after the open paren.
634 (arglist-cont-nonempty . c-lineup-arglist) 652 (arglist-cont-nonempty . c-lineup-arglist)
635 ;; Relpos: Boi at the open paren. 653 ;; Relpos: Boi at the open paren, or at the first non-ws after
654 ;; the open paren of the surrounding sexp, whichever is later.
636 (arglist-close . +) 655 (arglist-close . +)
637 ;; Relpos: Boi at the open paren. 656 ;; Relpos: Boi at the open paren, or at the first non-ws after
657 ;; the open paren of the surrounding sexp, whichever is later.
638 (stream-op . c-lineup-streamop) 658 (stream-op . c-lineup-streamop)
639 ;; Relpos: Boi at the first stream op in the statement. 659 ;; Relpos: Boi at the first stream op in the statement.
640 (inclass . +) 660 (inclass . +)
641 ;; Relpos: At the class open brace if it's at boi, otherwise 661 ;; Relpos: At the class open brace if it's at boi, otherwise
642 ;; boi at the class decl start. 662 ;; boi at the class decl start.
643 (cpp-macro . -1000) 663 (cpp-macro . -1000)
644 ;; Relpos: Boi. 664 ;; Relpos: None.
645 (cpp-macro-cont . c-lineup-dont-change) 665 (cpp-macro-cont . c-lineup-dont-change)
646 ;; Relpos: At the macro start (always at boi). 666 ;; Relpos: At the macro start (always at boi).
647 (friend . 0) 667 (friend . 0)
@@ -826,7 +846,7 @@ Here is the current list of valid syntactic element symbols:
826 (get 'c-offsets-alist 'c-stylevar-fallback))) 846 (get 'c-offsets-alist 'c-stylevar-fallback)))
827 :group 'c) 847 :group 'c)
828 848
829(defcustom c-style-variables-are-local-p nil 849(defcustom c-style-variables-are-local-p t
830 "*Whether style variables should be buffer local by default. 850 "*Whether style variables should be buffer local by default.
831If non-nil, then all indentation style related variables will be made 851If non-nil, then all indentation style related variables will be made
832buffer local by default. If nil, they will remain global. Variables 852buffer local by default. If nil, they will remain global. Variables