aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2007-01-02 20:54:10 +0000
committerAlan Mackenzie2007-01-02 20:54:10 +0000
commite6a24f43fd2e84b12f4c492e5b944e9fce2c21d1 (patch)
tree090f182c2bff4330f4a393647855afb40ef37102
parent10ad749b1291fd25a17cf7a633eceeb428ab2eb8 (diff)
downloademacs-e6a24f43fd2e84b12f4c492e5b944e9fce2c21d1.tar.gz
emacs-e6a24f43fd2e84b12f4c492e5b944e9fce2c21d1.zip
(c-mask-paragraph): In a block comment, check that the "*/" is present
before trying to manipulate the "*/".
-rw-r--r--lisp/progmodes/cc-cmds.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 063cfe89777..04008acdbe2 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -3750,7 +3750,7 @@ command to conveniently insert and align the necessary backslashes."
3750 ;; Note that this function does not do any hidden buffer changes. 3750 ;; Note that this function does not do any hidden buffer changes.
3751 3751
3752 (let (fill 3752 (let (fill
3753 ;; beg and end limits the region to narrow. end is a marker. 3753 ;; beg and end limit the region to narrow. end is a marker.
3754 beg end 3754 beg end
3755 ;; tmp-pre and tmp-post mark strings that are temporarily 3755 ;; tmp-pre and tmp-post mark strings that are temporarily
3756 ;; inserted at the start and end of the region. tmp-pre is a 3756 ;; inserted at the start and end of the region. tmp-pre is a
@@ -3836,12 +3836,13 @@ command to conveniently insert and align the necessary backslashes."
3836 (setq apply-outside-literal t)) 3836 (setq apply-outside-literal t))
3837 3837
3838 ((eq c-lit-type 'c) ; Block comment. 3838 ((eq c-lit-type 'c) ; Block comment.
3839 (when (>= end (cdr c-lit-limits)) 3839 (when (and (>= end (cdr c-lit-limits))
3840 ;; The region includes the comment ender. If it's on its own 3840 (> (point-max) (cdr c-lit-limits)))
3841 ;; line, it stays on its own line. If it's got company on the 3841 ;; There is a comment ender, and the region includes it. If
3842 ;; line, it keeps (at least one word of) it. "=====*/" counts 3842 ;; it's on its own line, it stays on its own line. If it's got
3843 ;; as a comment ender here, but "===== */" doesn't and "foo*/" 3843 ;; company on the line, it keeps (at least one word of) it.
3844 ;; doesn't. 3844 ;; "=====*/" counts as a comment ender here, but "===== */"
3845 ;; doesn't and "foo*/" doesn't.
3845 (unless 3846 (unless
3846 (save-excursion 3847 (save-excursion
3847 (goto-char (cdr c-lit-limits)) 3848 (goto-char (cdr c-lit-limits))