From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: A completing read to set message-mode or Gnus "from" Date: Wed, 12 Aug 2015 09:34:38 +0200 Organization: Emacs Helm Message-ID: <8737zp0xkh.fsf@gmail.com> References: <877fp1l9fl.fsf@linux.site> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1439364913 17203 80.91.229.3 (12 Aug 2015 07:35:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Aug 2015 07:35:13 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 12 09:35:03 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZPQYx-0004vm-5w for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Aug 2015 09:35:03 +0200 Original-Received: from localhost ([::1]:37309 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPQYw-00045A-Ju for geh-help-gnu-emacs@m.gmane.org; Wed, 12 Aug 2015 03:35:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPQYj-00043y-BV for help-gnu-emacs@gnu.org; Wed, 12 Aug 2015 03:34:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZPQYg-0000XI-5K for help-gnu-emacs@gnu.org; Wed, 12 Aug 2015 03:34:49 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:51748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZPQYf-0000X2-UH for help-gnu-emacs@gnu.org; Wed, 12 Aug 2015 03:34:46 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZPQYe-0004j3-9t for help-gnu-emacs@gnu.org; Wed, 12 Aug 2015 09:34:44 +0200 Original-Received: from lbe83-2-78-243-104-167.fbx.proxad.net ([78.243.104.167]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Aug 2015 09:34:44 +0200 Original-Received: from thierry.volpiatto by lbe83-2-78-243-104-167.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 12 Aug 2015 09:34:44 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 26 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lbe83-2-78-243-104-167.fbx.proxad.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:v5HSUTzijgdNplJbMqIwAYQKhoc= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106497 Archived-At: Tory S. Anderson 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