/[emacs]/emacs/lisp/progmodes/cc-vars.el
ViewVC logotype

Diff of /emacs/lisp/progmodes/cc-vars.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.41 by nickrob, Mon Aug 1 08:37:48 2005 UTC revision 1.42 by acmacm, Fri Dec 2 12:30:36 2005 UTC
# Line 1  Line 1 
1  ;;; cc-vars.el --- user customization variables for CC Mode  ;;; cc-vars.el --- user customization variables for CC Mode
2    
3  ;; Copyright (C) 1985,1987,1992-2003, 2004, 2005 Free Software Foundation, Inc.  ;; Copyright (C) 1985,1987,1992-2003, 2004, 2005 Free Software
4    ;; Foundation, Inc.
5    
6  ;; Authors:    1998- Martin Stjernholm  ;; Authors:    1998- Martin Stjernholm
7  ;;             1992-1999 Barry A. Warsaw  ;;             1992-1999 Barry A. Warsaw
# Line 24  Line 25 
25  ;; GNU General Public License for more details.  ;; GNU General Public License for more details.
26    
27  ;; You should have received a copy of the GNU General Public License  ;; You should have received a copy of the GNU General Public License
28  ;; along with GNU Emacs; see the file COPYING.  If not, write to  ;; along with this program; see the file COPYING.  If not, write to
29  ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,  ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
30  ;; Boston, MA 02110-1301, USA.  ;; Boston, MA 02110-1301, USA.
31    
# Line 43  Line 44 
44  (cc-require 'cc-defs)  (cc-require 'cc-defs)
45    
46  ;; Silence the compiler.  ;; Silence the compiler.
47  (cc-bytecomp-defun get-char-table)      ; XEmacs 20+  (cc-bytecomp-defun get-char-table)      ; XEmacs
48  (cc-bytecomp-defun char-table-range)    ; Emacs 19+  
49  (cc-bytecomp-defun char-table-p)        ; Emacs 19+, XEmacs 20+  (cc-eval-when-compile
50      (require 'custom)
51  ;; Pull in custom if it exists and is recent enough (the one in Emacs    (require 'widget))
 ;; 19.34 isn't).  
 (eval  
  (cc-eval-when-compile  
    (condition-case nil  
        (progn  
          (require 'custom)  
          (or (fboundp 'defcustom) (error ""))  
          (require 'widget)  
          '(progn                        ; Compile in the require's.  
             (require 'custom)  
             (require 'widget)))  
      (error  
       (message "Warning: Compiling without Customize support \  
 since a (good enough) custom library wasn't found")  
       (cc-bytecomp-defmacro define-widget (name class doc &rest args))  
       (cc-bytecomp-defmacro defgroup (symbol members doc &rest args))  
       (cc-bytecomp-defmacro defcustom (symbol value doc &rest args)  
         `(defvar ,symbol ,value ,doc))  
       (cc-bytecomp-defmacro custom-declare-variable (symbol value doc  
                                                      &rest args)  
         `(defvar ,(eval symbol) ,(eval value) ,doc))  
       nil))))  
52    
53  (cc-eval-when-compile  (cc-eval-when-compile
54    ;; Need the function form of `backquote', which isn't standardized    ;; Need the function form of `backquote', which isn't standardized
# Line 207  the value set here overrides the style s Line 186  the value set here overrides the style s
186  (defun c-valid-offset (offset)  (defun c-valid-offset (offset)
187    "Return non-nil iff OFFSET is a valid offset for a syntactic symbol.    "Return non-nil iff OFFSET is a valid offset for a syntactic symbol.
188  See `c-offsets-alist'."  See `c-offsets-alist'."
   ;; This function does not do any hidden buffer changes.  
189    (or (eq offset '+)    (or (eq offset '+)
190        (eq offset '-)        (eq offset '-)
191        (eq offset '++)        (eq offset '++)
# Line 216  See `c-offsets-alist'." Line 194  See `c-offsets-alist'."
194        (eq offset '/)        (eq offset '/)
195        (integerp offset)        (integerp offset)
196        (functionp offset)        (functionp offset)
197        (and (symbolp offset)        (and (symbolp offset) (boundp offset))
            (or (boundp offset)  
                (fboundp offset)))  
198        (and (vectorp offset)        (and (vectorp offset)
199             (= (length offset) 1)             (= (length offset) 1)
200             (integerp (elt offset 0)))             (integerp (elt offset 0)))
201        (progn        (and (consp offset)
202          (while (and (consp offset)             (not (eq (car offset) 'quote)) ; Detect misquoted lists.
203                      (c-valid-offset (car offset)))             (progn
204            (setq offset (cdr offset)))               (when (memq (car offset) '(first min max add))
205          (null offset))))                 (setq offset (cdr offset)))
206                 (while (and (consp offset)
207                             (c-valid-offset (car offset)))
208                   (setq offset (cdr offset)))
209                 (null offset)))))
210    
211    
212    
# Line 311  effect in this mode, nor any of the inde Line 291  effect in this mode, nor any of the inde
291  e.g. `c-special-indent-hook'."  e.g. `c-special-indent-hook'."
292    :type 'boolean    :type 'boolean
293    :group 'c)    :group 'c)
294    (make-variable-buffer-local 'c-syntactic-indentation)
295    
296  (defcustom c-syntactic-indentation-in-macros t  (defcustom c-syntactic-indentation-in-macros t
297    "*Enable syntactic analysis inside macros.    "*Enable syntactic analysis inside macros.
# Line 470  style comments." Line 451  style comments."
451    
452  (defcustom-c-stylevar c-comment-prefix-regexp  (defcustom-c-stylevar c-comment-prefix-regexp
453    '((pike-mode . "//+!?\\|\\**")    '((pike-mode . "//+!?\\|\\**")
454        (awk-mode . "#+")
455      (other . "//+\\|\\**"))      (other . "//+\\|\\**"))
456    "*Regexp to match the line prefix inside comments.    "*Regexp to match the line prefix inside comments.
457  This regexp is used to recognize the fill prefix inside comments for  This regexp is used to recognize the fill prefix inside comments for
# Line 517  variable in a mode hook." Line 499  variable in a mode hook."
499              (cons :format "%v"              (cons :format "%v"
500                    (const :format "IDL   " idl-mode) (regexp :format "%v"))                    (const :format "IDL   " idl-mode) (regexp :format "%v"))
501              (cons :format "%v"              (cons :format "%v"
502                    (const :format "Pike  " pike-mode) (regexp :format "%v")))                    (const :format "Pike  " pike-mode) (regexp :format "%v"))
503                (cons :format "%v"
504                      (const :format "AWK   " awk-mode) (regexp :format "%v")))
505             (cons :format "    %v"             (cons :format "    %v"
506                   (const :format "Other " other) (regexp :format "%v"))))                   (const :format "Other " other) (regexp :format "%v"))))
507    :group 'c)    :group 'c)
508    
509  (defcustom-c-stylevar c-doc-comment-style  (defcustom-c-stylevar c-doc-comment-style
510    '((java-mode . javadoc)    '((java-mode . javadoc)
511      (pike-mode . autodoc))      (pike-mode . autodoc)
512        (c-mode    . gtkdoc))
513    "*Specifies documentation comment style(s) to recognize.    "*Specifies documentation comment style(s) to recognize.
514  This is primarily used to fontify doc comments and the markup within  This is primarily used to fontify doc comments and the markup within
515  them, e.g. Javadoc comments.  them, e.g. Javadoc comments.
# Line 534  comment styles: Line 519  comment styles:
519    
520   javadoc -- Javadoc style for \"/** ... */\" comments (default in Java mode).   javadoc -- Javadoc style for \"/** ... */\" comments (default in Java mode).
521   autodoc -- Pike autodoc style for \"//! ...\" comments (default in Pike mode).   autodoc -- Pike autodoc style for \"//! ...\" comments (default in Pike mode).
522     gtkdoc  -- GtkDoc style for \"/** ... **/\" comments (default in C mode).
523    
524  The value may also be a list of doc comment styles, in which case all  The value may also be a list of doc comment styles, in which case all
525  of them are recognized simultaneously (presumably with markup cues  of them are recognized simultaneously (presumably with markup cues
# Line 586  afterwards to redo that work." Line 572  afterwards to redo that work."
572                    (const :format "Pike  " pike-mode)                    (const :format "Pike  " pike-mode)
573                    (c-symbol-list :format "%v"))                    (c-symbol-list :format "%v"))
574              (cons :format "%v"              (cons :format "%v"
575                      (const :format "AWK   " awk-mode)
576                      (c-symbol-list :format "%v"))
577                (cons :format "%v"
578                    (const :format "Other " other)                    (const :format "Other " other)
579                    (c-symbol-list :format "%v")))))                    (c-symbol-list :format "%v")))))
580    :group 'c)    :group 'c)
# Line 613  contexts are: Line 602  contexts are:
602  (defcustom-c-stylevar c-cleanup-list '(scope-operator)  (defcustom-c-stylevar c-cleanup-list '(scope-operator)
603    "*List of various C/C++/ObjC constructs to \"clean up\".    "*List of various C/C++/ObjC constructs to \"clean up\".
604  The following clean ups only take place when the auto-newline feature  The following clean ups only take place when the auto-newline feature
605  is turned on, as evidenced by the `/a' or `/ah' appearing next to the  is turned on, as evidenced by the `/la' appearing next to the mode
606  mode name:  name:
607    
608   brace-else-brace    -- Clean up \"} else {\" constructs by placing   brace-else-brace    -- Clean up \"} else {\" constructs by placing
609                          entire construct on a single line.  This clean                          entire construct on a single line.  This clean
# Line 630  mode name: Line 619  mode name:
619                          \"} catch (...) {\" constructs.                          \"} catch (...) {\" constructs.
620   empty-defun-braces  -- Clean up empty defun braces by placing the   empty-defun-braces  -- Clean up empty defun braces by placing the
621                          braces on the same line.  Clean up occurs when                          braces on the same line.  Clean up occurs when
622                          the defun closing brace is typed.                          the defun closing brace is typed.
623     one-liner-defun     -- If the code inside a function body is a single
624                            line then remove any newlines between that
625                            line and the defun braces so that the whole
626                            body becomes a single line.
627                            `c-max-one-liner-length' gives the maximum
628                            length allowed for the resulting line.  Clean
629                            up occurs when the closing brace is typed.
630   defun-close-semi    -- Clean up the terminating semi-colon on defuns   defun-close-semi    -- Clean up the terminating semi-colon on defuns
631                          by placing the semi-colon on the same line as                          by placing the semi-colon on the same line as
632                          the closing brace.  Clean up occurs when the                          the closing brace.  Clean up occurs when the
633                          semi-colon is typed.                          semi-colon is typed.
634   list-close-comma    -- Clean up commas following braces in array   list-close-comma    -- Clean up commas following braces in array
635                          and aggregate initializers.  Clean up occurs                          and aggregate initializers.  Clean up occurs
636                          when the comma is typed.                          when the comma is typed.
637   scope-operator      -- Clean up double colons which may designate   scope-operator      -- Clean up double colons which may designate
638                          a C++ scope operator split across multiple                          a C++ scope operator split across multiple
639                          lines.  Note that certain C++ constructs can                          lines.  Note that certain C++ constructs can
640                          generate ambiguous situations.  This clean up                          generate ambiguous situations.  This clean up
641                          only takes place when there is nothing but                          only takes place when there is nothing but
642                          whitespace between colons.  Clean up occurs                          whitespace between colons.  Clean up occurs
643                          when the second colon is typed.                          when the second colon is typed.
644    
645  The following clean ups always take place when they are on this list,  The following clean ups always take place when they are on this list,
646  regardless of the auto-newline feature, since they typically don't  regardless of the auto-newline feature, since they typically don't
# Line 654  involve auto-newline inserted newlines: Line 650  involve auto-newline inserted newlines:
650                          parenthesis of a function call.  Clean up                          parenthesis of a function call.  Clean up
651                          occurs when the opening parenthesis is typed.                          occurs when the opening parenthesis is typed.
652   compact-empty-funcall -- Clean up any space before the function call   compact-empty-funcall -- Clean up any space before the function call
653                          opening parenthesis if and only if the                          opening parenthesis if and only if the
654                          argument list is empty.  This is typically                          argument list is empty.  This is typically
655                          useful together with `space-before-funcall' to                          useful together with `space-before-funcall' to
656                          get the style \"foo (bar)\" and \"foo()\".                          get the style \"foo (bar)\" and \"foo()\".
657                          Clean up occurs when the closing parenthesis                          Clean up occurs when the closing parenthesis
658                          is typed."                          is typed.
659     comment-close-slash -- When a slash is typed after the comment prefix
660                            on a bare line in a c-style comment, the comment
661                            is closed by cleaning up preceding space and
662                            inserting a star if needed."
663    :type '(set    :type '(set
664            (const :tag "Put \"} else {\" on one line"            (const :tag "Put \"} else {\" on one line (brace-else-brace)"
665                   brace-else-brace)                   brace-else-brace)
666            (const :tag "Put \"} else if (...) {\" on one line"            (const :tag "Put \"} else if (...) {\" on one line (brace-elseif-brace)"
667                   brace-elseif-brace)                   brace-elseif-brace)
668            (const :tag "Put \"} catch (...) {\" on one line"            (const :tag "Put \"} catch (...) {\" on one line (brace-catch-brace)"
669                   brace-catch-brace)                   brace-catch-brace)
670            (const :tag "Put empty defun braces on one line"            (const :tag "Put empty defun braces on one line (empty-defun-braces)"
671                   empty-defun-braces)                   empty-defun-braces)
672            (const :tag "Put \"};\" ending defuns on one line"            (const :tag "Put short function bodies on one line (one-liner-defun)"
673                     one-liner-defun)
674              (const :tag "Put \"};\" ending defuns on one line (defun-close-semi)"
675                   defun-close-semi)                   defun-close-semi)
676            (const :tag "Put \"},\" in aggregates on one line"            (const :tag "Put \"},\" in aggregates on one line (list-close-comma)"
677                   list-close-comma)                   list-close-comma)
678            (const :tag "Put C++ style \"::\" on one line"            (const :tag "Put C++ style \"::\" on one line (scope-operator)"
679                   scope-operator)                   scope-operator)
680            (const :tag "Put a space before funcall parens, e.g. \"foo (bar)\""            (const :tag "Put a space before funcall parens, e.g. \"foo (bar)\" (space-before-funcall)"
681                   space-before-funcall)                   space-before-funcall)
682            (const :tag "Remove space before empty funcalls, e.g. \"foo()\""            (const :tag "Remove space before empty funcalls, e.g. \"foo()\" (compact-empty-funcall)"
683                   compact-empty-funcall))                   compact-empty-funcall)
684              (const :tag "Make / on a bare line of a C-style comment close it (comment-close-slash)"
685                     comment-close-slash))
686    :group 'c)    :group 'c)
687    
688  (defcustom-c-stylevar c-hanging-braces-alist '((brace-list-open)  (defcustom-c-stylevar c-hanging-braces-alist '((brace-list-open)
# Line 751  syntactic context for the brace line." Line 755  syntactic context for the brace line."
755                inexpr-class-open inexpr-class-close)))                inexpr-class-open inexpr-class-close)))
756      :group 'c)      :group 'c)
757    
758    (defcustom c-max-one-liner-length 80
759      "Maximum length of line that clean-up \"one-liner-defun\" will compact to.
760    Zero or nil means no limit."
761      :type 'integer
762      :group 'c)
763    
764  (defcustom-c-stylevar c-hanging-colons-alist nil  (defcustom-c-stylevar c-hanging-colons-alist nil
765    "*Controls the insertion of newlines before and after certain colons.    "*Controls the insertion of newlines before and after certain colons.
766  This variable contains an association list with elements of the  This variable contains an association list with elements of the
# Line 832  space." Line 842  space."
842    :group 'c)    :group 'c)
843    
844  (defcustom c-require-final-newline  (defcustom c-require-final-newline
845    ;; C and C++ mandates that all nonempty files should end with a    ;; C and C++ mandate that all nonempty files should end with a
846    ;; newline.  Objective-C refers to C for all things it doesn't    ;; newline.  Objective-C refers to C for all things it doesn't
847    ;; specify, so the same holds there.  The other languages does not    ;; specify, so the same holds there.  The other languages do not
848    ;; require it (at least not explicitly in a normative text).    ;; require it (at least not explicitly in a normative text).
849    '((c-mode    . t)    '((c-mode    . t)
850      (c++-mode  . t)      (c++-mode  . t)
851      (objc-mode . t))      (objc-mode . t))
852    "*Controls `require-final-newline' in C-related major modes.    "*Controls whether a final newline is ensured when the file is saved.
853  The value is an association list specifying, for each specific mode,  The value is an association list that for each language mode specifies
854  whether to override `require-final-newline'.  If the cdr of the element  the value to give to `require-final-newline' at mode initialization;
855  is non-nil, that means to use `mode-require-final-newline' instead."  see that variable for details about the value.  If a language isn't
856    present on the association list, CC Mode won't touch
857    `require-final-newline' in buffers for that language."
858    :type `(set (cons :format "%v"    :type `(set (cons :format "%v"
859                      (const :format "C     " c-mode)                      (const :format "C     " c-mode)
860                      (const t))                      (symbol :format "%v" :value ,require-final-newline))
861                (cons :format "%v"                (cons :format "%v"
862                      (const :format "C++   " c++-mode)                      (const :format "C++   " c++-mode)
863                      (const t))                      (symbol :format "%v" :value ,require-final-newline))
864                (cons :format "%v"                (cons :format "%v"
865                      (const :format "ObjC  " objc-mode)                      (const :format "ObjC  " objc-mode)
866                      (const t))                      (symbol :format "%v" :value ,require-final-newline))
867                (cons :format "%v"                (cons :format "%v"
868                      (const :format "Java  " java-mode)                      (const :format "Java  " java-mode)
869                      (const t))                      (symbol :format "%v" :value ,require-final-newline))
870                (cons :format "%v"                (cons :format "%v"
871                      (const :format "IDL   " idl-mode)                      (const :format "IDL   " idl-mode)
872                      (const t))                      (symbol :format "%v" :value ,require-final-newline))
873                (cons :format "%v"                (cons :format "%v"
874                      (const :format "Pike  " pike-mode)                      (const :format "Pike  " pike-mode)
875                      (const t)))                      (symbol :format "%v" :value ,require-final-newline))
876                  (cons :format "%v"
877                        (const :format "AWK   " awk-mode)
878                        (symbol :format "%v" :value ,require-final-newline)))
879    :group 'c)    :group 'c)
880    
881  (defcustom c-electric-pound-behavior nil  (defcustom c-electric-pound-behavior nil
# Line 892  this variable to nil." Line 907  this variable to nil."
907    :type 'integer    :type 'integer
908    :group 'c)    :group 'c)
909    
910  (defcustom c-default-style '((java-mode . "java") (other . "gnu"))  (defcustom c-default-style '((java-mode . "java") (awk-mode . "awk")
911                                 (other . "gnu"))
912    "*Style which gets installed by default when a file is visited.    "*Style which gets installed by default when a file is visited.
913    
914  The value of this variable can be any style defined in  The value of this variable can be any style defined in
# Line 927  can always override the use of `c-defaul Line 943  can always override the use of `c-defaul
943              (cons :format "%v"              (cons :format "%v"
944                    (const :format "Pike  " pike-mode) (string :format "%v"))                    (const :format "Pike  " pike-mode) (string :format "%v"))
945              (cons :format "%v"              (cons :format "%v"
946                      (const :format "AWK   " awk-mode) (string :format "%v"))
947                (cons :format "%v"
948                    (const :format "Other " other) (string :format "%v"))))                    (const :format "Other " other) (string :format "%v"))))
949    :group 'c)    :group 'c)
950    
# Line 939  can always override the use of `c-defaul Line 957  can always override the use of `c-defaul
957  ;; symbol and continue searching.  ;; symbol and continue searching.
958  (c-set-stylevar-fallback 'c-offsets-alist  (c-set-stylevar-fallback 'c-offsets-alist
959       '((string                . c-lineup-dont-change)       '((string                . c-lineup-dont-change)
960         ;; Relpos: Beg of previous line.         ;; Anchor pos: Beg of previous line.
961         (c                     . c-lineup-C-comments)         (c                     . c-lineup-C-comments)
962         ;; Relpos: Beg of the comment.         ;; Anchor pos: Beg of the comment.
963         (defun-open            . 0)         (defun-open            . 0)
964         ;; Relpos: When inside a class: Boi at the func decl start.         ;; Anchor pos: When inside a class: Boi at the func decl start.
965         ;; When at top level: Bol at the func decl start.  When inside         ;; When at top level: Bol at the func decl start.  When inside
966         ;; a code block (only possible in Pike): At the func decl         ;; a code block (only possible in Pike): At the func decl
967         ;; start(*).         ;; start(*).
968         (defun-close           . 0)         (defun-close           . 0)
969         ;; Relpos: At the defun block open if it's at boi, otherwise         ;; Anchor pos: At the defun block open if it's at boi,
970         ;; boi at the func decl start.         ;; otherwise boi at the func decl start.
971         (defun-block-intro     . +)         (defun-block-intro     . +)
972         ;; Relpos: At the block open(*).         ;; Anchor pos: At the block open(*).
973         (class-open            . 0)         (class-open            . 0)
974         ;; Relpos: Boi at the class decl start.         ;; Anchor pos: Boi at the class decl start.
975         (class-close           . 0)         (class-close           . 0)
976         ;; Relpos: Boi at the class decl start.         ;; Anchor pos: Boi at the class decl start.
977         (inline-open           . +)         (inline-open           . +)
978         ;; Relpos: None for functions (inclass got the relpos then),         ;; Anchor pos: None for functions (inclass got the relpos
979         ;; boi at the lambda start for lambdas.         ;; then), boi at the lambda start for lambdas.
980         (inline-close          . 0)         (inline-close          . 0)
981         ;; Relpos: Inexpr functions: At the lambda block open if it's         ;; Anchor pos: Inexpr functions: At the lambda block open if
982         ;; at boi, else at the statement(*) at boi of the start of the         ;; it's at boi, else at the statement(*) at boi of the start of
983         ;; lambda construct.  Otherwise: At the inline block open if         ;; the lambda construct.  Otherwise: At the inline block open
984         ;; it's at boi, otherwise boi at the func decl start.         ;; if it's at boi, otherwise boi at the func decl start.
985         (func-decl-cont        . +)         (func-decl-cont        . +)
986         ;; Relpos: Boi at the func decl start.         ;; Anchor pos: Boi at the func decl start.
987         (knr-argdecl-intro     . +)         (knr-argdecl-intro     . +)
988         ;; Relpos: Boi at the topmost intro line.         ;; Anchor pos: Boi at the topmost intro line.
989         (knr-argdecl           . 0)         (knr-argdecl           . 0)
990         ;; Relpos: At the beginning of the first K&R argdecl.         ;; Anchor pos: At the beginning of the first K&R argdecl.
991         (topmost-intro         . 0)         (topmost-intro         . 0)
992         ;; Relpos: Bol at the last line of previous construct.         ;; Anchor pos: Bol at the last line of previous construct.
993         (topmost-intro-cont    . c-lineup-topmost-intro-cont)         (topmost-intro-cont    . c-lineup-topmost-intro-cont)
994         ;; Relpos: Boi at the topmost intro line.         ;; Anchor pos: Boi at the topmost intro line.
995         (member-init-intro     . +)         (member-init-intro     . +)
996         ;; Relpos: Boi at the func decl arglist open.         ;; Anchor pos: Boi at the func decl arglist open.
997         (member-init-cont      . c-lineup-multi-inher)         (member-init-cont      . c-lineup-multi-inher)
998         ;; Relpos: Beg of the first member init.         ;; Anchor pos: Beg of the first member init.
999         (inher-intro           . +)         (inher-intro           . +)
1000         ;; Relpos: Boi at the class decl start.         ;; Anchor pos: Boi at the class decl start.
1001         (inher-cont            . c-lineup-multi-inher)         (inher-cont            . c-lineup-multi-inher)
1002         ;; Relpos: Java: At the implements/extends keyword start.         ;; Anchor pos: Java: At the implements/extends keyword start.
1003         ;; Otherwise: At the inher start colon, or boi at the class         ;; Otherwise: At the inher start colon, or boi at the class
1004         ;; decl start if the first inherit clause hangs and it's not a         ;; decl start if the first inherit clause hangs and it's not a
1005         ;; func-local inherit clause (when does that occur?).         ;; func-local inherit clause (when does that occur?).
1006         (block-open            . 0)         (block-open            . 0)
1007         ;; Relpos: Inexpr statement: At the statement(*) at boi of the         ;; Anchor pos: Inexpr statement: At the statement(*) at boi of
1008         ;; start of the inexpr construct.  Otherwise: None.         ;; the start of the inexpr construct.  Otherwise: None.
1009         (block-close           . 0)         (block-close           . 0)
1010         ;; Relpos: Inexpr statement: At the inexpr block open if it's         ;; Anchor pos: Inexpr statement: At the inexpr block open if
1011         ;; at boi, else at the statement(*) at boi of the start of the         ;; it's at boi, else at the statement(*) at boi of the start of
1012         ;; inexpr construct.  Block hanging on a case/default label: At         ;; the inexpr construct.  Block hanging on a case/default
1013         ;; the closest preceding label that starts at boi.  Otherwise:         ;; label: At the closest preceding label that starts at boi.
1014         ;; At the block open(*).         ;; Otherwise: At the block open(*).
1015         (brace-list-open       . 0)         (brace-list-open       . 0)
1016         ;; Relpos: Boi at the brace list decl start, but a starting         ;; Anchor pos: Boi at the brace list decl start, but a starting
1017         ;; "typedef" token is ignored.         ;; "typedef" token is ignored.
1018         (brace-list-close      . 0)         (brace-list-close      . 0)
1019         ;; Relpos: At the brace list decl start(*).         ;; Anchor pos: At the brace list decl start(*).
1020         (brace-list-intro      . +)         (brace-list-intro      . +)
1021         ;; Relpos: At the brace list decl start(*).         ;; Anchor pos: At the brace list decl start(*).
1022         (brace-list-entry      . 0)         (brace-list-entry      . 0)
1023         ;; Relpos: At the first non-ws char after the open paren if the         ;; Anchor pos: At the first non-ws char after the open paren if
1024         ;; first token is on the same line, otherwise boi at that         ;; the first token is on the same line, otherwise boi at that
1025         ;; token.         ;; token.
1026         (brace-entry-open      . 0)         (brace-entry-open      . 0)
1027         ;; Relpos: Same as brace-list-entry.         ;; Anchor pos: Same as brace-list-entry.
1028         (statement             . 0)         (statement             . 0)
1029         ;; Relpos: After a `;' in the condition clause of a for         ;; Anchor pos: After a `;' in the condition clause of a for
1030         ;; statement: At the first token after the starting paren.         ;; statement: At the first token after the starting paren.
1031         ;; Otherwise: At the preceding statement(*).         ;; Otherwise: At the preceding statement(*).
1032         (statement-cont        . +)         (statement-cont        . +)
1033         ;; Relpos: After the first token in the condition clause of a         ;; Anchor pos: After the first token in the condition clause of
1034         ;; for statement: At the first token after the starting paren.         ;; a for statement: At the first token after the starting
1035         ;; Otherwise: At the containing statement(*).         ;; paren.  Otherwise: At the containing statement(*).
1036         (statement-block-intro . +)         (statement-block-intro . +)
1037         ;; Relpos: In inexpr statement block: At the inexpr block open         ;; Anchor pos: In inexpr statement block: At the inexpr block
1038         ;; if it's at boi, else at the statement(*) at boi of the start         ;; open if it's at boi, else at the statement(*) at boi of the
1039         ;; of the inexpr construct.  In a block hanging on a         ;; start of the inexpr construct.  In a block hanging on a
1040         ;; case/default label: At the closest preceding label that         ;; case/default label: At the closest preceding label that
1041         ;; starts at boi.  Otherwise: At the start of the containing         ;; starts at boi.  Otherwise: At the start of the containing
1042         ;; block(*).         ;; block(*).
1043         (statement-case-intro  . +)         (statement-case-intro  . +)
1044         ;; Relpos: At the case/default label(*).         ;; Anchor pos: At the case/default label(*).
1045         (statement-case-open   . 0)         (statement-case-open   . 0)
1046         ;; Relpos: At the case/default label(*).         ;; Anchor pos: At the case/default label(*).
1047         (substatement          . +)         (substatement          . +)
1048         ;; Relpos: At the containing statement(*).         ;; Anchor pos: At the containing statement(*).
1049         (substatement-open     . +)         (substatement-open     . +)
1050         ;; Relpos: At the containing statement(*).         ;; Anchor pos: At the containing statement(*).
1051         (substatement-label    . 2)         (substatement-label    . 2)
1052         ;; Relpos: At the containing statement(*).         ;; Anchor pos: At the containing statement(*).
1053         (case-label            . 0)         (case-label            . 0)
1054         ;; Relpos: At the start of the switch block(*).         ;; Anchor pos: At the start of the switch block(*).
1055         (access-label          . -)         (access-label          . -)
1056         ;; Relpos: Same as inclass.         ;; Anchor pos: Same as inclass.
1057         (label                 . 2)         (label                 . 2)
1058         ;; Relpos: At the start of the containing block(*).         ;; Anchor pos: At the start of the containing block(*).
1059         (do-while-closure      . 0)         (do-while-closure      . 0)
1060         ;; Relpos: At the corresponding while statement(*).         ;; Anchor pos: At the corresponding while statement(*).
1061         (else-clause           . 0)         (else-clause           . 0)
1062         ;; Relpos: At the corresponding if statement(*).         ;; Anchor pos: At the corresponding if statement(*).
1063         (catch-clause          . 0)         (catch-clause          . 0)
1064         ;; Relpos: At the previous try or catch statement clause(*).         ;; Anchor pos: At the previous try or catch statement clause(*).
1065         (comment-intro         . (c-lineup-knr-region-comment c-lineup-comment))         (comment-intro         . (c-lineup-knr-region-comment c-lineup-comment))
1066         ;; Relpos: None.         ;; Anchor pos: None.
1067         (arglist-intro         . +)         (arglist-intro         . +)
1068         ;; Relpos: Boi at the open paren, or at the first non-ws after         ;; Anchor pos: At the containing statement(*).
1069         ;; the open paren of the surrounding sexp, whichever is later.         ;; 2nd pos: At the open paren.
1070         (arglist-cont          . (c-lineup-gcc-asm-reg 0))         (arglist-cont          . (c-lineup-gcc-asm-reg 0))
1071         ;; Relpos: At the first token after the open paren.         ;; Anchor pos: At the first token after the open paren.
1072         (arglist-cont-nonempty . (c-lineup-gcc-asm-reg c-lineup-arglist))         (arglist-cont-nonempty . (c-lineup-gcc-asm-reg c-lineup-arglist))
1073         ;; Relpos: At the containing statement(*).         ;; Anchor pos: At the containing statement(*).
1074         ;; 2nd pos: At the open paren.         ;; 2nd pos: At the open paren.
1075         (arglist-close         . +)         (arglist-close         . +)
1076         ;; Relpos: At the containing statement(*).         ;; Anchor pos: At the containing statement(*).
1077         ;; 2nd pos: At the open paren.         ;; 2nd pos: At the open paren.
1078         (stream-op             . c-lineup-streamop)         (stream-op             . c-lineup-streamop)
1079         ;; Relpos: Boi at the first stream op in the statement.         ;; Anchor pos: Boi at the first stream op in the statement.
1080         (inclass               . +)         (inclass               . +)
1081         ;; Relpos: At the class open brace if it's at boi, otherwise         ;; Anchor pos: At the class open brace if it's at boi,
1082         ;; boi at the class decl start.         ;; otherwise boi at the class decl start.
1083         (cpp-macro             . [0])         (cpp-macro             . [0])
1084         ;; Relpos: None.         ;; Anchor pos: None.
1085         (cpp-macro-cont        . +)         (cpp-macro-cont        . +)
1086         ;; Relpos: At the macro start (always at boi).         ;; Anchor pos: At the macro start (always at boi).
1087         (cpp-define-intro      . (c-lineup-cpp-define +))         (cpp-define-intro      . (c-lineup-cpp-define +))
1088         ;; Relpos: None.         ;; Anchor pos: None.
1089         (friend                . 0)         (friend                . 0)
1090         ;; Relpos: None.         ;; Anchor pos: None.
1091         (objc-method-intro     . [0])         (objc-method-intro     . [0])
1092         ;; Relpos: Boi.         ;; Anchor pos: Boi.
1093         (objc-method-args-cont . c-lineup-ObjC-method-args)         (objc-method-args-cont . c-lineup-ObjC-method-args)
1094         ;; Relpos: At the method start (always at boi).         ;; Anchor pos: At the method start (always at boi).
1095         (objc-method-call-cont . c-lineup-ObjC-method-call)         (objc-method-call-cont . c-lineup-ObjC-method-call)
1096         ;; Relpos: At the open bracket.         ;; Anchor pos: At the open bracket.
1097         (extern-lang-open      . 0)         (extern-lang-open      . 0)
1098         (namespace-open        . 0)         (namespace-open        . 0)
1099         (module-open           . 0)         (module-open           . 0)
1100         (composition-open      . 0)         (composition-open      . 0)
1101         ;; Relpos: Boi at the extern/namespace/etc keyword.         ;; Anchor pos: Boi at the extern/namespace/etc keyword.
1102         (extern-lang-close     . 0)         (extern-lang-close     . 0)
1103         (namespace-close       . 0)         (namespace-close       . 0)
1104         (module-close          . 0)         (module-close          . 0)
1105         (composition-close     . 0)         (composition-close     . 0)
1106         ;; Relpos: Boi at the corresponding extern/namespace/etc keyword.         ;; Anchor pos: Boi at the corresponding extern/namespace/etc keyword.
1107         (inextern-lang         . +)         (inextern-lang         . +)
1108         (innamespace           . +)         (innamespace           . +)
1109         (inmodule              . +)         (inmodule              . +)
1110         (incomposition         . +)         (incomposition         . +)
1111         ;; Relpos: At the extern/namespace/etc block open brace if it's         ;; Anchor pos: At the extern/namespace/etc block open brace if
1112         ;; at boi, otherwise boi at the keyword.         ;; it's at boi, otherwise boi at the keyword.
1113         (template-args-cont    . (c-lineup-template-args +))         (template-args-cont    . (c-lineup-template-args +))
1114         ;; Relpos: Boi at the decl start.  This might be changed; the         ;; Anchor pos: Boi at the decl start.  This might be changed;
1115         ;; logical position is clearly the opening '<'.         ;; the logical position is clearly the opening '<'.
1116         (inlambda              . c-lineup-inexpr-block)         (inlambda              . c-lineup-inexpr-block)
1117         ;; Relpos: None.         ;; Anchor pos: None.
1118         (lambda-intro-cont     . +)         (lambda-intro-cont     . +)
1119         ;; Relpos: Boi at the lambda start.         ;; Anchor pos: Boi at the lambda start.
1120         (inexpr-statement      . +)         (inexpr-statement      . +)
1121         ;; Relpos: None.         ;; Anchor pos: None.
1122         (inexpr-class          . +)         (inexpr-class          . +)
1123         ;; Relpos: None.         ;; Anchor pos: None.
1124         ))         ))
1125  (defcustom c-offsets-alist nil  (defcustom c-offsets-alist nil
1126    "Association list of syntactic element symbols and indentation offsets.    "Association list of syntactic element symbols and indentation offsets.
# Line 1112  As described below, each cons cell in th Line 1130  As described below, each cons cell in th
1130    
1131  When a line is indented, CC Mode first determines the syntactic  When a line is indented, CC Mode first determines the syntactic
1132  context of it by generating a list of symbols called syntactic  context of it by generating a list of symbols called syntactic
1133  elements.  This list can contain more than one syntactic element and  elements.  The global variable `c-syntactic-context' is bound to the
1134  the global variable `c-syntactic-context' contains the context list  that list.  Each element in the list is in turn a list where the first
1135  for the line being indented.  Each element in this list is actually a  element is a syntactic symbol which tells what kind of construct the
1136  cons cell of the syntactic symbol and a buffer position.  This buffer  indentation point is located within.  More elements in the syntactic
1137  position is called the relative indent point for the line.  Some  element lists are optional.  If there is one more and it isn't nil,
1138  syntactic symbols may not have a relative indent point associated with  then it's the anchor position for that construct.
1139  them.  
1140    After generating the syntactic context for the line, CC Mode
1141  After the syntactic context list for a line is generated, CC Mode  calculates the absolute indentation: First the base indentation is
1142  calculates the absolute indentation for the line by looking at each  found by using the anchor position for the first syntactic element
1143  syntactic element in the list.  It compares the syntactic element  that provides one.  If none does, zero is used as base indentation.
1144  against the SYNTACTIC-SYMBOL's in `c-offsets-alist'.  When it finds a  Then CC Mode looks at each syntactic element in the context in turn.
1145  match, it adds the OFFSET to the column of the relative indent point.  It compares the car of the syntactic element against the
1146  The sum of this calculation for each element in the syntactic list is  SYNTACTIC-SYMBOL's in `c-offsets-alist'.  When it finds a match, it
1147    adds OFFSET to the base indentation.  The sum of this calculation is
1148  the absolute offset for line being indented.  the absolute offset for line being indented.
1149    
1150  If the syntactic element does not match any in the `c-offsets-alist',  If the syntactic element does not match any in the `c-offsets-alist',
1151  the element is ignored.  the element is ignored.
1152    
1153  If OFFSET is nil, the syntactic element is ignored in the offset  OFFSET can specify an offset in several different ways:
1154  calculation.  
1155      If OFFSET is nil then it's ignored.
1156    
1157  If OFFSET is an integer, it's added to the relative indent.    If OFFSET is an integer then it's used as relative offset, i.e. it's
1158      added to the base indentation.
1159    
1160  If OFFSET is one of the symbols `+', `-', `++', `--', `*', or `/', a    If OFFSET is one of the symbols `+', `-', `++', `--', `*', or `/'
1161  positive or negative multiple of `c-basic-offset' is added; 1, -1, 2,    then a positive or negative multiple of `c-basic-offset' is added to
1162  -2, 0.5, and -0.5, respectively.    the base indentation; 1, -1, 2, -2, 0.5, and -0.5, respectively.
1163    
1164  If OFFSET is a vector, it's first element, which must be an integer,    If OFFSET is a symbol with a value binding then that value, which
1165  is used as an absolute indentation column.  This overrides all    must be an integer, is used as relative offset.
1166  relative offsets.  If there are several syntactic elements which  
1167  evaluates to absolute indentation columns, the first one takes    If OFFSET is a vector then it's first element, which must be an
1168  precedence.  You can see in which order CC Mode combines the syntactic    integer, is used as an absolute indentation column.  This overrides
1169  elements in a certain context by using \\[c-show-syntactic-information] on the line.    the previous base indentation and the relative offsets applied to
1170      it, and it becomes the new base indentation.
1171  If OFFSET is a function, it's called with a single argument  
1172  containing the cons of the syntactic element symbol and the relative    If OFFSET is a function or a lambda expression then it's called with
1173  indent point.  The return value from the function is then    a single argument containing the cons of the syntactic symbol and
1174  reinterpreted as an OFFSET value.    the anchor position (or nil if there is none).  The return value
1175      from the function is then reinterpreted as an offset specification.
1176  If OFFSET is a list, it's recursively evaluated using the semantics  
1177  described above.  The first element of the list to return a non-nil    If OFFSET is a list then its elements are evaluated recursively as
1178  value succeeds.  If none of the elements returns a non-nil value, the    offset specifications.  If the first element is any of the symbols
1179  syntactic element is ignored.    below then it isn't evaluated but instead specifies how the
1180      remaining offsets in the list should be combined.  If it's something
1181      else then the list is combined according the method `first'.  The
1182      valid combination methods are:
1183    
1184      `first' -- Use the first offset (that doesn't evaluate to nil).
1185      `min'   -- Use the minimum of all the offsets.  All must be either
1186                 relative or absolute - they can't be mixed.
1187      `max'   -- Use the maximum of all the offsets.  All must be either
1188                 relative or absolute - they can't be mixed.
1189      `add'   -- Add all the evaluated offsets together.  Exactly one of
1190                 them may be absolute, in which case the result is
1191                 absolute.  Any relative offsets that preceded the
1192                 absolute one in the list will be ignored in that case.
1193    
1194  `c-offsets-alist' is a style variable.  This means that the offsets on  `c-offsets-alist' is a style variable.  This means that the offsets on
1195  this variable are normally taken from the style system in CC Mode  this variable are normally taken from the style system in CC Mode
# Line 1336  The list of variables to buffer localize Line 1370  The list of variables to buffer localize
1370    :type 'hook    :type 'hook
1371    :group 'c)    :group 'c)
1372    
1373    (defcustom awk-mode-hook nil
1374      "*Hook called by `awk-mode'."
1375      :type 'hook
1376      :group 'c)
1377    
1378  (defcustom c-mode-common-hook nil  (defcustom c-mode-common-hook nil
1379    "*Hook called by all CC Mode modes for common initializations."    "*Hook called by all CC Mode modes for common initializations."
1380    :type 'hook    :type 'hook
# Line 1380  working due to this change.") Line 1419  working due to this change.")
1419    :args '((const :tag "none" nil)    :args '((const :tag "none" nil)
1420            (repeat :tag "types" regexp)))            (repeat :tag "types" regexp)))
1421    
1422  (eval-and-compile  (defun c-make-font-lock-extra-types-blurb (mode1 mode2 example)
1423    ;; XEmacs 19 evaluates this at compile time below, while most other    (concat "\
   ;; versions delays the evaluation until the package is loaded.  
   (defun c-make-font-lock-extra-types-blurb (mode1 mode2 example)  
     (concat "\  
1424  *List of extra types (aside from the type keywords) to recognize in "  *List of extra types (aside from the type keywords) to recognize in "
1425  mode1 " mode.  mode1 " mode.
1426  Each list item should be a regexp matching a single identifier.  Each list item should be a regexp matching a single identifier.
1427  " example "  " example "
1428    
1429    Note that items on this list that don't include any regexp special
1430    characters are automatically optimized using `regexp-opt', so you
1431    should not use `regexp-opt' explicitly to build regexps here.
1432    
1433  On decoration level 3 (and higher, where applicable), a method is used  On decoration level 3 (and higher, where applicable), a method is used
1434  that finds most types and declarations by syntax alone.  This variable  that finds most types and declarations by syntax alone.  This variable
1435  is still used as a first step, but other types are recognized  is still used as a first step, but other types are recognized
# Line 1401  initialized.  If you change it later you Line 1441  initialized.  If you change it later you
1441  by doing \\[" mode2 "].  by doing \\[" mode2 "].
1442    
1443  Despite the name, this variable is not only used for font locking but  Despite the name, this variable is not only used for font locking but
1444  also elsewhere in CC Mode to tell types from other identifiers.")))  also elsewhere in CC Mode to tell types from other identifiers."))
1445    
1446  ;; Note: Most of the variables below are also defined in font-lock.el  ;; Note: Most of the variables below are also defined in font-lock.el
1447  ;; in older versions in Emacs, so depending on the load order we might  ;; in older versions of Emacs, so depending on the load order we might
1448  ;; not install the values below.  There's no kludge to cope with this  ;; not install the values below.  There's no kludge to cope with this
1449  ;; (as opposed to the *-font-lock-keywords-* variables) since the old  ;; (as opposed to the *-font-lock-keywords-* variables) since the old
1450  ;; values work fairly well anyway.  ;; values work fairly well anyway.
1451    
1452  (defcustom c-font-lock-extra-types  (defcustom c-font-lock-extra-types
1453    '("FILE" "\\sw+_t"    '("\\sw+_t"
1454      "bool" "complex" "imaginary"        ; Defined in C99.      ;; Defined in C99:
1455        "bool" "complex" "imaginary"
1456        ;; Standard library types (except those matched by the _t pattern):
1457        "FILE" "lconv" "tm" "va_list" "jmp_buf"
1458      ;; I do not appreciate the following very Emacs-specific luggage      ;; I do not appreciate the following very Emacs-specific luggage
1459      ;; in the default value, but otoh it can hardly get in the way for      ;; in the default value, but otoh it can hardly get in the way for
1460      ;; other users, and removing it would cause unnecessary grief for      ;; other users, and removing it would cause unnecessary grief for
1461      ;; the old timers that are used to it. /mast      ;; the old timers that are used to it. /mast
1462      "Lisp_Object")      "Lisp_Object")
1463    (c-make-font-lock-extra-types-blurb "C" "c-mode"    (c-make-font-lock-extra-types-blurb "C" "c-mode"
1464  "For example, a value of (\"FILE\" \"\\\\sw+_t\") means the word FILE  "For example, a value of (\"FILE\" \"\\\\sw+_t\") means the word \"FILE\"
1465  and words ending in _t are treated as type names.")  and words ending in \"_t\" are treated as type names.")
1466    :type 'c-extra-types-widget    :type 'c-extra-types-widget
1467    :group 'c)    :group 'c)
1468    
1469  (defcustom c++-font-lock-extra-types  (defcustom c++-font-lock-extra-types
1470    '("\\sw+_t"    '("\\sw+_t"
1471      "\\([iof]\\|str\\)+stream\\(buf\\)?" "ios"      ;; C library types (except those matched by the _t pattern):
1472        "FILE" "lconv" "tm" "va_list" "jmp_buf"
1473        ;; Some standard C++ types that came from font-lock.el.
1474        ;; Experienced C++ users says there's no clear benefit in
1475        ;; extending this to all the types in the standard library, at
1476        ;; least not when they'll be recognized without "std::" too.
1477        "istream" "istreambuf"
1478        "ostream" "ostreambuf"
1479        "ifstream" "ofstream" "fstream"
1480        "strstream" "strstreambuf" "istrstream" "ostrstream"
1481        "ios"
1482      "string" "rope"      "string" "rope"
1483      "list" "slist"      "list" "slist"
1484      "deque" "vector" "bit_vector"      "deque" "vector" "bit_vector"
1485      "set" "multiset"      "set" "multiset"
1486      "map" "multimap"      "map" "multimap"
1487      "hash\\(_\\(m\\(ap\\|ulti\\(map\\|set\\)\\)\\|set\\)\\)?"      "hash"
1488        "hash_set" "hash_multiset"
1489        "hash_map" "hash_multimap"
1490      "stack" "queue" "priority_queue"      "stack" "queue" "priority_queue"
1491      "type_info"      "type_info"
1492      "iterator" "const_iterator" "reverse_iterator" "const_reverse_iterator"      "iterator" "const_iterator" "reverse_iterator" "const_reverse_iterator"
1493      "reference" "const_reference")      "reference" "const_reference")
1494    (c-make-font-lock-extra-types-blurb "C++" "c++-mode"    (c-make-font-lock-extra-types-blurb "C++" "c++-mode"
1495  "For example, a value of (\"string\") means the word string is treated  "For example, a value of (\"string\") means the word \"string\" is treated
1496  as a type name.")  as a type name.")
1497    :type 'c-extra-types-widget    :type 'c-extra-types-widget
1498    :group 'c)    :group 'c)
# Line 1499  Note that file offset settings are appli Line 1554  Note that file offset settings are appli
1554  as designated in the variable `c-file-style'.")  as designated in the variable `c-file-style'.")
1555  (make-variable-buffer-local 'c-file-offsets)  (make-variable-buffer-local 'c-file-offsets)
1556    
1557  ;; It isn't possible to specify a docstring without specifying an  ;; It isn't possible to specify a doc-string without specifying an
1558  ;; initial value with `defvar', so the following two variables have  ;; initial value with `defvar', so the following two variables have been
1559  ;; only doc comments even though they are part of the API.  It's  ;; given doc-strings by setting the property `variable-documentation'
1560  ;; really good not to have an initial value for variables like these  ;; directly.  C-h v will read this documentation only for versions of GNU
1561  ;; that always should be dynamically bound, so it's worth the  ;; Emacs from 22.1.  It's really good not to have an initial value for
1562  ;; inconvenience.  ;; variables like these that always should be dynamically bound, so it's
1563    ;; worth the inconvenience.
1564    
1565  (cc-bytecomp-defvar c-syntactic-context)  (cc-bytecomp-defvar c-syntactic-context)
1566  (defvar c-syntactic-context)  (defvar c-syntactic-context)
1567  ;; Variable containing the syntactic analysis list during indentation.  (put 'c-syntactic-context 'variable-documentation
1568  ;; It is a list with one element for each found syntactic symbol.  See    "Variable containing the syntactic analysis list for a line of code.
1569  ;; `c-syntactic-element' for further info.  
1570  ;;  It is a list with one element for each syntactic symbol pertinent to the
1571  ;; This is always bound dynamically.  It should never be set  line, for example \"((defun-block-intro 1) (comment-intro))\".
1572  ;; statically (e.g. with `setq').  
1573    It is dynamically bound when calling \(i) a brace hanging \"action
1574    function\"; \(ii) a semicolon/comma hanging \"criteria function\"; \(iii) a
1575    \"line-up function\"; \(iv) a c-special-indent-hook function.  It is also
1576    used internally by CC Mode.
1577    
1578    c-syntactic-context is always bound dynamically.  It must NEVER be set
1579    statically (e.g. with `setq').")
1580    
1581    
1582  (cc-bytecomp-defvar c-syntactic-element)  (cc-bytecomp-defvar c-syntactic-element)
1583  (defvar c-syntactic-element)  (defvar c-syntactic-element)
1584  ;; Variable containing the info regarding the current syntactic  (put 'c-syntactic-element 'variable-documentation
1585  ;; element during calls to the lineup functions.  The value is one of       "Variable containing the current syntactic element during calls to
1586  ;; the elements in the list in `c-syntactic-context' and is a list  the lineup functions.  The value is one of the elements in the list in
1587  ;; with the symbol name in the first position, followed by zero or  `c-syntactic-context' and is a list with the symbol name in the first
1588  ;; more elements containing any additional info associated with the  position, followed by zero or more elements containing any additional
1589  ;; syntactic symbol.  There are accessor functions `c-langelem-sym',  info associated with the syntactic symbol.  There are accessor functions
1590  ;; `c-langelem-pos', `c-langelem-col', and `c-langelem-2nd-pos' to  `c-langelem-sym', `c-langelem-pos', `c-langelem-col', and
1591  ;; access the list.  `c-langelem-2nd-pos' to access the list.
1592  ;;  
1593  ;; Specifically, the element returned by `c-langelem-pos' is the  Specifically, the element returned by `c-langelem-pos' is the anchor
1594  ;; relpos (a.k.a. anchor position), or nil if there isn't any.  See  position, or nil if there isn't any.  See the comments in the
1595  ;; the comments in the `c-offsets-alist' variable for more detailed  `c-offsets-alist' variable and the CC Mode manual for more detailed info
1596  ;; info about the data each syntactic symbol provides.  about the data each syntactic symbol provides.
1597  ;;  
1598  ;; This is always bound dynamically.  It should never be set  This is always bound dynamically.  It should never be set
1599  ;; statically (e.g. with `setq').  statically (e.g. with `setq').")
1600    
1601  (defvar c-indentation-style nil  (defvar c-indentation-style nil
1602    "Name of the currently installed style.    "Name of the currently installed style.
# Line 1543  Don't change this directly; call `c-set- Line 1607  Don't change this directly; call `c-set-
1607  Set from `c-comment-prefix-regexp' at mode initialization.")  Set from `c-comment-prefix-regexp' at mode initialization.")
1608  (make-variable-buffer-local 'c-current-comment-prefix)  (make-variable-buffer-local 'c-current-comment-prefix)
1609    
1610    ;; N.B. The next three variables are initialized in
1611    ;; c-setup-paragraph-variables.  Their initializations here are "just in
1612    ;; case".  ACM, 2004/2/15.  They are NOT buffer local (yet?).
1613    (defvar c-string-par-start
1614    ;;   (concat "\\(" (default-value 'paragraph-start) "\\)\\|[ \t]*\\\\$")
1615      "\f\\|[ \t]*\\\\?$"
1616      "Value of paragraph-start used when scanning strings.
1617    It treats escaped EOLs as whitespace.")
1618    
1619    (defvar c-string-par-separate
1620      ;; (concat "\\(" (default-value 'paragraph-separate) "\\)\\|[ \t]*\\\\$")
1621      "[ \t\f]*\\\\?$"
1622      "Value of paragraph-separate used when scanning strings.
1623    It treats escaped EOLs as whitespace.")
1624    
1625    (defvar c-sentence-end-with-esc-eol
1626      (concat "\\(\\(" (c-default-value-sentence-end) "\\)"
1627                    ;; N.B.:  "$" would be illegal when not enclosed like "\\($\\)".
1628                    "\\|" "[.?!][]\"')}]* ?\\\\\\($\\)[ \t\n]*"
1629                    "\\)")
1630      "Value used like sentence-end used when scanning strings.
1631    It treats escaped EOLs as whitespace.")
1632    
1633    
1634  (cc-provide 'cc-vars)  (cc-provide 'cc-vars)
1635    

Legend:
Removed from v.1.41  
changed lines
  Added in v.1.42

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26