From fd85cfb794803919757d48ad185f11974dd0c903 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Wed, 3 Jan 2007 20:19:29 +0000 Subject: (c-mask-paragraph): Fix yesterday's buggy patch. --- lisp/progmodes/cc-cmds.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lisp/progmodes/cc-cmds.el') diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 04008acdbe..e7bea0e0b2 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. -- cgit v1.2.3