From: Xah <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: starting an external command from emacs
Date: Fri, 14 Nov 2008 11:43:56 -0800 (PST) [thread overview]
Message-ID: <035efdb3-25dd-4916-9881-10441a010101@d10g2000pra.googlegroups.com> (raw)
In-Reply-To: mailman.365.1226676836.26697.help-gnu-emacs@gnu.org
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/
☄
next prev parent reply other threads:[~2008-11-14 19:43 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.201.1226528857.26697.help-gnu-emacs@gnu.org>
2008-11-12 23:08 ` starting an external command from emacs Dan Espen
2008-11-13 3:48 ` Matt Price
[not found] ` <mailman.217.1226563070.26697.help-gnu-emacs@gnu.org>
2008-11-13 13:54 ` Dan Espen
2008-11-13 15:50 ` Xah
2008-11-14 13:24 ` break a chunk of text into a list of lines Matt Price
2008-11-14 15:33 ` starting an external command from emacs Matt Price
[not found] ` <mailman.359.1226672766.26697.help-gnu-emacs@gnu.org>
2008-11-14 19:33 ` break a chunk of text into a list of lines Xah
2008-11-14 20:43 ` Andreas Politz
2008-11-15 16:35 ` interactive function: generate tab-completion list with another function Matt Price
2008-11-16 3:42 ` syntax: anonymous vs. named functions Matt Price
2008-11-16 8:01 ` Drew Adams
2008-11-16 15:48 ` Matt Price
2008-11-17 1:06 ` Drew Adams
[not found] ` <mailman.552.1226883997.26697.help-gnu-emacs@gnu.org>
2008-11-17 8:08 ` Andreas Politz
[not found] ` <mailman.365.1226676836.26697.help-gnu-emacs@gnu.org>
2008-11-14 19:43 ` Xah [this message]
2008-11-14 20:31 ` starting an external command from emacs Andreas Politz
2008-11-12 19:59 Matt Price
2008-11-13 0:17 ` Andy Stewart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=035efdb3-25dd-4916-9881-10441a010101@d10g2000pra.googlegroups.com \
--to=xahlee@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).