summaryrefslogtreecommitdiff
path: root/lisp/textmodes/fill.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/textmodes/fill.el')
-rw-r--r--lisp/textmodes/fill.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 6fa26afa4f5..7f7a98e087a 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -855,7 +855,13 @@ can take care of filling. JUSTIFY is used as in `fill-paragraph'."
(goto-char comstart) (skip-chars-backward " \t")
(setq has-code-and-comment (not (bolp)))))
- (if (not comstart)
+ (if (not (and comstart
+ ;; Make sure the comment-start mark we found is accepted by
+ ;; comment-start-skip. If not, all bets are off, and
+ ;; we'd better not mess with it.
+ (string-match comment-start-skip
+ (buffer-substring comstart comin))))
+
;; Return nil, so the normal filling will take place.
nil