From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Haselwarter 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 03:17:02 +0100 Message-ID: <87bos10wv5.fsf@nzebook.haselwarter.org> References: <812215ED-D638-4BE4-8AD3-AC7EB95378E0@math.ethz.ch> <87y5v6yeyy.fsf@tsdh.uni-koblenz.de> <5BBBF1D0-1349-4C17-8D38-F75CE52D2C53@math.ethz.ch> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1322187448 6517 80.91.229.12 (25 Nov 2011 02:17:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 25 Nov 2011 02:17:28 +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 03:17:25 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 1RTlLw-0007vw-L2 for geh-help-gnu-emacs@m.gmane.org; Fri, 25 Nov 2011 03:17:24 +0100 Original-Received: from localhost ([::1]:38111 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTlLw-0001Jl-29 for geh-help-gnu-emacs@m.gmane.org; Thu, 24 Nov 2011 21:17:24 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:57566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTlLr-0001Jf-7D for help-gnu-emacs@gnu.org; Thu, 24 Nov 2011 21:17:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTlLp-0004U3-TP for help-gnu-emacs@gnu.org; Thu, 24 Nov 2011 21:17:19 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:46667) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTlLp-0004Tt-OI for help-gnu-emacs@gnu.org; Thu, 24 Nov 2011 21:17:17 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RTlLn-0007t2-31 for help-gnu-emacs@gnu.org; Fri, 25 Nov 2011 03:17:15 +0100 Original-Received: from 87.114.113.78.rev.sfr.net ([78.113.114.87]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Nov 2011 03:17:15 +0100 Original-Received: from philipp.haselwarter by 87.114.113.78.rev.sfr.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Nov 2011 03:17:15 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 27 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 87.114.113.78.rev.sfr.net X-NSA-Fodder: corporate security industrial intelligence CNCIS Compsec Emacs: or perhaps you'd prefer Russian Roulette, after all? User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (gnu/linux) Cancel-Lock: sha1:Srs/QMzEWjQEVvY1usNRp88g8go= 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:83040 Archived-At: I often find myself wanting to change the From: after opening the message; this allows picking one of your accounts: #+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 -- Philipp Haselwarter