# HG changeset patch # User Alan Mackenzie # Date 1280569164 0 # Node ID a854e7a0e7ebb285d5ab960396d9023dc668445c # Parent fe23ee097a5470fdac7fbab4740d0c80c30880a4 cc-cmds.el (c-mask-paragraph): Fix bug #6688, Auto-fill broken in C/C++ modes. diff -r fe23ee097a54 -r a854e7a0e7eb lisp/ChangeLog --- a/lisp/ChangeLog Thu Jul 29 21:42:38 2010 -0700 +++ b/lisp/ChangeLog Sat Jul 31 09:39:24 2010 +0000 @@ -1,3 +1,8 @@ +2010-07-31 Alan Mackenzie + + * progmodes/cc-cmds.el (c-mask-paragraph): Fix bug #6688: + Auto-fill broken in C/C++ modes. + 2010-07-29 Jan Djärv * menu-bar.el (menu-bar-showhide-tool-bar-menu-customize-enable-left) diff -r fe23ee097a54 -r a854e7a0e7eb lisp/progmodes/cc-cmds.el --- a/lisp/progmodes/cc-cmds.el Thu Jul 29 21:42:38 2010 -0700 +++ b/lisp/progmodes/cc-cmds.el Sat Jul 31 09:39:24 2010 +0000 @@ -3974,16 +3974,17 @@ ;; "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