unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* A completing read to set message-mode or Gnus "from"
@ 2015-08-11 22:58 Tory S. Anderson
  2015-08-12  6:01 ` Ian Zimmerman
  2015-08-12  7:34 ` Thierry Volpiatto
  0 siblings, 2 replies; 4+ messages in thread
From: Tory S. Anderson @ 2015-08-11 22:58 UTC (permalink / raw)
  To: Emacs Help List

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. 



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-12  7:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).