all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: help-gnu-emacs@gnu.org
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	[thread overview]
Message-ID: <87mxbk6gkz.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 87bos10wv5.fsf@nzebook.haselwarter.org

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




  reply	other threads:[~2011-11-25  3:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23 16:24 Gnus: How to easily change "From:" from the default to a second account's address? Marius Hofert
2011-11-23 16:35 ` Tassilo Horn
2011-11-23 22:17   ` Marius Hofert
2011-11-25  2:17     ` Philipp Haselwarter
2011-11-25  3:12       ` Eric Abrahamsen [this message]
2011-11-26 12:03         ` Philipp Haselwarter
2011-11-27  1:52           ` Eric Abrahamsen
2011-12-03 21:10             ` Johnny
2011-12-03 22:53               ` Philipp Haselwarter
2011-12-04 12:58                 ` Harry Putnam
2011-12-05 19:44                   ` Richard Riley
2011-12-05 20:18                     ` Johnny
2011-12-05 20:39                       ` Richard Riley
2011-12-05 20:58                         ` Johnny
2011-11-27 19:03 ` Memnon Anon
2011-12-03 19:17 ` Teemu Likonen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mxbk6gkz.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.