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

Re: Article "Washing?"



On Mon, Mar 22, 2010 at 11:11 AM, David Abrahams <dave@boostpro.com> wrote:
> At Wed, 6 Jan 2010 16:39:52 -0500,
> Per B. Sederberg wrote:
>>
>> On Wed, Jan 6, 2010 at 4:03 PM, David Abrahams <dave@boostpro.com>
>> wrote:
>>
>> 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)
>
>
> Per,
>
> I finally got around to trying this, and it's wonderful!  Thanks very
> much for posting it.
>


No problem!  I guess this is the kind of thing that should eventually
get into the wiki or some other form of documentation...  Do you think
it should go on the EmacsWiki page in the meantime?

Also, I wish I could find the person who posted the code, so we could
give proper credit, so to those on the list reading this, if this is
your hack, please speak up!

Best,
Per


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