changeset 52023:ba56926bf332

(fill-comment-paragraph): Construct a regexp to match the specific mark rather than reusing comment-start-skip.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 22 Jul 2003 20:39:22 +0000
parents 160339bd4e73
children 7bf3df75abf7
files lisp/textmodes/fill.el
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/fill.el	Tue Jul 22 20:07:04 2003 +0000
+++ b/lisp/textmodes/fill.el	Tue Jul 22 20:39:22 2003 +0000
@@ -1,6 +1,6 @@
 ;;; fill.el --- fill commands for Emacs
 
-;; Copyright (C) 1985,86,92,94,95,96,97,1999,2001,2002
+;; Copyright (C) 1985,86,92,94,95,96,97,1999,2001,02,2003
 ;;               Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -785,7 +785,18 @@
 
       ;; Narrow to include only the comment, and then fill the region.
       (let* ((fill-prefix fill-prefix)
-	     (comment-re (concat "[ \t]*\\(?:" comment-start-skip "\\)"))
+	     (commark
+	      (comment-string-strip (buffer-substring comstart comin) nil t))
+	     (comment-re
+	      (if (string-match comment-start-skip (concat commark "a"))
+		  (concat "[ \t]*" (regexp-quote commark)
+			  ;; Make sure we only match comments that use
+			  ;; the exact same comment marker.
+			  "[^" (substring commark -1) "]")
+		;; If the commark needs to be followed by some special
+		;; set of characters (like @c in TeXinfo), we can't
+		;; rely just on `commark'.
+		(concat "[ \t]*\\(?:" comment-start-skip "\\)")))
 	     (comment-fill-prefix	; Compute a fill prefix.
 	      (save-excursion
 		(goto-char comstart)