X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fgnus-cite.el;h=69d64366de186769ab9f988efe7065ca0a29dca6;hb=927cc9daf685365b19b5757522b6b4154b5d2d1f;hp=a010a833e9d593e4d594ceba8f3154faf8efbcbd;hpb=0d4d6534c6e74b4aadd62c2fac02a440a4aeaeba;p=gnus diff --git a/lisp/gnus-cite.el b/lisp/gnus-cite.el index a010a833e..69d64366d 100644 --- a/lisp/gnus-cite.el +++ b/lisp/gnus-cite.el @@ -544,8 +544,20 @@ longer than the frame width." use-hard-newlines) (unless do-fill (setq do-fill (gnus-article-foldable-buffer (cdar marks)))) + ;; Note: the XEmacs version of `fill-region' inserts a newline + ;; unless the region ends with a newline. (when do-fill - (fill-region (point-min) (point-max)))) + (if (not long-lines) + (fill-region (point-min) (point-max)) + (goto-char (point-min)) + (while (not (eobp)) + (end-of-line) + (when (prog1 + (> (current-column) (window-width)) + (forward-line 1)) + (save-restriction + (narrow-to-region (line-beginning-position 0) (point)) + (fill-region (point-min) (point-max)))))))) (set-marker (caar marks) nil) (setq marks (cdr marks))) (when marks @@ -562,7 +574,8 @@ longer than the frame width." columns) (goto-char (point-min)) (while (not (eobp)) - (forward-char (length prefix)) + (unless (> (length prefix) (- (point-max) (point))) + (forward-char (length prefix))) (skip-chars-forward " \t") (unless (eolp) (let ((elem (assq (current-column) columns))) @@ -571,7 +584,7 @@ longer than the frame width." (push elem columns)) (setcdr elem (1+ (cdr elem))))) (end-of-line) - (when (> (current-column) (frame-width)) + (when (> (current-column) (window-width)) (setq do-fill t)) (forward-line 1)) (and do-fill @@ -586,7 +599,7 @@ longer than the frame width." (and ;; The line is long. (> (- (line-end-position) (line-beginning-position)) - (frame-width)) + (window-width)) ;; It doesn't start with spaces. (not (looking-at " ")) ;; Not cited text.