From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Riley Newsgroups: gmane.emacs.help Subject: Help needed to simplify code for customisation Date: Tue, 10 Mar 2009 03:14:10 +0100 Organization: A noiseless patient Spider Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1236652912 30380 80.91.229.12 (10 Mar 2009 02:41:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Mar 2009 02:41:52 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 10 03:43:10 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lgrvt-0005dI-He for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Mar 2009 03:43:05 +0100 Original-Received: from localhost ([127.0.0.1]:46070 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LgruX-0002Nf-U1 for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Mar 2009 22:41:41 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!newshub.sdsu.edu!feeder.erje.net!news.motzarella.org!motzarella.org!rileyrgdev.motzarella.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-X-Trace: news.eternal-september.org U2FsdGVkX1/3OLlK/9uKwMLexvqTDNftjNUG8rX1gAQ3jsehzQxg0Xe+IaLG/h1PoXinGTSVflqltn+OXlOy7mJmduJvtpv20KRDPskhdWMn9WkBgPq1DZfn5IDFPE/EyItxNSzD53VcSYX4h4WuJg== Original-X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers Original-NNTP-Posting-Date: Tue, 10 Mar 2009 02:14:12 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1+u6ZSqko9kxJoA7Tn6xYLAED0LcZ7WeX0X7hdqJRQxhw== Cancel-Lock: sha1:CzfM0xI5goqFJCzf8gopnomKpsM= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) Original-Xref: news.stanford.edu gnu.emacs.help:167492 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:62800 Archived-At: Could someone please recommend the best way to remove the 3 similar lines doing string-match on the "account" assign and iterate a variable list to which I can "add-to-list" in other .el libraries for example? ,---- | (if (message-mail-p) | (save-excursion | (let* ((from | (save-restriction | (message-narrow-to-headers) | (message-fetch-field "from"))) | (account | (cond | ((string-match ".*root.*" from)"richardriley") | ((string-match ".*richardriley.*" from)"richardriley") | ((string-match ".*rileyrgdev.*" from)"rileyrgdev") | )) | ) | (setq message-sendmail-extra-arguments (list "-a" account)) | ))) | ) `---- Thanks for any pointers, r.