diff options
author | Alan Mackenzie <acm@muc.de> | 2010-10-31 11:54:02 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2010-10-31 11:54:02 +0000 |
commit | e6ef5dd9ce13d346c7bbdcd6794b29045b4e0e63 (patch) | |
tree | 8a0e2243a6e9646d7cc9ff619ad63cfa03fbcfe9 /lisp/progmodes | |
parent | 938c0d10899c328c84dddd1ec283ae860bd556ed (diff) | |
download | emacs-e6ef5dd9ce13d346c7bbdcd6794b29045b4e0e63.tar.gz |
progmodes/cc-cmds.el (c-mask-paragraph): Fix an off-by-1 error. Fixes
bug #7185.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r-- | lisp/progmodes/cc-cmds.el | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index b17703b0305..112fa50ce8f 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -3974,17 +3974,19 @@ 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). - (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))))) +; (or (<= (- (cdr c-lit-limits) 2) (point)) +; 2010-10-17 Construct removed. +; (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 hanging. Replace all space between it ;; and the last word either by one or two 'x's (when |