From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/65428 Path: news.gmane.org!not-for-mail From: Daniel Pittman Newsgroups: gmane.emacs.gnus.general Subject: Re: How to strip names out of To: and CC: Date: Sun, 21 Oct 2007 15:54:14 +1000 Organization: Cybersource: Australia's Leading Linux and Open Source Solutions Company Message-ID: <87prz9nhbt.fsf@krosp.pangaean.net> References: <87hckl4m95.fsf@jidanni.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1192947089 13173 80.91.229.12 (21 Oct 2007 06:11:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 21 Oct 2007 06:11:29 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M13928@lists.math.uh.edu Sun Oct 21 08:11:30 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1IjU25-0008U7-PI for ding-account@gmane.org; Sun, 21 Oct 2007 08:11:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1IjU0v-00031p-SW; Sun, 21 Oct 2007 01:10:17 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1IjU0u-00031Y-Cx for ding@lists.math.uh.edu; Sun, 21 Oct 2007 01:10:16 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1IjU0k-0003yz-Hr for ding@lists.math.uh.edu; Sun, 21 Oct 2007 01:10:16 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1IjU0d-0002au-00 for ; Sun, 21 Oct 2007 08:09:59 +0200 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1IjU0g-0004EB-Lm for ding@gnus.org; Sun, 21 Oct 2007 06:10:02 +0000 Original-Received: from 203-217-31-70.perm.iinet.net.au ([203.217.31.70]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 21 Oct 2007 06:10:02 +0000 Original-Received: from daniel by 203-217-31-70.perm.iinet.net.au with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 21 Oct 2007 06:10:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 41 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 203-217-31-70.perm.iinet.net.au User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.0 (gnu/linux) Cancel-Lock: sha1:xMu6o2dpO6MnkAqYWgGpTBFx9wU= X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:65428 Archived-At: jidanni@jidanni.org writes: > Well here's how far I got: > (defun jidanni-message-to-cc-no-names () > "Strip the names out of To: and Cc:, > leaving just the addresses, for a more spartan style." > (let > (mapcar > (lambda(X) > ((X-content > (mapcar > (lambda(x)(cadr x)) > (mail-extract-address-components x t)))) > (message-fetch-field "X")) > (message-goto-X)(message-delete-line);OR (message-remove-header X)? > (insert (concat "X: " X-content "\n")) (list to cc)))) > > (add-hook 'message-header-setup-hook > 'jidanni-message-to-cc-no-names) > > Of course it is just a jumble of Lisp Concepts in no special order > that took several hours for me to amass. > > Or maybe I would be smarter to just hack the definition of > mail-extract-address-components and gnus-extract-address-components to > cause them to lose the names, but that would be like painting the > traffic light green. You might do better setting the value of the variable `gnus-extract-address-components' to something that called an existing method, expunged the name part, then returned the result. Like others I /really/ don't think this is a good idea, but that involves no hacking and minimal writing of code for your purposes. Regards, Daniel -- Daniel Pittman Phone: 03 9621 2377 Level 4, 10 Queen St, Melbourne Web: http://www.cyber.com.au Cybersource: Australia's Leading Linux and Open Source Solutions Company