help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: starting an external command from emacs


From: Xah
Subject: Re: starting an external command from emacs
Date: Fri, 14 Nov 2008 11:43:56 -0800 (PST)
User-agent: G2/1.0

On Nov 14, 7:33 am, Matt Price <matt.pr...@utoronto.ca> 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örries"
> "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 “windows”, 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
∑ http://xahlee.org/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]