diff options
| author | Richard M. Stallman | 1995-01-20 23:06:06 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-01-20 23:06:06 +0000 |
| commit | 7112bf0f2a1ab3fc16f4234088247e3f56e2ac2b (patch) | |
| tree | 1e93dcc87910443774428c5b94b4ecb9f527dd1b /lisp | |
| parent | 53ea07e1a2cefe463103adf5c4f74dc9570aade1 (diff) | |
| download | emacs-7112bf0f2a1ab3fc16f4234088247e3f56e2ac2b.tar.gz emacs-7112bf0f2a1ab3fc16f4234088247e3f56e2ac2b.zip | |
(fill-region-as-paragraph): At end, advance over any newlines
that were in the region but excluded from filling.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/textmodes/fill.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 535323e9f18..3e703fcf31b 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el | |||
| @@ -134,7 +134,8 @@ space does not end a sentence, so don't break a line there." | |||
| 134 | (or justify (setq justify (current-justification))) | 134 | (or justify (setq justify (current-justification))) |
| 135 | 135 | ||
| 136 | ;; Don't let Adaptive Fill mode alter the fill prefix permanently. | 136 | ;; Don't let Adaptive Fill mode alter the fill prefix permanently. |
| 137 | (let ((fill-prefix fill-prefix)) | 137 | (let ((fill-prefix fill-prefix) |
| 138 | (skip-after 0)) | ||
| 138 | ;; Figure out how this paragraph is indented, if desired. | 139 | ;; Figure out how this paragraph is indented, if desired. |
| 139 | (if (and adaptive-fill-mode | 140 | (if (and adaptive-fill-mode |
| 140 | (or (null fill-prefix) (string= fill-prefix ""))) | 141 | (or (null fill-prefix) (string= fill-prefix ""))) |
| @@ -172,6 +173,9 @@ space does not end a sentence, so don't break a line there." | |||
| 172 | (setq beg (point)) | 173 | (setq beg (point)) |
| 173 | (goto-char (max from to)) | 174 | (goto-char (max from to)) |
| 174 | (skip-chars-backward "\n") | 175 | (skip-chars-backward "\n") |
| 176 | (setq skip-after (- to (point))) | ||
| 177 | ;; If we omit some final newlines from the end of the narrowing, | ||
| 178 | ;; arrange to advance past them at the end. | ||
| 175 | (setq to (point) | 179 | (setq to (point) |
| 176 | from beg) | 180 | from beg) |
| 177 | (goto-char from) | 181 | (goto-char from) |
| @@ -307,7 +311,8 @@ space does not end a sentence, so don't break a line there." | |||
| 307 | (justify-current-line justify t t) | 311 | (justify-current-line justify t t) |
| 308 | (forward-line -1) | 312 | (forward-line -1) |
| 309 | (justify-current-line justify nil t) | 313 | (justify-current-line justify nil t) |
| 310 | (forward-line 1))))))))) | 314 | (forward-line 1)))))) |
| 315 | (forward-char skip-after)))) | ||
| 311 | 316 | ||
| 312 | (defun fill-paragraph (arg) | 317 | (defun fill-paragraph (arg) |
| 313 | "Fill paragraph at or after point. Prefix arg means justify as well. | 318 | "Fill paragraph at or after point. Prefix arg means justify as well. |