From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Newsgroups: gmane.emacs.help Subject: Re: starting an external command from emacs Date: Fri, 14 Nov 2008 11:43:56 -0800 (PST) Organization: http://groups.google.com Message-ID: <035efdb3-25dd-4916-9881-10441a010101@d10g2000pra.googlegroups.com> 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 1226696061 5670 80.91.229.12 (14 Nov 2008 20:54:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Nov 2008 20:54:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 14 21:55:21 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 1L15hC-0004MH-QU for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Nov 2008 21:55:15 +0100 Original-Received: from localhost ([127.0.0.1]:33120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L15g4-0004DT-Nf for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Nov 2008 15:54:04 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!d10g2000pra.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 40 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1226691836 30079 127.0.0.1 (14 Nov 2008 19:43:56 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 14 Nov 2008 19:43:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d10g2000pra.googlegroups.com; posting-host=24.6.185.159; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.22, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:164466 comp.emacs:97358 X-Mailman-Approved-At: Fri, 14 Nov 2008 15:53:48 -0500 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:59801 Archived-At: On Nov 14, 7:33 am, Matt Price wrote: > given a list like this > '( > "m...@mdke.org Matthew East" > "matt.pr...@utoronto.ca Matt Price > "matthias.doerr...@gersulp.u-strasbg.fr Matthias D=C3=B6rries" > "matthewre...@yahoo.com matthewreedy" > ) > > how to i tell emacs i want to use the list elements as choices for > tab-completion in an interactive function? i think basically you want to write a completion function. I don't know the answer. I'm currently trying to study this. You can read about try-completion. (type Alt+x elisp-index-search, then try-completion, will get you to the right manual location) The functions there are rather low level. I don't think it's easy. You can lookup existing code. Try type Ctrl+h f, then lisp-complete- symbol. Click on the source link in the result will take you to the source code on this function. Similarly, you can look at python- complete-symbol and other lang's implementation. They are about less than 100 lines of code each, but involves quite a few knowledge about buffers, emacs =E2=80=9Cwindows=E2=80=9D, etc. > can I write another couple of lines that presents the items in the list > as choices to the user, who then picks one? that'd be really great. I think you are asking for a contextual menu. Flyspell provides that when middle clicking on the highlighted word. Sorry, i haven't studied contextual menu neither. you can look at how flyspell does it by Alt+x flyspell-buffer. Then, type Ctrl+h v, then middle click on a highlighted word. Xah =E2=88=91 http://xahlee.org/ =E2=98=84