summaryrefslogtreecommitdiff
path: root/lisp/textmodes/fill.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2006-11-07 23:22:48 +0000
committerMiles Bader <miles@gnu.org>2006-11-07 23:22:48 +0000
commitdbc3b08c405a7b1c0ddb0fb0c98164b355802af5 (patch)
tree00c6f28244409d14bec11e221fb3c03daef63fc6 /lisp/textmodes/fill.el
parentbbb6e8f2b6037dc1ee4ddd6cb63a1a6ddb04a591 (diff)
parent86cb14475e9e76f0b3323d2e7110a4a2bd310cdb (diff)
downloademacs-dbc3b08c405a7b1c0ddb0fb0c98164b355802af5.tar.gz
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 490-504) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 161-163) - Update from CVS - Merge from emacs--devo--0 Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-130
Diffstat (limited to 'lisp/textmodes/fill.el')
-rw-r--r--lisp/textmodes/fill.el15
1 files changed, 13 insertions, 2 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 1ef6783e341..6aae79a825f 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -746,6 +746,12 @@ space does not end a sentence, so don't break a line there."
(looking-at (regexp-quote prefix))))
(goto-char (match-end 0))))
+(defun fill-minibuffer-function (arg)
+ "Fill a paragraph in the minibuffer, ignoring the prompt."
+ (save-restriction
+ (narrow-to-region (minibuffer-prompt-end) (point-max))
+ (fill-paragraph arg)))
+
(defun fill-paragraph (arg)
"Fill paragraph at or after point. Prefix ARG means justify as well.
If `sentence-end-double-space' is non-nil, then period followed by one
@@ -760,8 +766,13 @@ If `fill-paragraph-function' is nil, return the `fill-prefix' used for filling."
(barf-if-buffer-read-only)
(list (if current-prefix-arg 'full))))
;; First try fill-paragraph-function.
- (or (and fill-paragraph-function
- (let ((function fill-paragraph-function)
+ (or (and (or fill-paragraph-function
+ (and (window-minibuffer-p (selected-window))
+ (= 1 (point-min))))
+ (let ((function (or fill-paragraph-function
+ ;; In the minibuffer, don't count the width
+ ;; of the prompt.
+ 'fill-minibuffer-function))
;; If fill-paragraph-function is set, it probably takes care
;; of comments and stuff. If not, it will have to set
;; fill-paragraph-handle-comment back to t explicitly or