summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-styles.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2009-01-05 21:22:20 +0000
committerAlan Mackenzie <acm@muc.de>2009-01-05 21:22:20 +0000
commit49be4f8800b854f19cfbccc5aeeef92330d6b2ea (patch)
tree785a98bd2b9f4b299243178fd00cfe226a3e2a1e /lisp/progmodes/cc-styles.el
parentac4e7a307ffeab0dfa92f1dfde60dba7b4f52725 (diff)
downloademacs-49be4f8800b854f19cfbccc5aeeef92330d6b2ea.tar.gz
(c-setup-paragraph-variables): Ensure paragraph-\(start\|separate\) match
blank lines. For AWK Mode.
Diffstat (limited to 'lisp/progmodes/cc-styles.el')
-rw-r--r--lisp/progmodes/cc-styles.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el
index d86afdc566f..6e422ec0266 100644
--- a/lisp/progmodes/cc-styles.el
+++ b/lisp/progmodes/cc-styles.el
@@ -510,14 +510,21 @@ variables."
(assoc 'other c-comment-prefix-regexp)))
c-comment-prefix-regexp))
- (let ((comment-line-prefix
- (concat "[ \t]*\\(" c-current-comment-prefix "\\)[ \t]*")))
-
- (setq paragraph-start (concat comment-line-prefix
+ (let* ((empty-is-prefix (string-match c-current-comment-prefix ""))
+ (nonws-comment-line-prefix
+ (concat "\\(" c-current-comment-prefix "\\)[ \t]*"))
+ (comment-line-prefix (concat "[ \t]*" nonws-comment-line-prefix))
+ (blank-or-comment-line-prefix
+ (concat "[ \t]*"
+ (if empty-is-prefix "" "\\(")
+ nonws-comment-line-prefix
+ (if empty-is-prefix "" "\\)?"))))
+
+ (setq paragraph-start (concat blank-or-comment-line-prefix
c-paragraph-start
"\\|"
page-delimiter)
- paragraph-separate (concat comment-line-prefix
+ paragraph-separate (concat blank-or-comment-line-prefix
c-paragraph-separate
"\\|"
page-delimiter)