From f2d0a4889766f0387f6423f52502ea4842f83846 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sun, 31 Oct 2010 22:06:08 +0100 Subject: [PATCH] Change default to all text/plain sections. --- lisp/ChangeLog | 7 +++++++ lisp/gnus-art.el | 6 +++--- lisp/gnus-cite.el | 20 +++++++++++++++++--- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f4ad138d2..4a1e12e0b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,14 @@ 2010-10-31 Lars Magne Ingebrigtsen + * 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"). diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 6d7779375..1fcdfa193 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -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. diff --git a/lisp/gnus-cite.el b/lisp/gnus-cite.el index 32dee46d0..afc78c33e 100644 --- a/lisp/gnus-cite.el +++ b/lisp/gnus-cite.el @@ -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 -- 2.25.1