Mercurial > emacs
comparison lisp/textmodes/fill.el @ 14840:dfbf6fd50825
(fill-region-as-paragraph): Fix the second check for
whether we reached the end of the paragraph.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 19 Mar 1996 20:05:11 +0000 |
parents | 5d55577868da |
children | 9a31b0d0c38a |
comparison
equal
deleted
inserted
replaced
14839:bc1d2478d392 | 14840:dfbf6fd50825 |
---|---|
319 (not (eq (following-char) ?\ )) | 319 (not (eq (following-char) ?\ )) |
320 (eq (char-after (- (point) 2)) ?\.)) | 320 (eq (char-after (- (point) 2)) ?\.)) |
321 (forward-char -2) | 321 (forward-char -2) |
322 (skip-chars-backward "^ \n" linebeg))) | 322 (skip-chars-backward "^ \n" linebeg))) |
323 ;; If the left margin and fill prefix by themselves | 323 ;; If the left margin and fill prefix by themselves |
324 ;; pass the fill-column, keep at least one word. | 324 ;; pass the fill-column. or if they are zero |
325 ;; but we have no room for even one word, | |
326 ;; keep at least one word anyway. | |
325 ;; This handles ALL BUT the first line of the paragraph. | 327 ;; This handles ALL BUT the first line of the paragraph. |
326 (if (if (zerop prefixcol) | 328 (if (if (zerop prefixcol) |
327 (save-excursion | 329 (save-excursion |
328 (skip-chars-backward " \t" linebeg) | 330 (skip-chars-backward " \t" linebeg) |
329 (bolp)) | 331 (bolp)) |
369 (not (looking-at "\\. "))))))) | 371 (not (looking-at "\\. "))))))) |
370 (skip-chars-forward " \t") | 372 (skip-chars-forward " \t") |
371 (skip-chars-forward "^ \t\n") | 373 (skip-chars-forward "^ \t\n") |
372 (setq first nil)))) | 374 (setq first nil)))) |
373 ;; Check again to see if we got to the end of the paragraph. | 375 ;; Check again to see if we got to the end of the paragraph. |
374 (if (eobp) | 376 (if (save-excursion (skip-chars-forward " \t") (eobp)) |
375 (or nosqueeze (delete-horizontal-space)) | 377 (or nosqueeze (delete-horizontal-space)) |
376 ;; Replace whitespace here with one newline, then indent to left | 378 ;; Replace whitespace here with one newline, then indent to left |
377 ;; margin. | 379 ;; margin. |
378 (skip-chars-backward " \t") | 380 (skip-chars-backward " \t") |
379 (insert ?\n) | 381 (insert ?\n) |