[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: a suggested solution for better external' completion in certain emac
From: |
Nic Ferrier |
Subject: |
Re: a suggested solution for better external' completion in certain emacs modes |
Date: |
Tue, 09 Nov 2004 23:12:23 +0000 |
")
Message-ID: <address@hidden>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Richard Stallman <address@hidden> writes:
> - Readline advertises to Emacs the functions the current program
> supports by writing the information (a sexp?) to the stream
>
> I am not quite sure what this means. What questions would this
> information answer? Could you give an example?
Sure.
Let's imagine I want to start psql (the PostgreSQL command line
client) in Emacs. This is what might happen, given my suggestion:
Emacs does: READLINE_CTRL=API psql somedb
This opens the normal stream between the two programs, but puts
libreadline into 'api' mode
psql/Readline sends: (readline-api rl_insert_text
rl_delete_text
rl_copy_text
rl_kill_text
rl_complete
rl_possible_completions
rl_insert_completions)
This tells Emacs what function calls the readline program can accept.
The next step is that the user gives some input to emacs:
select * from
and then she presses C-TAB (the completion key). Emacs doesn't know
how to complete the line but it does know that psql/Readline supports
rl_complete so:
Emacs sends: (rl_complete "select * from ")
psql/Readline accepts the command, performs it and then:
psql/Readline sends: ("invoices" "orders" "expenses" "users")
and Emacs can display the completion list. The user types an "i" and
presses C-TAB so now....
Emacs sends: (rl_complete "select * from i")
and psql/Readline responds with: ("nvoices")
so now there is only one completion item Emacs can display the line:
select * from invoices
At some point the user presses enter and Emacs passes the line to
psql/Readline again in some form that causes psql/Readline to execute
the line and send the output to the stream.
This would be a very cool way to solve the problem of getting at
completion services provided by, in particular, Readline enabled
programs.
It would require quite a lot of work to make Readline do it though.
--
Nic Ferrier
http://www.tapsellferrier.co.uk
- Re: GTK emacs (and access to GTK), (continued)
- Re: GTK emacs (and access to GTK), Jan D., 2004/11/02
- Re: GTK emacs (and access to GTK), Peter Heslin, 2004/11/03
- Re: GTK emacs (and access to GTK), Jan D., 2004/11/03
- Re: GTK emacs (and access to GTK), Nic Ferrier, 2004/11/03
- a suggested solution for better external' completion in certain emacs modes, Nic Ferrier, 2004/11/08
- Re: a suggested solution for better external' completion in certain emacs modes, Richard Stallman, 2004/11/09
- Re: a suggested solution for better external' completion in certain emacs modes,
Nic Ferrier <=
- Re: a suggested solution for better external' completion in certain emacs modes, Richard Stallman, 2004/11/10
- Re: a suggested solution for better external' completion in certain emacs modes, Nic Ferrier, 2004/11/11
- Re: a suggested solution for better external' completion in certain emacs modes, Kai Grossjohann, 2004/11/11
- Re: a suggested solution for better external' completion in certain emacs modes, Nic Ferrier, 2004/11/11
- Re: a suggested solution for better external' completion in certain emacs modes, Kai Grossjohann, 2004/11/11
- Re: a suggested solution for better external' completion in certain emacs modes, Nic Ferrier, 2004/11/11
- Re: a suggested solution for better external' completion in certain emacs modes, Richard Stallman, 2004/11/12
- Re: a suggested solution for better external' completion in certain emacs modes, Nic Ferrier, 2004/11/12
- Re: a suggested solution for better external' completion in certain emacs modes, Kim F. Storm, 2004/11/12
- Re: a suggested solution for better external' completion in certain emacs modes, Stefan, 2004/11/13