[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/
☄
- starting an external command from emacs, Matt Price, 2008/11/12
- Re: starting an external command from emacs, Dan Espen, 2008/11/12
- Re: starting an external command from emacs, Xah, 2008/11/13
- break a chunk of text into a list of lines, Matt Price, 2008/11/14
- Re: starting an external command from emacs, Matt Price, 2008/11/14
- Message not available
- Message not available
- Message not available
- Re: starting an external command from emacs,
Xah <=
- Message not available
- Re: break a chunk of text into a list of lines, Andreas Politz, 2008/11/14
- interactive function: generate tab-completion list with another function, Matt Price, 2008/11/15
- syntax: anonymous vs. named functions, Matt Price, 2008/11/15
- RE: syntax: anonymous vs. named functions, Drew Adams, 2008/11/16
- RE: syntax: anonymous vs. named functions, Matt Price, 2008/11/16
- RE: syntax: anonymous vs. named functions, Drew Adams, 2008/11/16
- Message not available
- Re: syntax: anonymous vs. named functions, Andreas Politz, 2008/11/17