From: Alan Mackenzie Date: Wed, 3 Jan 2007 20:19:29 +0000 (+0000) Subject: (c-mask-paragraph): Fix yesterday's buggy patch. X-Git-Tag: emacs-pretest-22.0.93~268 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fd85cfb794803919757d48ad185f11974dd0c903;p=emacs.git (c-mask-paragraph): Fix yesterday's buggy patch. --- 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.