[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Article "Washing?"



On Wed, Jan 6, 2010 at 4:03 PM, David Abrahams <dave@boostpro.com> wrote:
>
> There's an awesome set of features, called “article washing,” in Gnus
> that I really miss in WL.  It's basically a filter that transforms the
> message you're reading for the purposes of display.  One of the most
> indispensable washes is called "Outlook Deuglify" --- it fixes up all
> the common problems with email sent by MS Outlook users.  Another that
> I really wanted today, simply wraps long lines.  Is there anything
> like that available in WL?
>

I've been using this code that I think I received from someone on the
list (I couldn't find the original email):

;; Re-fill messages that arrive poorly formatted
(require 'filladapt)
(defun wl-summary-fill-message (all)
  (interactive "P")
  (if (and wl-message-buffer (get-buffer-window wl-message-buffer))
      (progn
        (wl-summary-toggle-disp-msg 'on)
        (save-excursion
          (set-buffer wl-message-buffer)
          (goto-char (point-min))
          (re-search-forward "^$")
          (while (or (looking-at "^\\[[1-9]") (looking-at "^$"))
            (forward-line 1))
          (let* ((buffer-read-only nil)
                 (find (lambda (regexp)
                         (save-excursion
                           (if (re-search-forward regexp nil t)
                               (match-beginning 0)
                             (point-max)))))
                 (start (point))
                 (end (if all
                          (point-max)
                        (min (funcall find "^[^>\n]* wrote:[ \n]+")
                             (funcall find "^>>>>>")
                             (funcall find "^ *>.*\n *>")
                             (funcall find "^-----Original Message-----")))))
            (save-restriction
              (narrow-to-region start end)
              (filladapt-mode 1)
              (fill-region (point-min) (point-max)))))
        (message "Message re-filled"))
    (message "No message to re-fill")))

(define-key wl-summary-mode-map "\M-q" 'wl-summary-fill-message)




> TIA,
>
> --
> Dave Abrahams           Meet me at BoostCon: http://www.boostcon.com
> BoostPro Computing
> http://www.boostpro.com
>
>
>