diff options
author | Alan Mackenzie <acm@muc.de> | 2007-01-03 20:19:29 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2007-01-03 20:19:29 +0000 |
commit | fd85cfb794803919757d48ad185f11974dd0c903 (patch) | |
tree | 644cae447c89778bc7cdf8dd26a2c5be42068ae9 /lisp | |
parent | 23f74f538c65b124f318e6453e1c2407546aeb7a (diff) | |
download | emacs-fd85cfb794803919757d48ad185f11974dd0c903.tar.gz |
(c-mask-paragraph): Fix yesterday's buggy patch.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/progmodes/cc-cmds.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 04008acdbe2..e7bea0e0b29 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -3836,8 +3836,13 @@ command to conveniently insert and align the necessary backslashes." (setq apply-outside-literal t)) ((eq c-lit-type 'c) ; Block comment. - (when (and (>= end (cdr c-lit-limits)) - (> (point-max) (cdr c-lit-limits))) + (when + (or (> end (cdr c-lit-limits)) + (and (= end (cdr c-lit-limits)) + (eq (char-before end) ?/) + (eq (char-before (1- end)) ?*) + ;; disallow "/*/" + (> (- (cdr c-lit-limits) (car c-lit-limits)) 3))) ;; There is a comment ender, and the region includes it. If ;; it's on its own line, it stays on its own line. If it's got ;; company on the line, it keeps (at least one word of) it. |