comparison lisp/textmodes/fill.el @ 80237:d2d9530e9b45

(fill-comment-paragraph): Don't try to do comment-paragraph filling if the commark doesn't match comment-start-skip.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 28 Feb 2008 22:29:03 +0000
parents dc100f64b2b7
children 76e75acf7e4e 4054054dd212
comparison
equal deleted inserted replaced
80236:15905daa91d3 80237:d2d9530e9b45
835 (when (setq comstart (comment-search-forward (line-end-position) t)) 835 (when (setq comstart (comment-search-forward (line-end-position) t))
836 (setq comin (point)) 836 (setq comin (point))
837 (goto-char comstart) (skip-chars-backward " \t") 837 (goto-char comstart) (skip-chars-backward " \t")
838 (setq has-code-and-comment (not (bolp))))) 838 (setq has-code-and-comment (not (bolp)))))
839 839
840 (if (not comstart) 840 (if (not (and comstart
841 ;; Make sure the comment-start mark we found is accepted by
842 ;; comment-start-skip. If not, all bets are off, and
843 ;; we'd better not mess with it.
844 (string-match comment-start-skip
845 (buffer-substring comstart comin))))
846
841 ;; Return nil, so the normal filling will take place. 847 ;; Return nil, so the normal filling will take place.
842 nil 848 nil
843 849
844 ;; Narrow to include only the comment, and then fill the region. 850 ;; Narrow to include only the comment, and then fill the region.
845 (let* ((fill-prefix fill-prefix) 851 (let* ((fill-prefix fill-prefix)