From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/15791 Path: news.gmane.org!not-for-mail From: Cecil Westerhof Newsgroups: gmane.emacs.gnus.user Subject: Follow up to group for mailing lists Date: Sun, 09 Sep 2012 22:06:59 +0200 Organization: Decebal Computing Message-ID: <878vcjot98.fsf@Compaq.site> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1347221409 12059 80.91.229.3 (9 Sep 2012 20:10:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Sep 2012 20:10:09 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Sun Sep 09 22:10:12 2012 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TAnpZ-0007na-Ez for gegu-info-gnus-english@m.gmane.org; Sun, 09 Sep 2012 22:10:09 +0200 Original-Received: from localhost ([::1]:40568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TAnpW-0007Yi-2b for gegu-info-gnus-english@m.gmane.org; Sun, 09 Sep 2012 16:10:06 -0400 Original-Received: by 10.180.107.199 with SMTP id he7mr967937wib.1.1347221220157; Sun, 09 Sep 2012 13:07:00 -0700 (PDT) X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 88.191.116.97 Original-Path: usenet.stanford.edu!7no10281114wig.0!news-out.google.com!q11ni51652536wiw.1!nntp.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!nntpfeed.proxad.net!dedibox.gegeweb.org!gegeweb.eu!gegeweb.org!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-Lines: 84 Original-NNTP-Posting-Host: lYLrXPFpjyZ8237ODaoN+w.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:FyuZK1KYMLVR9a4/0wsO/Nc1Kj0= X-Homepage: http://www.decebal.nl/ Original-Xref: usenet.stanford.edu gnu.emacs.gnus:86875 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:15791 Archived-At: 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