1 |
;;; fill.el --- fill commands for Emacs |
;;; fill.el --- fill commands for Emacs |
2 |
|
|
3 |
;; 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 |
4 |
;; Free Software Foundation, Inc. |
;; Free Software Foundation, Inc. |
5 |
|
|
6 |
;; Maintainer: FSF |
;; Maintainer: FSF |
785 |
|
|
786 |
;; Narrow to include only the comment, and then fill the region. |
;; Narrow to include only the comment, and then fill the region. |
787 |
(let* ((fill-prefix fill-prefix) |
(let* ((fill-prefix fill-prefix) |
788 |
(comment-re (concat "[ \t]*\\(?:" comment-start-skip "\\)")) |
(commark |
789 |
|
(comment-string-strip (buffer-substring comstart comin) nil t)) |
790 |
|
(comment-re |
791 |
|
(if (string-match comment-start-skip (concat commark "a")) |
792 |
|
(concat "[ \t]*" (regexp-quote commark) |
793 |
|
;; Make sure we only match comments that use |
794 |
|
;; the exact same comment marker. |
795 |
|
"[^" (substring commark -1) "]") |
796 |
|
;; If the commark needs to be followed by some special |
797 |
|
;; set of characters (like @c in TeXinfo), we can't |
798 |
|
;; rely just on `commark'. |
799 |
|
(concat "[ \t]*\\(?:" comment-start-skip "\\)"))) |
800 |
(comment-fill-prefix ; Compute a fill prefix. |
(comment-fill-prefix ; Compute a fill prefix. |
801 |
(save-excursion |
(save-excursion |
802 |
(goto-char comstart) |
(goto-char comstart) |