From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.help Subject: Re: Gnus: How to easily change "From:" from the default to a second account's address? Date: Fri, 25 Nov 2011 11:12:12 +0800 Message-ID: <87mxbk6gkz.fsf@ericabrahamsen.net> References: <812215ED-D638-4BE4-8AD3-AC7EB95378E0@math.ethz.ch> <87y5v6yeyy.fsf@tsdh.uni-koblenz.de> <5BBBF1D0-1349-4C17-8D38-F75CE52D2C53@math.ethz.ch> <87bos10wv5.fsf@nzebook.haselwarter.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1322190771 23430 80.91.229.12 (25 Nov 2011 03:12:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 25 Nov 2011 03:12:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 25 04:12:47 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RTmDV-0006SC-UB for geh-help-gnu-emacs@m.gmane.org; Fri, 25 Nov 2011 04:12:46 +0100 Original-Received: from localhost ([::1]:36769 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTmDU-000241-W8 for geh-help-gnu-emacs@m.gmane.org; Thu, 24 Nov 2011 22:12:44 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:34988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTmDP-00023k-Sa for help-gnu-emacs@gnu.org; Thu, 24 Nov 2011 22:12:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTmDO-0003iL-LP for help-gnu-emacs@gnu.org; Thu, 24 Nov 2011 22:12:39 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:32997) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTmDO-0003iG-BP for help-gnu-emacs@gnu.org; Thu, 24 Nov 2011 22:12:38 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RTmDJ-0006Qg-0E for help-gnu-emacs@gnu.org; Fri, 25 Nov 2011 04:12:33 +0100 Original-Received: from 50-56-99-223.static.cloud-ips.com ([50.56.99.223]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Nov 2011 04:12:32 +0100 Original-Received: from eric by 50-56-99-223.static.cloud-ips.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Nov 2011 04:12:32 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 36 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 50-56-99-223.static.cloud-ips.com User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (gnu/linux) Cancel-Lock: sha1:LZIZmy9KC+Oz+nk4WEqD+c4BVLw= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83042 Archived-At: On Fri, Nov 25 2011, Philipp Haselwarter wrote: > I often find myself wanting to change the From: after opening the > message; this allows picking one of your accounts: Is this much different from `message-alternative-emails'? I think that's what I use to set my possible From addresses, and then TAB at the end of the address will cycle through the possible addresses. Eric > #+begin_src emacs-lisp > (defcustom my-smtp-accounts nil > "*list of available smtp accounts" > :group 'smtpmail > :type '(repeat alist)) > > (defun my-pick-smtp () > (interactive) > (setq user-mail-address > (let ((f (if (functionp 'ido-completing-read) > 'ido-completing-read > completing-read))) > (funcall f "Which smtp acc:" (mapcar 'cadr my-smtp-accounts)))) > (save-excursion > (save-restriction > (message-narrow-to-headers-or-head) > (message-remove-header "From") > (goto-char (point-max)) > (insert "From: " (message-make-from) "\n")))) > > #+end_src -- GNU Emacs 24.0.91.1 (i686-pc-linux-gnu, GTK+ Version 2.24.6) of 2011-11-07 on pellet