diff options
| author | Richard M. Stallman | 1999-09-08 07:50:19 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-09-08 07:50:19 +0000 |
| commit | ea9ae18a5585a0e2900deab527d29ed9676635f3 (patch) | |
| tree | 0241414b46de031f2787d3bf7cd374b4f8c9fb59 | |
| parent | b89d72a18a7211ffb0ffd25c2b423dd553f4cc5f (diff) | |
| download | emacs-ea9ae18a5585a0e2900deab527d29ed9676635f3.tar.gz emacs-ea9ae18a5585a0e2900deab527d29ed9676635f3.zip | |
(fill-region-as-paragraph, canonically-space-region):
Respect colon-double-space at end of line.
| -rw-r--r-- | lisp/textmodes/fill.el | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 129fd42986a..b622d55e092 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el | |||
| @@ -175,12 +175,15 @@ Remove indentation from each line." | |||
| 175 | ;; Make sure sentences ending at end of line get an extra space. | 175 | ;; Make sure sentences ending at end of line get an extra space. |
| 176 | ;; loses on split abbrevs ("Mr.\nSmith") | 176 | ;; loses on split abbrevs ("Mr.\nSmith") |
| 177 | (goto-char beg) | 177 | (goto-char beg) |
| 178 | (while (and (< (point) end) | 178 | (let ((eol-double-space-re (if colon-double-space |
| 179 | (re-search-forward "[.?!][])}\"']*$" end t)) | 179 | "[.?!:][])}\"']*$" |
| 180 | "[.?!][])}\"']*$"))) | ||
| 181 | (while (and (< (point) end) | ||
| 182 | (re-search-forward eol-double-space-re end t)) | ||
| 180 | ;; We insert before markers in case a caller such as | 183 | ;; We insert before markers in case a caller such as |
| 181 | ;; do-auto-fill has done a save-excursion with point at the end | 184 | ;; do-auto-fill has done a save-excursion with point at the end |
| 182 | ;; of the line and wants it to stay at the end of the line. | 185 | ;; of the line and wants it to stay at the end of the line. |
| 183 | (insert-before-markers-and-inherit ? )))) | 186 | (insert-before-markers-and-inherit ? ))))) |
| 184 | 187 | ||
| 185 | (defun fill-context-prefix (from to &optional first-line-regexp) | 188 | (defun fill-context-prefix (from to &optional first-line-regexp) |
| 186 | "Compute a fill prefix from the text between FROM and TO. | 189 | "Compute a fill prefix from the text between FROM and TO. |
| @@ -422,8 +425,11 @@ space does not end a sentence, so don't break a line there." | |||
| 422 | 425 | ||
| 423 | ;; Make sure sentences ending at end of line get an extra space. | 426 | ;; Make sure sentences ending at end of line get an extra space. |
| 424 | ;; loses on split abbrevs ("Mr.\nSmith") | 427 | ;; loses on split abbrevs ("Mr.\nSmith") |
| 425 | (while (re-search-forward "[.?!][])}\"']*$" nil t) | 428 | (let ((eol-double-space-re (if colon-double-space |
| 426 | (or (eobp) (insert-and-inherit ?\ ))) | 429 | "[.?!:][])}\"']*$" |
| 430 | "[.?!][])}\"']*$"))) | ||
| 431 | (while (re-search-forward eol-double-space-re nil t) | ||
| 432 | (or (eobp) (insert-and-inherit ?\ )))) | ||
| 427 | 433 | ||
| 428 | (goto-char from) | 434 | (goto-char from) |
| 429 | (if enable-multibyte-characters | 435 | (if enable-multibyte-characters |