all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nic Ferrier <nferrier@tapsellferrier.co.uk>
Cc: emacs-devel@gnu.org
Subject: Re: a suggested solution for better external' completion in certain emacs modes
Date: Tue, 09 Nov 2004 23:12:23 +0000	[thread overview]
Message-ID: <E1CRfA0-0007tn-Cl@kanga> (raw)
In-Reply-To: <E1CRdZ2-0008Eo-C0@fencepost.gnu.org> (Richard Stallman's message of "Tue, 09 Nov 2004 16:30:08 -0500

")
Message-ID: <87lldawrag.fsf@tapsellferrier.co.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

Richard Stallman <rms@gnu.org> 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

  reply	other threads:[~2004-11-09 23:12 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1Bgmxo-0006Bh-0o@monty-python.gnu.org>
2004-07-05 12:06 ` ECB Eric M. Ludlam
2004-07-05 12:53   ` ECB Stefan
     [not found]   ` <E1BhoWE-0004n3-7k@fencepost.gnu.org>
     [not found]     ` <200407061241.i66CfX1w016798@projectile.siege-engine.com>
2004-07-12 23:58       ` ECB Richard Stallman
2004-07-13  0:35         ` Re[2]: ECB Eric M. Ludlam
2004-08-06 23:10   ` transparent emacs Nic Ferrier
2004-08-07  0:12     ` Miles Bader
2004-08-07  1:15       ` Nic Ferrier
2004-08-07  2:27         ` Miles Bader
2004-08-17 17:44       ` Romain Francoise
2004-11-02 13:11         ` GTK emacs (and access to GTK) Nic Ferrier
2004-11-02 13:34           ` David Kastrup
2004-11-02 22:39             ` Jan D.
2004-11-02 22:53               ` David Kastrup
2004-11-02 23:17                 ` Jan D.
2004-11-02 22:28           ` Jan D.
2004-11-02 22:41             ` Nic Ferrier
2004-11-02 22:48           ` Peter Heslin
2004-11-03  9:13             ` Jan D.
2004-11-03  9:34             ` Nic Ferrier
2004-11-08 23:30             ` a suggested solution for better external' completion in certain emacs modes Nic Ferrier
2004-11-09  0:01               ` Stefan Monnier
2004-11-09  0:35                 ` Nic Ferrier
2004-11-09 21:30               ` Richard Stallman
2004-11-09 23:12                 ` Nic Ferrier [this message]
2004-11-11  3:14                   ` Richard Stallman
2004-11-11  9:37                     ` Nic Ferrier
2004-11-11 10:49                       ` Kai Grossjohann
2004-11-11 11:14                         ` Nic Ferrier
2004-11-11 12:18                           ` Kai Grossjohann
2004-11-11 12:51                             ` Nic Ferrier
2004-11-12  7:05                       ` Richard Stallman
2004-11-12 10:12                         ` Nic Ferrier
2004-11-12 13:20                           ` Kim F. Storm
2004-11-13 23:32                             ` Stefan
2004-11-12 21:25                           ` Richard Stallman
2004-11-12 22:16                             ` Nic Ferrier
2004-11-14  6:01                               ` Richard Stallman
2004-11-14 15:32                                 ` Nic Ferrier
2004-11-15 13:59                                   ` Richard Stallman
2004-11-13  8:42                             ` Alex Schroeder
2004-11-14  6:00                               ` Richard Stallman
2004-11-08 15:14           ` show-paren-mode stuffed in latest CVS Nic Ferrier
2004-11-09 16:12             ` Sam Steingold
2004-11-10 16:09               ` Richard Stallman
2004-11-10 16:22                 ` Nic Ferrier
2004-11-09 16:22             ` Kim F. Storm
2004-11-09 16:30               ` Nic Ferrier
2004-11-09 16:46                 ` Luc Teirlinck
2004-11-09 21:35                   ` Nic Ferrier
2004-11-10  0:16                   ` Nic Ferrier
2004-11-09 17:20                 ` Denis Bueno
2004-11-04  1:24   ` java and tag completion Nic Ferrier

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1CRfA0-0007tn-Cl@kanga \
    --to=nferrier@tapsellferrier.co.uk \
    --cc=emacs-devel@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.