]> git.eshelyaron.com Git - emacs.git/commitdiff
cc-cmds.el (c-mask-paragraph): Fix bug #6688, Auto-fill broken in C/C++
authorAlan Mackenzie <acm@muc.de>
Sat, 31 Jul 2010 09:39:24 +0000 (09:39 +0000)
committerAlan Mackenzie <acm@muc.de>
Sat, 31 Jul 2010 09:39:24 +0000 (09:39 +0000)
modes.

lisp/ChangeLog
lisp/progmodes/cc-cmds.el

index f0332db2c9ff4ef627f85fa28005a1cf90e2ada1..151fe8da2be7dd230f2cba5564450b40aac1004f 100644 (file)
@@ -1,3 +1,8 @@
+2010-07-31  Alan Mackenzie  <acm@muc.de>
+
+       * progmodes/cc-cmds.el (c-mask-paragraph): Fix bug #6688:
+       Auto-fill broken in C/C++ modes.
+
 2010-07-29  Jan Djärv  <jan.h.d@swipnet.se>
 
        * menu-bar.el (menu-bar-showhide-tool-bar-menu-customize-enable-left)
index 10267a6b2dc27fd6426da9f3ffbd98bb653e8db5..6d4479cb20414dd6030375f1cdc7b4daff542020 100644 (file)
@@ -3974,16 +3974,17 @@ command to conveniently insert and align the necessary backslashes."
                    ;; "Invalid search bound (wrong side of point)"
                    ;; error in the subsequent re-search.  Maybe
                    ;; another fix would be needed (2007-12-08).
-                   (and (> (- (cdr c-lit-limits) 2) (point))
+                   (or (<= (- (cdr c-lit-limits) 2) (point))
+                       (and 
                         (search-forward-regexp
                          (concat "\\=[ \t]*\\(" c-current-comment-prefix "\\)")
                          (- (cdr c-lit-limits) 2) t)
                         (not (search-forward-regexp
                               "\\(\\s \\|\\sw\\)"
                               (- (cdr c-lit-limits) 2) 'limit))
-                            ;; The comment ender IS on its own line.  Exclude
-                            ;; this line from the filling.
-                        (set-marker end (c-point 'bol))))
+                        ;; The comment ender IS on its own line.  Exclude
+                        ;; this line from the filling.
+                        (set-marker end (c-point 'bol)))))
 
                ;; The comment ender is hanging.  Replace all space between it
                ;; and the last word either by one or two 'x's (when