summaryrefslogtreecommitdiff
path: root/lisp/textmodes/fill.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2008-02-28 22:29:03 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2008-02-28 22:29:03 +0000
commit6fdf31e773024c213e94859cd3b6d3b9ba78a2e6 (patch)
tree2f86326092f3324b4c11b8f67126d06186b030ee /lisp/textmodes/fill.el
parent5e72dc345a086fd65bbe8e04767f56c4510ecc8b (diff)
downloademacs-6fdf31e773024c213e94859cd3b6d3b9ba78a2e6.tar.gz
(fill-comment-paragraph): Don't try to do comment-paragraph filling
if the commark doesn't match comment-start-skip.
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 8c563656275..418d7c17dc2 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -837,7 +837,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