From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Nordl=F6w?= Newsgroups: gmane.emacs.help Subject: Read another with M-RET Date: Wed, 21 Jul 2010 04:25:18 -0700 (PDT) Organization: http://groups.google.com Message-ID: <34e5f154-9ba5-4a06-8eb9-c7a891a193b7@i31g2000yqm.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291848528 30614 80.91.229.12 (8 Dec 2010 22:48:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Dec 2010 22:48:48 +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 Dec 08 23:48:44 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQSoT-0001DT-JX for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 23:48:41 +0100 Original-Received: from localhost ([127.0.0.1]:42128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQSoT-0007ap-3l for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 17:48:41 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!i31g2000yqm.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-NNTP-Posting-Host: 81.170.219.22 Original-X-Trace: posting.google.com 1279711519 18067 127.0.0.1 (21 Jul 2010 11:25:19 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 21 Jul 2010 11:25:19 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i31g2000yqm.googlegroups.com; posting-host=81.170.219.22; posting-account=ytJKAgoAAAA1tg4ScoRszebXiIldA5vg User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.473.0 Safari/534.3, gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:179879 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:76158 Archived-At: How do I modify read-string-list so that RET ends loop a single read and M-RET finishes current input and ask for another instead of the logic given in the code below where RET finishes current and ask for another and a final empty string (just RET) instead ends the loop? Thanks in advance, Nordl=F6w Here's the code: (defun read-string-list (&optional prompt uniquify) "Construct a list of strings interactively from minibuffer. An empty string (RET) terminates the read loop." (interactive) (let ((sl nil)) (let (str) (while (not (equal (setq str (read-string (concat (or prompt "String") " (or RET to end list): "))) "")) (if uniquify (add-to-list 'sl str t) (setq sl (append sl `(,str)))) )) sl))