emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp/progmodes cc-styles.el


From: Alan Mackenzie
Subject: [Emacs-diffs] emacs/lisp/progmodes cc-styles.el
Date: Mon, 05 Jan 2009 21:22:20 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Alan Mackenzie <acmacm> 09/01/05 21:22:20

Modified files:
        lisp/progmodes : cc-styles.el 

Log message:
        (c-setup-paragraph-variables): Ensure paragraph-\(start\|separate\) 
match
        blank lines.  For AWK Mode.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/progmodes/cc-styles.el?cvsroot=emacs&r1=1.53&r2=1.54

Patches:
Index: cc-styles.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/progmodes/cc-styles.el,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- cc-styles.el        5 Jan 2009 03:23:21 -0000       1.53
+++ cc-styles.el        5 Jan 2009 21:22:20 -0000       1.54
@@ -510,14 +510,21 @@
                          (assoc 'other c-comment-prefix-regexp)))
          c-comment-prefix-regexp))
 
-  (let ((comment-line-prefix
-        (concat "[ \t]*\\(" c-current-comment-prefix "\\)[ \t]*")))
+  (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 comment-line-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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]