all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tory S. Anderson <torys.anderson@gmail.com>
To: Emacs Help List <help-gnu-emacs@gnu.org>
Subject: A completing read to set message-mode or Gnus "from"
Date: Tue, 11 Aug 2015 16:58:06 -0600	[thread overview]
Message-ID: <877fp1l9fl.fsf@linux.site> (raw)

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.

--8<---------------cut here---------------start------------->8---
(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)))))

(add-hook 'message-mode-hook
	  (lambda ()
	    (local-set-key (kbd "C-c f") 
	    'tsa/message-choose-from)))
--8<---------------cut here---------------end--------------->8---

Error:
> command-execute: Wrong type argument: listp, "Joseph Smith 
> <abc@gmail.com>"

Is this to do with "interactive" vs "message-make-from"? The 
completing-read seems to work, but the final step is blocked by 
the error. 



             reply	other threads:[~2015-08-11 22:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-11 22:58 Tory S. Anderson [this message]
2015-08-12  6:01 ` A completing read to set message-mode or Gnus "from" Ian Zimmerman
2015-08-12  6:06   ` Ian Zimmerman
2015-08-12  7:34 ` Thierry Volpiatto

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=877fp1l9fl.fsf@linux.site \
    --to=torys.anderson@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.