help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A completing read to set message-mode or Gnus "from"


From: Tory S . Anderson
Subject: A completing read to set message-mode or Gnus "from"
Date: Tue, 11 Aug 2015 16:58:06 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]