aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2002-10-03 23:01:51 +0000
committerStefan Monnier2002-10-03 23:01:51 +0000
commit3078db32227ef57e0f8d8677fc715d4d6119ff55 (patch)
treebe73cb9303f7776bcfd327ebc84b5a486a42f7c0
parent7b462fc6c48b205a4aa1e819cf28fce1eaeca63e (diff)
downloademacs-3078db32227ef57e0f8d8677fc715d4d6119ff55.tar.gz
emacs-3078db32227ef57e0f8d8677fc715d4d6119ff55.zip
(fill-paragraph): Give up if there's no paragraph at or after point.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/textmodes/fill.el26
2 files changed, 19 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 520a551bcbf..eb8bf3d0cf9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,10 @@
12002-10-03 Stefan Monnier <monnier@cs.yale.edu> 12002-10-03 Stefan Monnier <monnier@cs.yale.edu>
2 2
3 * textmodes/fill.el (fill-paragraph): Give up if there's no
4 paragraph at or after point.
5
6 * textmodes/paragraphs.el (forward-paragraph): Return the steps left.
7
3 * vc.el (vc-print-log): Unconditionally use `show-log-entry'. 8 * vc.el (vc-print-log): Unconditionally use `show-log-entry'.
4 (vc-default-show-log-entry): New fun. 9 (vc-default-show-log-entry): New fun.
5 10
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 8c5a8d35d1a..0bf4b3e5cef 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -697,18 +697,20 @@ If `fill-paragraph-function' is nil, return the `fill-prefix' used for filling."
697 ;; Fill prefix used for filling the paragraph. 697 ;; Fill prefix used for filling the paragraph.
698 fill-pfx) 698 fill-pfx)
699 (save-excursion 699 (save-excursion
700 (forward-paragraph) 700 (if (not (zerop (forward-paragraph)))
701 (or (bolp) (newline 1)) 701 ;; There's no paragraph at or after point: give up.
702 (let ((end (point)) 702 (setq fill-pfx "")
703 (beg (progn (backward-paragraph) (point)))) 703 (or (bolp) (newline 1))
704 (goto-char before) 704 (let ((end (point))
705 (setq fill-pfx 705 (beg (progn (backward-paragraph) (point))))
706 (if use-hard-newlines 706 (goto-char before)
707 ;; Can't use fill-region-as-paragraph, since this 707 (setq fill-pfx
708 ;; paragraph may still contain hard newlines. See 708 (if use-hard-newlines
709 ;; fill-region. 709 ;; Can't use fill-region-as-paragraph, since this
710 (fill-region beg end arg) 710 ;; paragraph may still contain hard newlines. See
711 (fill-region-as-paragraph beg end arg))))) 711 ;; fill-region.
712 (fill-region beg end arg)
713 (fill-region-as-paragraph beg end arg))))))
712 ;; See if point ended up inside the fill-prefix, and if so, move 714 ;; See if point ended up inside the fill-prefix, and if so, move
713 ;; past it. 715 ;; past it.
714 (skip-line-prefix fill-pfx) 716 (skip-line-prefix fill-pfx)