From 28e5cf7c6afc606436f6a6df448cd582e92867d7 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Sat, 31 Jul 2010 09:39:24 +0000 Subject: [PATCH] cc-cmds.el (c-mask-paragraph): Fix bug #6688, Auto-fill broken in C/C++ modes. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/cc-cmds.el | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f0332db2c9f..151fe8da2be 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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 --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 10267a6b2dc..6d4479cb204 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -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 -- 2.11.4.GIT