Change default to all text/plain sections.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 31 Oct 2010 21:06:08 +0000 (22:06 +0100)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 31 Oct 2010 21:06:08 +0000 (22:06 +0100)
lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-cite.el

index f4ad138..4a1e12e 100644 (file)
@@ -1,7 +1,14 @@
 2010-10-31  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-art.el (gnus-treatment-function-alist): Have
+       gnus-treat-fill-long-lines point to gnus-article-fill-cited-long-lines.
+       (gnus-treat-fill-long-lines): Change default to fill all text/plain
+       sections.
+
        * gnus-cite.el (gnus-article-fill-cited-article): Remove unused `force'
        parameter.
+       (gnus-article-fill-cited-long-lines): New function.
+       (gnus-article-fill-cited-article): Allow filling only long sections.
 
        * shr.el (shr-find-fill-point): Don't break lines between punctuation
        and non-punctuation (like after the apostrophe in "'We").
index 6d77793..1fcdfa1 100644 (file)
@@ -1590,7 +1590,7 @@ predicate.  See Info node `(gnus)Customizing Articles'."
   :link '(custom-manual "(gnus)Customizing Articles")
   :type gnus-article-treat-custom)
 
-(defcustom gnus-treat-fill-long-lines nil
+(defcustom gnus-treat-fill-long-lines '(typep "text/plain")
   "Fill long lines.
 Valid values are nil, t, `head', `first', `last', an integer or a
 predicate.  See Info node `(gnus)Customizing Articles'."
@@ -1664,7 +1664,7 @@ regexp."
     (gnus-treat-highlight-signature gnus-article-highlight-signature)
     (gnus-treat-buttonize gnus-article-add-buttons)
     (gnus-treat-fill-article gnus-article-fill-cited-article)
-    (gnus-treat-fill-long-lines gnus-article-fill-long-lines)
+    (gnus-treat-fill-long-lines gnus-article-fill-cited-long-lines)
     (gnus-treat-strip-cr gnus-article-remove-cr)
     (gnus-treat-unsplit-urls gnus-article-unsplit-urls)
     (gnus-treat-date-ut gnus-article-date-ut)
@@ -5704,7 +5704,7 @@ all parts."
          (save-restriction
            (article-goto-body)
            (narrow-to-region (point) (point-max))
-           (gnus-treat-article nil 1 1)
+           (gnus-treat-article nil 1 1 "text/plain")
            (widen)))
        (unless ihandles
          ;; Highlight the headers.
index 32dee46..afc78c3 100644 (file)
@@ -516,9 +516,14 @@ Lines matching `gnus-cite-attribution-suffix' and perhaps
            (setq m (cdr m))))
        marks))))
 
-(defun gnus-article-fill-cited-article (&optional width)
+(defun gnus-article-fill-cited-long-lines ()
+  (gnus-article-fill-cited-article nil t))
+
+(defun gnus-article-fill-cited-article (&optional width long-lines)
   "Do word wrapping in the current article.
-If WIDTH (the numerical prefix), use that text width when filling."
+If WIDTH (the numerical prefix), use that text width when
+filling.  If LONG-LINES, only fill sections that have lines
+longer than the frame width."
   (interactive "P")
   (with-current-buffer gnus-article-buffer
     (let ((buffer-read-only nil)
@@ -535,8 +540,17 @@ If WIDTH (the numerical prefix), use that text width when filling."
                (fill-prefix
                 (if (string= (cdar marks) "") ""
                   (concat (cdar marks) " ")))
+               (do-fill (not long-lines))
                use-hard-newlines)
-           (fill-region (point-min) (point-max)))
+           (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)))
+           (when do-fill
+             (fill-region (point-min) (point-max))))
          (set-marker (caar marks) nil)
          (setq marks (cdr marks)))
        (when marks