aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2010-10-31 11:54:02 +0000
committerAlan Mackenzie2010-10-31 11:54:02 +0000
commite6ef5dd9ce13d346c7bbdcd6794b29045b4e0e63 (patch)
tree8a0e2243a6e9646d7cc9ff619ad63cfa03fbcfe9
parent938c0d10899c328c84dddd1ec283ae860bd556ed (diff)
downloademacs-e6ef5dd9ce13d346c7bbdcd6794b29045b4e0e63.tar.gz
emacs-e6ef5dd9ce13d346c7bbdcd6794b29045b4e0e63.zip
progmodes/cc-cmds.el (c-mask-paragraph): Fix an off-by-1 error. Fixes
bug #7185.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/cc-cmds.el24
2 files changed, 18 insertions, 11 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a37ae0c7a47..4a49b8d4880 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12010-10-31 Alan Mackenzie <acm@muc.de>
2
3 * progmodes/cc-cmds.el (c-mask-paragraph): Fix an off-by-1 error.
4 This fixes bug #7185.
5
12010-10-30 Chong Yidong <cyd@stupidchicken.com> 62010-10-30 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * startup.el (command-line): Search for package directories, and 8 * startup.el (command-line): Search for package directories, and
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."
3974 ;; "Invalid search bound (wrong side of point)" 3974 ;; "Invalid search bound (wrong side of point)"
3975 ;; error in the subsequent re-search. Maybe 3975 ;; error in the subsequent re-search. Maybe
3976 ;; another fix would be needed (2007-12-08). 3976 ;; another fix would be needed (2007-12-08).
3977 (or (<= (- (cdr c-lit-limits) 2) (point)) 3977; (or (<= (- (cdr c-lit-limits) 2) (point))
3978 (and 3978; 2010-10-17 Construct removed.
3979 (search-forward-regexp 3979; (or (< (- (cdr c-lit-limits) 2) (point))
3980 (concat "\\=[ \t]*\\(" c-current-comment-prefix "\\)") 3980 (and
3981 (- (cdr c-lit-limits) 2) t) 3981 (search-forward-regexp
3982 (not (search-forward-regexp 3982 (concat "\\=[ \t]*\\(" c-current-comment-prefix "\\)")
3983 "\\(\\s \\|\\sw\\)" 3983 (- (cdr c-lit-limits) 2) t)
3984 (- (cdr c-lit-limits) 2) 'limit)) 3984 (not (search-forward-regexp
3985 ;; The comment ender IS on its own line. Exclude 3985 "\\(\\s \\|\\sw\\)"
3986 ;; this line from the filling. 3986 (- (cdr c-lit-limits) 2) 'limit))
3987 (set-marker end (c-point 'bol))))) 3987 ;; The comment ender IS on its own line. Exclude this
3988 ;; line from the filling.
3989 (set-marker end (c-point 'bol))));)
3988 3990
3989 ;; The comment ender is hanging. Replace all space between it 3991 ;; The comment ender is hanging. Replace all space between it
3990 ;; and the last word either by one or two 'x's (when 3992 ;; and the last word either by one or two 'x's (when