From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: A completing read to set message-mode or Gnus "from"
Date: Wed, 12 Aug 2015 09:34:38 +0200 [thread overview]
Message-ID: <8737zp0xkh.fsf@gmail.com> (raw)
In-Reply-To: 877fp1l9fl.fsf@linux.site
Tory S. Anderson <torys.anderson@gmail.com> writes:
> As a Helm user with 7 or so email addresses I might be sending
> with, I wanted to put together a quick completing-read to fill in
> my from address with a keystroke; however, it's not working and
> I'm not sure why. It complains about wanting a list, but when I
> return a list it complains about wanting a string.
>
> (defun tsa/message-choose-from ()
> (interactive
> (let ((my-name "Joseph Smith")
> (my-from-list '("abc@gmail.com" "def@gmail.com"
> "xyz@gmail.com")))
> (message-make-from my-name (completing-read "From:"
> my-from-list nil t)))))
(defun tsa/message-choose-from (address)
(interactive (list (completing-read
"From: "
'("abc@gmail.com" "def@gmail.com" "xyz@gmail.com"))))
(message "Joseph Smith with %s" address))
--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
prev parent reply other threads:[~2015-08-12 7:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-11 22:58 A completing read to set message-mode or Gnus "from" Tory S. Anderson
2015-08-12 6:01 ` Ian Zimmerman
2015-08-12 6:06 ` Ian Zimmerman
2015-08-12 7:34 ` Thierry Volpiatto [this message]
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=8737zp0xkh.fsf@gmail.com \
--to=thierry.volpiatto@gmail.com \
--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.