Mercurial > emacs
comparison lisp/progmodes/cc-langs.el @ 30402:cc4564c9cd55
(c-append-paragraph-start): New variable used by
c-common-init to get paragraph-start correct.
(c-common-init): Use c-append-paragraph-start to
initialize paragraph-start to make it correct both with and
without the javadoc special case.
(c-Pike-inexpr-class-key): New
constant, since "class" can introduce an in-expression class
in Pike nowadays.
(c-Java-javadoc-paragraph-start): Brought
up-to-date with javadoc 1.2.
(c-common-init): Handling of obsolete variables
moved to c-initialize-cc-mode. More compatible style override
when using global style variables.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 24 Jul 2000 11:11:01 +0000 |
parents | 03befb219d03 |
children | 9e4506dd912e |
comparison
equal
deleted
inserted
replaced
30401:b85ee58b24ec | 30402:cc4564c9cd55 |
---|---|
1 ;;; cc-langs.el --- specific language support for CC Mode | 1 ;;; cc-langs.el --- specific language support 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 |
9 ;; Maintainer: bug-cc-mode@gnu.org | 10 ;; Maintainer: bug-cc-mode@gnu.org |
10 ;; Created: 22-Apr-1997 (split from cc-mode.el) | 11 ;; Created: 22-Apr-1997 (split from cc-mode.el) |
211 | 212 |
212 ;; Regexp describing the beginning of a Java top-level definition. | 213 ;; Regexp describing the beginning of a Java top-level definition. |
213 (defconst c-Java-defun-prompt-regexp | 214 (defconst c-Java-defun-prompt-regexp |
214 "^[ \t]*\\(\\(\\(public\\|protected\\|private\\|const\\|abstract\\|synchronized\\|final\\|static\\|threadsafe\\|transient\\|native\\|volatile\\)\\s-+\\)*\\(\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*[][_$.a-zA-Z0-9]+\\|[[a-zA-Z]\\)\\s-*\\)\\s-+\\)\\)?\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*\\s-+\\)\\s-*\\)?\\([_a-zA-Z][^][ \t:;.,{}()=]*\\|\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)\\)\\s-*\\(([^);{}]*)\\)?\\([] \t]*\\)\\(\\s-*\\<throws\\>\\s-*\\(\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)[, \t\n\r\f]*\\)+\\)?\\s-*") | 215 "^[ \t]*\\(\\(\\(public\\|protected\\|private\\|const\\|abstract\\|synchronized\\|final\\|static\\|threadsafe\\|transient\\|native\\|volatile\\)\\s-+\\)*\\(\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*[][_$.a-zA-Z0-9]+\\|[[a-zA-Z]\\)\\s-*\\)\\s-+\\)\\)?\\(\\([[a-zA-Z][][_$.a-zA-Z0-9]*\\s-+\\)\\s-*\\)?\\([_a-zA-Z][^][ \t:;.,{}()=]*\\|\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)\\)\\s-*\\(([^);{}]*)\\)?\\([] \t]*\\)\\(\\s-*\\<throws\\>\\s-*\\(\\([_$a-zA-Z][_$.a-zA-Z0-9]*\\)[, \t\n\r\f]*\\)+\\)?\\s-*") |
215 | 216 |
216 ;; Regexp describing Javadoc markup that always starts paragraphs. | 217 ;; Regexp describing regexp to append to paragraph-start |
218 (defvar c-append-paragraph-start "$") | |
219 (make-variable-buffer-local 'c-append-paragraph-start) | |
217 (defconst c-Java-javadoc-paragraph-start | 220 (defconst c-Java-javadoc-paragraph-start |
218 "@\\(author\\|exception\\|param\\|return\\|see\\|throws\\|version\\)") | 221 (concat "\\(" |
222 "@\\(author\\|deprecated\\|exception\\|param\\|return\\|" | |
223 "s\\(e\\(e\\|rial\\(\\|Data\\|Field\\)\\)\\|ince\\)\\|" | |
224 "throws\\|version\\)" | |
225 "\\|$\\)")) | |
219 | 226 |
220 ;; Regexp that starts lambda constructs. | 227 ;; Regexp that starts lambda constructs. |
221 (defvar c-lambda-key nil) | 228 (defvar c-lambda-key nil) |
222 (make-variable-buffer-local 'c-lambda-key) | 229 (make-variable-buffer-local 'c-lambda-key) |
223 (defconst c-Pike-lambda-key "\\<lambda\\>") | 230 (defconst c-Pike-lambda-key "\\<lambda\\>") |
229 | 236 |
230 ;; Regexp that may be followed by an anonymous class in expressions. | 237 ;; Regexp that may be followed by an anonymous class in expressions. |
231 (defvar c-inexpr-class-key nil) | 238 (defvar c-inexpr-class-key nil) |
232 (make-variable-buffer-local 'c-inexpr-class-key) | 239 (make-variable-buffer-local 'c-inexpr-class-key) |
233 (defconst c-Java-inexpr-class-key "\\<new\\>") | 240 (defconst c-Java-inexpr-class-key "\\<new\\>") |
241 (defconst c-Pike-inexpr-class-key "\\<class\\>") | |
234 | 242 |
235 ;; List of open- and close-chars that makes up a pike-style brace | 243 ;; List of open- and close-chars that makes up a pike-style brace |
236 ;; list, ie for a `([ ])' list there should be a cons (?\[ . ?\]) in | 244 ;; list, ie for a `([ ])' list there should be a cons (?\[ . ?\]) in |
237 ;; this list. | 245 ;; this list. |
238 (defvar c-special-brace-lists nil) | 246 (defvar c-special-brace-lists nil) |
326 ;; comments by using c-comment-prefix-regexp in the relevant places. | 334 ;; comments by using c-comment-prefix-regexp in the relevant places. |
327 ;; We use adaptive filling for this to make it possible to use | 335 ;; We use adaptive filling for this to make it possible to use |
328 ;; filladapt or some other fancy package. | 336 ;; filladapt or some other fancy package. |
329 (let ((comment-line-prefix | 337 (let ((comment-line-prefix |
330 (concat "[ \t]*\\(" c-comment-prefix-regexp "\\)?[ \t]*"))) | 338 (concat "[ \t]*\\(" c-comment-prefix-regexp "\\)?[ \t]*"))) |
331 (setq paragraph-start (concat comment-line-prefix "$\\|" | 339 (setq paragraph-start (concat comment-line-prefix |
340 c-append-paragraph-start | |
341 "\\|" | |
332 page-delimiter) | 342 page-delimiter) |
333 paragraph-separate paragraph-start | 343 paragraph-separate (concat comment-line-prefix "$" |
344 "\\|" | |
345 page-delimiter) | |
334 paragraph-ignore-fill-prefix t | 346 paragraph-ignore-fill-prefix t |
335 adaptive-fill-mode t | 347 adaptive-fill-mode t |
336 adaptive-fill-regexp | 348 adaptive-fill-regexp |
337 (concat comment-line-prefix | 349 (concat comment-line-prefix |
338 (if adaptive-fill-regexp | 350 (if adaptive-fill-regexp |