summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-cite.el
diff options
context:
space:
mode:
authorKatsumi Yamaoka <yamaoka@jpl.org>2010-11-02 02:19:52 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2010-11-02 02:19:52 +0000
commitf939acf1431a873262b5bc14d4f9c4c84704a37e (patch)
tree2227060c2dcabdb6cb96d404b5f394ca03990ab7 /lisp/gnus/gnus-cite.el
parent0f75c62ae368984e9379a13233dd9c443ea57bdd (diff)
downloademacs-f939acf1431a873262b5bc14d4f9c4c84704a37e.tar.gz
gnus-cite.el (gnus-article-fill-cited-article): Make fill work properly for XEmacs as well.
gnus-cite.el (gnus-article-fill-cited-article, gnus-article-foldable-buffer, gnus-article-natural-long-line-p): Use window-width rather than frame-width.
Diffstat (limited to 'lisp/gnus/gnus-cite.el')
-rw-r--r--lisp/gnus/gnus-cite.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/gnus/gnus-cite.el b/lisp/gnus/gnus-cite.el
index c99cb5cf2e3..69d64366de1 100644
--- a/lisp/gnus/gnus-cite.el
+++ b/lisp/gnus/gnus-cite.el
@@ -544,17 +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
(if (not long-lines)
(fill-region (point-min) (point-max))
(goto-char (point-min))
(while (not (eobp))
(end-of-line)
- (when (> (current-column) (frame-width))
+ (when (prog1
+ (> (current-column) (window-width))
+ (forward-line 1))
(save-restriction
- (narrow-to-region (line-beginning-position) (point))
- (fill-region (point-min) (point-max))))
- (forward-line 1)))))
+ (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
@@ -581,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
@@ -596,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.