summaryrefslogtreecommitdiff
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-03-19 20:05:11 +0000
committerRichard M. Stallman <rms@gnu.org>1996-03-19 20:05:11 +0000
commit8fe03af30523e0b10956c5fc67b60a15c3eac08f (patch)
tree154e7d2974c98a89d1f2e14f30f5dca9f9908c03 /lisp/textmodes
parent70dc68a9fea45a34366198e35a0b0aac4ecb228b (diff)
downloademacs-8fe03af30523e0b10956c5fc67b60a15c3eac08f.tar.gz
(fill-region-as-paragraph): Fix the second check for
whether we reached the end of the paragraph.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/fill.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 152ccf96f2a..1ce82773f78 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -321,7 +321,9 @@ space does not end a sentence, so don't break a line there."
(forward-char -2)
(skip-chars-backward "^ \n" linebeg)))
;; If the left margin and fill prefix by themselves
- ;; pass the fill-column, keep at least one word.
+ ;; pass the fill-column. or if they are zero
+ ;; but we have no room for even one word,
+ ;; keep at least one word anyway.
;; This handles ALL BUT the first line of the paragraph.
(if (if (zerop prefixcol)
(save-excursion
@@ -371,7 +373,7 @@ space does not end a sentence, so don't break a line there."
(skip-chars-forward "^ \t\n")
(setq first nil))))
;; Check again to see if we got to the end of the paragraph.
- (if (eobp)
+ (if (save-excursion (skip-chars-forward " \t") (eobp))
(or nosqueeze (delete-horizontal-space))
;; Replace whitespace here with one newline, then indent to left
;; margin.