diff options
| author | Alan Mackenzie | 2010-08-06 19:48:59 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2010-08-06 19:48:59 +0000 |
| commit | bd4c5e3e069015b7ed7438155b6541cf26c44542 (patch) | |
| tree | 97fcbeb9fcdd6a08405ea2ca62f66929508f3afd | |
| parent | 97ec208ffc803b3ed09a23888618a4705584c0ae (diff) | |
| download | emacs-bd4c5e3e069015b7ed7438155b6541cf26c44542.tar.gz emacs-bd4c5e3e069015b7ed7438155b6541cf26c44542.zip | |
cc-cmds.el (c-mask-paragraph, c-fill-paragraph): Fix for the case that a
C style comment has its delimiters alone on their respective lines.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/progmodes/cc-cmds.el | 19 |
2 files changed, 22 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b5d7984c04f..2cfe12d0019 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-08-06 Alan Mackenzie <bug-cc-mode@gnu.org> | ||
| 2 | |||
| 3 | * progmodes/cc-cmds.el (c-mask-paragraph, c-fill-paragraph): Fix | ||
| 4 | for the case that a C style comment has its delimiters alone on | ||
| 5 | their respective lines. | ||
| 6 | |||
| 1 | 2010-08-06 Michael Albinus <michael.albinus@gmx.de> | 7 | 2010-08-06 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 8 | ||
| 3 | * net/tramp.el (tramp-handle-start-file-process ): Set connection | 9 | * net/tramp.el (tramp-handle-start-file-process ): Set connection |
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 6d4479cb204..02fc3950a34 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el | |||
| @@ -4001,6 +4001,14 @@ command to conveniently insert and align the necessary backslashes." | |||
| 4001 | (goto-char ender-start) | 4001 | (goto-char ender-start) |
| 4002 | (current-column))) | 4002 | (current-column))) |
| 4003 | (point-rel (- ender-start here)) | 4003 | (point-rel (- ender-start here)) |
| 4004 | (sentence-ends-comment | ||
| 4005 | (save-excursion | ||
| 4006 | (goto-char ender-start) | ||
| 4007 | (and (search-backward-regexp | ||
| 4008 | (c-sentence-end) (c-point 'bol) t) | ||
| 4009 | (goto-char (match-end 0)) | ||
| 4010 | (looking-at "[ \t]*") | ||
| 4011 | (= (match-end 0) ender-start)))) | ||
| 4004 | spaces) | 4012 | spaces) |
| 4005 | 4013 | ||
| 4006 | (save-excursion | 4014 | (save-excursion |
| @@ -4043,7 +4051,9 @@ command to conveniently insert and align the necessary backslashes." | |||
| 4043 | (setq spaces | 4051 | (setq spaces |
| 4044 | (max | 4052 | (max |
| 4045 | (min spaces | 4053 | (min spaces |
| 4046 | (if sentence-end-double-space 2 1)) | 4054 | (if (and sentence-ends-comment |
| 4055 | sentence-end-double-space) | ||
| 4056 | 2 1)) | ||
| 4047 | 1))) | 4057 | 1))) |
| 4048 | ;; Insert the filler first to keep marks right. | 4058 | ;; Insert the filler first to keep marks right. |
| 4049 | (insert-char ?x spaces t) | 4059 | (insert-char ?x spaces t) |
| @@ -4253,8 +4263,11 @@ Optional prefix ARG means justify paragraph as well." | |||
| 4253 | (let ((fill-paragraph-function | 4263 | (let ((fill-paragraph-function |
| 4254 | ;; Avoid infinite recursion. | 4264 | ;; Avoid infinite recursion. |
| 4255 | (if (not (eq fill-paragraph-function 'c-fill-paragraph)) | 4265 | (if (not (eq fill-paragraph-function 'c-fill-paragraph)) |
| 4256 | fill-paragraph-function))) | 4266 | fill-paragraph-function)) |
| 4257 | (c-mask-paragraph t nil 'fill-paragraph arg)) | 4267 | (start-point (point-marker))) |
| 4268 | (c-mask-paragraph | ||
| 4269 | t nil (lambda () (fill-region-as-paragraph (point-min) (point-max) arg))) | ||
| 4270 | (goto-char start-point)) | ||
| 4258 | ;; Always return t. This has the effect that if filling isn't done | 4271 | ;; Always return t. This has the effect that if filling isn't done |
| 4259 | ;; above, it isn't done at all, and it's therefore effectively | 4272 | ;; above, it isn't done at all, and it's therefore effectively |
| 4260 | ;; disabled in normal code. | 4273 | ;; disabled in normal code. |