From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: gareth.rees@pobox.com (Gareth Rees) Newsgroups: gmane.emacs.help Subject: Re: getting output from external process in a variable Date: 30 Jan 2004 07:39:38 -0800 Organization: http://groups.google.com Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1075477621 21507 80.91.224.253 (30 Jan 2004 15:47:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 30 Jan 2004 15:47:01 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 30 16:46:55 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Amar8-0001yw-00 for ; Fri, 30 Jan 2004 16:46:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Amaqa-0001jp-H0 for geh-help-gnu-emacs@m.gmane.org; Fri, 30 Jan 2004 10:46:20 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!info1.fnal.gov!nntp-server.caltech.edu!news.uchicago.edu!news-xfer.newsread.com!newspeer.monmouth.com!news.maxwell.syr.edu!postnews1.google.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 13 Original-NNTP-Posting-Host: 193.112.141.206 Original-X-Trace: posting.google.com 1075477179 9677 127.0.0.1 (30 Jan 2004 15:39:39 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 30 Jan 2004 15:39:39 +0000 (UTC) Original-Xref: shelby.stanford.edu gnu.emacs.help:120583 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 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 Xref: main.gmane.org gmane.emacs.help:16529 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:16529 Daan Hoogland wrote: > I end up with [a buffer containing lines of the form] > groupname:member1,member2 and I want it in a list: > (list "groupname" (list "member1" "member2")) (require 'cl) (defun munge-buffer () (goto-char (point-min)) (loop while (re-search-forward "^\\(\\w+\\):\\(\\w+\\),\\(\\w+\\)$" nil t) collect `(,(match-string 1) (,(match-string 2) ,(match-string 3))))) -- Gareth Rees