summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-fonts.el
diff options
context:
space:
mode:
authorMartin Stjernholm <mast@lysator.liu.se>2003-07-08 23:24:44 +0000
committerMartin Stjernholm <mast@lysator.liu.se>2003-07-08 23:24:44 +0000
commit7bfc3fdba3eaf4398daa9782ec85b9e5c8e42007 (patch)
tree8e8d2895f98c458b020cc6a1a1a072cd83c83cdf /lisp/progmodes/cc-fonts.el
parent42f81f6412dcd756022136070dfa6bd25a3d4aa8 (diff)
downloademacs-7bfc3fdba3eaf4398daa9782ec85b9e5c8e42007.tar.gz
2003-07-08 Martin Stjernholm <bug-cc-mode@gnu.org>
* cc-engine.el (c-guess-basic-syntax): Do not do hidden buffer changes; there's third party code that calls this function directly. 2003-07-07 Martin Stjernholm <bug-cc-mode@gnu.org> * cc-fonts.el (javadoc-font-lock-keywords, autodoc-font-lock-keywords): Don't byte compile on font lock initialization when running from byte compiled files. 2003-07-06 Alan Mackenzie <bug-cc-mode@gnu.org> * cc-engine.el: Fix AWK mode indentation when previous statement ends with auto-increment "++". 2003-07-05 Martin Stjernholm <bug-cc-mode@gnu.org> * cc-langs.el, cc-styles.el (c-style-alist, c-lang-variable-inits, c-lang-variable-inits-tail): The values of these are changed, so declare them as variables and not constants.
Diffstat (limited to 'lisp/progmodes/cc-fonts.el')
-rw-r--r--lisp/progmodes/cc-fonts.el77
1 files changed, 39 insertions, 38 deletions
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index 8a0ba6d1920..bab838a22d1 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -2064,7 +2064,7 @@ higher."
;; Kludge: If `c-font-lock-complex-decl-prepare' is on the list we
;; move it first since the doc comment font lockers might add
- ;; `c-type' text properties so they have to be cleared before that.
+ ;; `c-type' text properties, so they have to be cleared before that.
(when (memq 'c-font-lock-complex-decl-prepare list)
(setq list (cons 'c-font-lock-complex-decl-prepare
(delq 'c-font-lock-complex-decl-prepare
@@ -2642,30 +2642,30 @@ need for `pike-font-lock-extra-types'.")
(copy-marker (1+ start))))
t)))
-(defun javadoc-font-lock-keywords ()
- (list
- (byte-compile
- `(lambda (limit)
- (c-font-lock-doc-comments "/\\*\\*" limit
- '(("{@[a-z]+[^}\n\r]*}" ; "{@foo ...}" markup.
- 0 ,c-doc-markup-face-name prepend nil)
- ("^\\(/\\*\\)?[ \t*]*\\(@[a-z]+\\)" ; "@foo ..." markup.
- 2 ,c-doc-markup-face-name prepend nil)
- (,(concat "</?\\sw" ; HTML tags.
- "\\("
- (concat "\\sw\\|\\s \\|[=\n\r*.:]\\|"
- "\"[^\"]*\"\\|'[^']*'")
- "\\)*>")
- 0 ,c-doc-markup-face-name prepend nil)
- ("&\\(\\sw\\|[.:]\\)+;" ; HTML entities.
- 0 ,c-doc-markup-face-name prepend nil)
- ;; Fontify remaining markup characters as invalid. Note
- ;; that the Javadoc spec is hazy about when "@" is allowed
- ;; in non-markup use.
- (,(lambda (limit)
- (c-find-invalid-doc-markup "[<>&]\\|{@" limit))
- 0 ,c-invalid-face-name prepend nil)
- ))))))
+(defconst javadoc-font-lock-doc-comments
+ `(("{@[a-z]+[^}\n\r]*}" ; "{@foo ...}" markup.
+ 0 ,c-doc-markup-face-name prepend nil)
+ ("^\\(/\\*\\)?[ \t*]*\\(@[a-z]+\\)" ; "@foo ..." markup.
+ 2 ,c-doc-markup-face-name prepend nil)
+ (,(concat "</?\\sw" ; HTML tags.
+ "\\("
+ (concat "\\sw\\|\\s \\|[=\n\r*.:]\\|"
+ "\"[^\"]*\"\\|'[^']*'")
+ "\\)*>")
+ 0 ,c-doc-markup-face-name prepend nil)
+ ("&\\(\\sw\\|[.:]\\)+;" ; HTML entities.
+ 0 ,c-doc-markup-face-name prepend nil)
+ ;; Fontify remaining markup characters as invalid. Note
+ ;; that the Javadoc spec is hazy about when "@" is
+ ;; allowed in non-markup use.
+ (,(lambda (limit)
+ (c-find-invalid-doc-markup "[<>&]\\|{@" limit))
+ 0 ,c-invalid-face-name prepend nil)))
+
+(defconst javadoc-font-lock-keywords
+ `((,(lambda (limit)
+ (c-font-lock-doc-comments "/\\*\\*" limit
+ javadoc-font-lock-doc-comments)))))
(defconst autodoc-decl-keywords
;; Adorned regexp matching the keywords that introduce declarations
@@ -2755,6 +2755,17 @@ need for `pike-font-lock-extra-types'.")
nil)
+(defconst autodoc-font-lock-doc-comments
+ `(("@\\(\\w+{\\|\\[\\([^\]@\n\r]\\|@@\\)*\\]\\|[@}]\\|$\\)"
+ ;; In-text markup.
+ 0 ,c-doc-markup-face-name prepend nil)
+ (autodoc-font-lock-line-markup)
+ ;; Fontify remaining markup characters as invalid.
+ (,(lambda (limit)
+ (c-find-invalid-doc-markup "@" limit))
+ 0 ,c-invalid-face-name prepend nil)
+ ))
+
(defun autodoc-font-lock-keywords ()
;; Note that we depend on that `c-current-comment-prefix' has got
;; its proper value here.
@@ -2764,19 +2775,9 @@ need for `pike-font-lock-extra-types'.")
;; following declarations.
(setq c-type-decl-end-used t)
- (list
- (byte-compile
- `(lambda (limit)
- (c-font-lock-doc-comments "/[*/]!" limit
- '(("@\\(\\w+{\\|\\[\\([^\]@\n\r]\\|@@\\)*\\]\\|[@}]\\|$\\)"
- ;; In-text markup.
- 0 ,c-doc-markup-face-name prepend nil)
- (autodoc-font-lock-line-markup)
- ;; Fontify remaining markup characters as invalid.
- (,(lambda (limit)
- (c-find-invalid-doc-markup "@" limit))
- 0 ,c-invalid-face-name prepend nil)
- ))))))
+ `((,(lambda (limit)
+ (c-font-lock-doc-comments "/[*/]!" limit
+ autodoc-font-lock-doc-comments)))))
;; AWK.