Mercurial > emacs
diff lisp/progmodes/cc-cmds.el @ 109595:a854e7a0e7eb
cc-cmds.el (c-mask-paragraph): Fix bug #6688, Auto-fill broken in C/C++
modes.
author | Alan Mackenzie <acm@muc.de> |
---|---|
date | Sat, 31 Jul 2010 09:39:24 +0000 |
parents | 75f27a9b3b3a |
children | 7525495fea97 |
line wrap: on
line diff
--- 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