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

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

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


From: Thierry Volpiatto
Subject: Re: A completing read to set message-mode or Gnus "from"
Date: Wed, 12 Aug 2015 09:34:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

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 




reply via email to

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