From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matt Price Newsgroups: gmane.emacs.help Subject: break a chunk of text into a list of lines Date: Fri, 14 Nov 2008 08:24:30 -0500 Organization: History Department, University of Toronto Message-ID: <1226669070.8767.3441.camel@localhost> References: <3d16ac18-967c-4511-8c9c-9a80c40c3d8e@x16g2000prn.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1226672810 14757 80.91.229.12 (14 Nov 2008 14:26:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Nov 2008 14:26:50 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Xah Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 14 15:27:50 2008 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.50) id 1L0ze4-00079c-Bx for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Nov 2008 15:27:36 +0100 Original-Received: from localhost ([127.0.0.1]:49019 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0zcw-0002mF-9j for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Nov 2008 09:26:26 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0zcb-0002lN-1D for help-gnu-emacs@gnu.org; Fri, 14 Nov 2008 09:26:05 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0zca-0002kt-2q for help-gnu-emacs@gnu.org; Fri, 14 Nov 2008 09:26:04 -0500 Original-Received: from [199.232.76.173] (port=46349 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0zcZ-0002km-MF for help-gnu-emacs@gnu.org; Fri, 14 Nov 2008 09:26:03 -0500 Original-Received: from bureau61.ns.utoronto.ca ([128.100.132.151]:50639) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L0zcZ-0005Vd-S3 for help-gnu-emacs@gnu.org; Fri, 14 Nov 2008 09:26:04 -0500 Original-Received: from anarres.mercey.org (CPE001d7e1d5798-CM0014f8cd1c4c.cpe.net.cable.rogers.com [173.32.83.31]) (authenticated bits=0) by bureau61.ns.utoronto.ca (8.13.8/8.13.8) with ESMTP id mAEEPm2k011965 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 14 Nov 2008 09:25:58 -0500 Original-Received: by anarres.mercey.org (Postfix, from userid 1000) id F1243120356; Fri, 14 Nov 2008 08:24:30 -0500 (EST) In-Reply-To: <3d16ac18-967c-4511-8c9c-9a80c40c3d8e@x16g2000prn.googlegroups.com> X-Mailer: Evolution 2.24.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:59785 Archived-At: On Thu, 2008-11-13 at 07:50 -0800, Xah wrote: > Can you make your question into one specific question? >=20 > if you can make just one specific question, as much as possible to > your problem, it's likely to get much useful replies. >=20 > from scanning several replies, here's what i think might be helpful. >=20 > if you want to write elisp to call some other script and process the > result, it's fairly easy. If you can be specific about what command > you want to call and how you want to parse the result, we can help > better. >=20 > The following tutorial will probably help: >=20 > =E2=80=A2 Elisp Wrapper For Perl Scripts > http://xahlee.org/emacs/elisp_perl_wrapper.html > (you can use your existing knowledge of a scripting lang and turn them > into elisp command) >=20 > =E2=80=A2 Elisp Lesson: Writing image-linkify Function > http://xahlee.org/emacs/elisp_image_tag.html > (contains example of calling external script and process its result) >=20 Xah, thanks for the helpful links -- also thanks to other folks who have been helping on this thread. I think i have two questions, so i'll write them in two seperate emails. I have a python script that queries my evolution database and returns a series of lines, with one address per line: matt@gont:~$ python evo-query.py matt 14 matches in 874 entries matt@mdke.org Matthew East matt.price@utoronto.ca Matt Price moptop99@gmail.com Matt Price mdz@canonical.com Matt Zimmerman Matty_fontaine@hotmail.com Matt Fontaine matt.price@utoronto.ca Matt Price mjg59@srcf.ucam.org Matthew Garrett myatesmyates@yahoo.com Matthew Yates matthias.doerries@gersulp.u-strasbg.fr Matthias D=C3=B6rries matthew.flaschen@gatech.edu Matthew Flaschen mcdavey@mrao.cam.ac.uk Matt Davey matt@madhaus.cns.utoronto.ca Matt Wilks MattVermeulen@gmail.com Matthew Vermeulen matthewreedy@yahoo.com matthewreedy (note the not-so-well-maintained duplicates!) i've written a short function based on one of your examples that grabs this output -- i imagine it needs some fixing up, but here it is: (defun query-python-addressbook (name) (interactive "s To:" ) (setq cmd-name "python /home/matt/evo-query.py") (setq sh-output (shell-command-to-string (concat cmd-name " " name))) (message "%s" sh-output) ) (query-python-addressbook "matt") now returns a message with the this text. instead i'd like it to return a list of names. i'm sure someone will point me to the right info node, but i'm having some difficulty navigating the immense amounts of documentation -- is there a simple way to take each line of a text block and turn it into a list of lines? =20 thanks much! -- second quesiton to follow... matt > Xah > =E2=88=91 http://xahlee.org/ >=20 > =E2=98=84 --=20 Matt Price matt.price@utoronto.ca