From 50ef8ff26774972fd045cb021ebbb4ff9719df62 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 22 Jul 2003 20:40:38 +0000 Subject: [PATCH] (fill-comment-paragraph): Construct a regexp to match the specific mark rather than reusing comment-start-skip. --- lisp/ChangeLog | 20 +++++++++++--------- lisp/textmodes/fill.el | 15 +++++++++++++-- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ad5fb2f2aca..0c9da08d7bf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2003-07-22 Stefan Monnier + + * textmodes/fill.el (fill-comment-paragraph): Construct a regexp + to match the specific mark rather than reusing comment-start-skip. + 2003-07-22 Thien-Thi Nguyen * progmodes/hideshow.el (hs-special-modes-alist): @@ -29,8 +34,8 @@ 2003-07-21 Kenichi Handa - * international/quail.el (quail-translate-key): Update - quail-current-str correctly. + * international/quail.el (quail-translate-key): + Update quail-current-str correctly. 2003-07-21 Andreas Schwab @@ -40,7 +45,7 @@ 2003-07-20 Kai Gro,A_(Bjohann Version 2.0.36 of Tramp released. - * net/tramp.el (tramp-default-password-end-of-line): Renamed from + * net/tramp.el (tramp-default-password-end-of-line): Rename from tramp-password-end-of-line. (tramp-password-end-of-line): New method parameter. (tramp-get-password-end-of-line): Function to access method @@ -56,13 +61,11 @@ insert-file-contents. This fixes finding remote CVS-controlled files. (It would barf on inserting the CVS/Entries file literally, because the file-local-copy handler wasn't called.) - (tramp-handle-shell-command): Support optional third arg - ERROR-BUFFER. + (tramp-handle-shell-command): Support optional third arg ERROR-BUFFER. (tramp-sh-extra-args): Adapt defcustom type to XEmacs. (tramp-initial-commands): New variable. (tramp-process-initial-commands): New function, using the variable. - (tramp-open-connection-setup-interactive-shell): Call the new - function. + (tramp-open-connection-setup-interactive-shell): Call the new function. (tramp-buffer-name, tramp-debug-buffer-name): Always put the method into the buffer name, never use nil. Reported by Hanak David . @@ -73,8 +76,7 @@ 2003-07-19 Markus Rost - * textmodes/artist.el (artist-erase-char): Fix default value using - ?\s. + * textmodes/artist.el (artist-erase-char): Fix default value using ?\s. 2003-07-19 John Paul Wallington diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 348c73a0ce5..c8e635268eb 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -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 @@ can take care of filling. JUSTIFY is used as in `fill-paragraph'." ;; 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) -- 2.11.4.GIT