Home Contact Download

asyd.net

Welcome to Bruno Bonfils's (aka asyd homepage).

Gnus

Few months ago, I switch from gnus to Evolution at work, mainly for contact management and calendar stuff. Even if bbdb is cool, I prefer sometimes a GUI. These day, I take the decision to switch from mutt to Gnus for my personal usage. I like to be able to read news (usenet) and mail from the same software, maybe I'm wrong, but it's the samething for me. That is why I didn't want configure a new tool (slrn ?) while I was more or less happy with mutt.

Anyway, I now switched to gnus, and after lost few hours to configure/tweak it, it's very nice. Though, I need to hack the mail reply function to overwrite the To: header (and remove the Cc: one) with the To-List group parameter when it defined.

(defun replace-recipients ()
  (message-remove-header "To")
  (goto-char 0)
  (message-add-header (concat "To: " (gnus-parameter-to-list gnus-newsgroup-name)))
  (message-remove-header "cc")
  )
 
;; Fonction de réponse
(defun my-mail-reply ()
  "Followup (with original) reply, reformat original, replace To: (and remove Cc:)
   if to-list group paramer is defined, useful for mailing list without Reply-To header."
  (interactive)
  (gnus-summary-followup-with-original 1)
  (save-excursion
    (if (gnus-parameter-to-list gnus-newsgroup-name)
        (replace-recipients))
    (goto-char (point-min))
    ;; On reformate le paragraphe
    (let*
        ;; selection
        (
         ;; debut du mail
         (result (search-forward-regexp "^--text follows this line--$" nil t))
         (first-match (and result (+ 1 (match-end 0))))
         ;; signature
         (result (search-forward-regexp "^-- $" nil t))
         (second-match (and result (match-beginning 0) ))
         )
      ;; formatage
      (fill-individual-paragraphs first-match second-match)
      )
    )
  )