Mercurial > emacs
comparison lisp/textmodes/fill.el @ 74962:7c208589663c
(fill-comment-paragraph): Document 2006-12-24 change.
Suggested by Stefan Monnier.
author | Michaël Cadilhac <michael.cadilhac@lrde.org> |
---|---|
date | Fri, 29 Dec 2006 21:39:08 +0000 |
parents | 4bbe5394a104 |
children | 827cbf161c8f bc10a33dd40b |
comparison
equal
deleted
inserted
replaced
74961:ce43a4d78919 | 74962:7c208589663c |
---|---|
836 ;; Narrow to include only the comment, and then fill the region. | 836 ;; Narrow to include only the comment, and then fill the region. |
837 (let* ((fill-prefix fill-prefix) | 837 (let* ((fill-prefix fill-prefix) |
838 (commark | 838 (commark |
839 (comment-string-strip (buffer-substring comstart comin) nil t)) | 839 (comment-string-strip (buffer-substring comstart comin) nil t)) |
840 (comment-re | 840 (comment-re |
841 ;; `commark' is surrounded with arbitrary text (`\0' and `a') | |
842 ;; to make sure it can be used as an optimization of | |
843 ;; `comment-start-skip' in the middle of a line. For example, | |
844 ;; `commark' can't be used with the "@c" in TeXinfo (hence | |
845 ;; the `a') or with the "C" at BOL in Fortran (hence the `\0'). | |
841 (if (string-match comment-start-skip (concat "\0" commark "a")) | 846 (if (string-match comment-start-skip (concat "\0" commark "a")) |
842 (concat "[ \t]*" (regexp-quote commark) | 847 (concat "[ \t]*" (regexp-quote commark) |
843 ;; Make sure we only match comments that use | 848 ;; Make sure we only match comments that use |
844 ;; the exact same comment marker. | 849 ;; the exact same comment marker. |
845 "[^" (substring commark -1) "]") | 850 "[^" (substring commark -1) "]") |
846 ;; If the commark needs to be followed by some special | |
847 ;; set of characters (like @c in TeXinfo), we can't | |
848 ;; rely just on `commark'. | |
849 (concat "[ \t]*\\(?:" comment-start-skip "\\)"))) | 851 (concat "[ \t]*\\(?:" comment-start-skip "\\)"))) |
850 (comment-fill-prefix ; Compute a fill prefix. | 852 (comment-fill-prefix ; Compute a fill prefix. |
851 (save-excursion | 853 (save-excursion |
852 (goto-char comstart) | 854 (goto-char comstart) |
853 (if has-code-and-comment | 855 (if has-code-and-comment |