Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Follow up to group for mailing lists
@ 2012-09-09 20:06 Cecil Westerhof
  2012-09-09 21:16 ` Charles Philip Chan
       [not found] ` <mailman.8476.1347225384.855.info-gnus-english@gnu.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Cecil Westerhof @ 2012-09-09 20:06 UTC (permalink / raw)
  To: info-gnus-english

A lot of mailing lists do not set the reply-to to the mailing list. It
is considered evil, but I like it. But lets not get into a discussion
about that.

The only way to get the email to the mailing list is a wide follow up,
but then the sender gets an email from me and from the mailing list.
That is why I made follow up only going to the mailing list. (With
reply I still can reply to the author.)

I defined a 'tuple':
    (setq dcbl-gnus-mailing-lists '(
                                    ("INBOX.Info.bbdb"               . "bbdb-info@lists.sourceforge.net")
                                    .
                                    .
                                    .
                                    ("bedrijf/ontwikkeling/scala"    . "scala-user@googlegroups.com")
                                    ))


I made the following advice:
    (defadvice gnus-summary-followup-with-original (after formalities () activate)
      (let ((to-address (dcbl-gnus-get-mailing-list-address)))
        (when to-address
          (when (message-fetch-field "To")
            (message-goto-to)
            (message-beginning-of-line)
            (kill-line))
          (when (message-fetch-field "Cc")
            (message-goto-cc)
            (message-beginning-of-line)
            (message-beginning-of-line)
            (kill-line)
            (kill-line))
          (dcbl-fill-to-address)
          (message-goto-body))))

When gnus-newsgroup-name is from a mailing list, I empty the To field,
I delete the Cc field, fill the To field and go to the body.


The function to get the address:
    (defun dcbl-gnus-get-mailing-list-address ()
      "Get gnus-newsgroup-name mailing list address (if it has one);"
      (string-match "[^:]*$" gnus-newsgroup-name)
      (dcbl-get-tuple-value dcbl-gnus-mailing-lists (match-string 0 gnus-newsgroup-name)))


The general function to get a value from a 'tuple':
    (defun dcbl-get-tuple-value (tuple index)
      "Get value from tuple indexed by index (if it exist);"
      (assoc-default index tuple))


The function to fill the To field (I use it also to fill when creating
an article, that is why I go to the subject field here.):
    (defun dcbl-fill-to-address ()
      "Determine what to-address to use on the current message;"
      (interactive)
      (let ((to-address nil))
        (when (and (string= major-mode "message-mode")
                   gnus-newsgroup-name
                   (not (message-fetch-field "To"))
                   (setq to-address (dcbl-gnus-get-mailing-list-address)))
          (message-goto-to)
          (insert to-address)
          (message-goto-subject))))

I check that I am in message-mode, that gnu-newsgroup-name is filled,
that the To field is not filled and that it is a mailing list.
If that is the case I fill the To field and go to the subject field.


The advice for sending a message:
    (defadvice gnus-summary-mail-other-window (after formalities () activate)
      (dcbl-fill-to-address))


I hope it is useful to someone. And if I could do things better: let
me know.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Follow up to group for mailing lists
  2012-09-09 20:06 Follow up to group for mailing lists Cecil Westerhof
@ 2012-09-09 21:16 ` Charles Philip Chan
       [not found] ` <mailman.8476.1347225384.855.info-gnus-english@gnu.org>
  1 sibling, 0 replies; 3+ messages in thread
From: Charles Philip Chan @ 2012-09-09 21:16 UTC (permalink / raw)
  To: info-gnus-english


[-- Attachment #1.1: Type: text/plain, Size: 825 bytes --]

Cecil Westerhof <Cecil@decebal.nl> writes:

> The only way to get the email to the mailing list is a wide follow up,
> but then the sender gets an email from me and from the mailing list.
> That is why I made follow up only going to the mailing list. (With
> reply I still can reply to the author.)

You don't really need to define your functions (as long as you split the
lists into their own group). For mailing lists you can just set
"to-address" and "to-list" in the "Group parameters" to the list
address. This way if you reply with "F/f" or send a new mail with "a" it
will go to the list. If you reply with "R/r", it will go the author.

Charles

-- 
"We all know Linux is great...it does infinite loops in 5 seconds."
(Linus Torvalds about the superiority of Linux on the Amterdam
Linux Symposium)

[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 162 bytes --]

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Follow up to group for mailing lists
       [not found] ` <mailman.8476.1347225384.855.info-gnus-english@gnu.org>
@ 2012-09-09 23:00   ` Cecil Westerhof
  0 siblings, 0 replies; 3+ messages in thread
From: Cecil Westerhof @ 2012-09-09 23:00 UTC (permalink / raw)
  To: info-gnus-english

Op zondag 9 sep 2012 23:16 CEST schreef Charles Philip Chan:

> Cecil Westerhof <Cecil@decebal.nl> writes:
>
>> The only way to get the email to the mailing list is a wide follow up,
>> but then the sender gets an email from me and from the mailing list.
>> That is why I made follow up only going to the mailing list. (With
>> reply I still can reply to the author.)
>
> You don't really need to define your functions (as long as you split the
> lists into their own group). For mailing lists you can just set
> "to-address" and "to-list" in the "Group parameters" to the list
> address. This way if you reply with "F/f" or send a new mail with "a" it
> will go to the list. If you reply with "R/r", it will go the author.

I did not know that. Still I prefer this way. Now I can see in a flash
for which groups it is defined and the address.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-09 23:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-09 20:06 Follow up to group for mailing lists Cecil Westerhof
2012-09-09 21:16 ` Charles Philip Chan
     [not found] ` <mailman.8476.1347225384.855.info-gnus-english@gnu.org>
2012-09-09 23:00   ` Cecil Westerhof

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).