* gnus-cite.el (gnus-article-foldable-buffer): Refactor out.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 31 Oct 2010 21:38:04 +0000 (22:38 +0100)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 31 Oct 2010 21:38:04 +0000 (22:38 +0100)
lisp/ChangeLog
lisp/gnus-cite.el

index 5f45093..02af2a0 100644 (file)
@@ -1,5 +1,7 @@
 2010-10-31  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-cite.el (gnus-article-foldable-buffer): Refactor out.
+
        * gnus-sum.el (gnus-summary-show-article): Add `C-u C-u g' for showing
        the raw article, and change `C-u g' to show the article without doing
        treatments.
index afc78c3..c8de7a6 100644 (file)
@@ -542,13 +542,8 @@ longer than the frame width."
                   (concat (cdar marks) " ")))
                (do-fill (not long-lines))
                use-hard-newlines)
-           (goto-char (point-min))
            (unless do-fill
-             (while (not (eobp))
-               (end-of-line)
-               (when (> (current-column) (frame-width))
-                 (setq do-fill t))
-               (forward-line 1)))
+             (setq do-fill (gnus-article-foldable-buffer)))
            (when do-fill
              (fill-region (point-min) (point-max))))
          (set-marker (caar marks) nil)
@@ -562,6 +557,15 @@ longer than the frame width."
              gnus-cite-loose-attribution-alist nil
              gnus-cite-article nil)))))
 
+(defun gnus-article-foldable-buffer ()
+  (goto-char (point-min))
+  (while (not (eobp))
+    (end-of-line)
+    (when (> (current-column) (frame-width))
+      (setq do-fill t))
+    (forward-line 1))
+  do-fill)
+
 (defun gnus-article-natural-long-line-p ()
   "Return true if the current line is long, and it's natural text."
   (save-excursion