[Top][All Lists]

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

a suggested solution for better external' completion in certain emacs mo

From: Nic Ferrier
Subject: a suggested solution for better external' completion in certain emacs modes
Date: Mon, 08 Nov 2004 23:30:14 +0000

As we are all aware, certain Emacs interactions are not as useful as
their shell like counterparts.

For example, using sql-mode to interact with PostgreSQL is not as
useful as doing it outside of Emacs.

The reason for this is that comint mode cannot effectively communicate
with certain programs to do things like completion.

I have a proposal for fixing that and this email describes it.

Most of the programs whose integration with Emacs we want to improve
use the GNU Readline library. This is why they have sophisticated
completion mechanisms.

GNU Readline works by defining an API for the things that a shell like
program will want to do and allowing keys to be bound to those API

So my suggestion for improving Emacs access to such programs is to add
an option to the GNU Readline library which allows Emacs to
call Readline API functions 'out of band'.

In effect this would work like this:

- Emacs starts a Readline program, eg: psql (the PostgreSQL client)
  with a special option specifying signifying this mode of operation.

- Readline somehow sees the option (maybe it is passed as an ENV var)
  and configures itself for this mode of operation

Readline and Emacs are now connected by some sort of stream (probably
just a standard comint/stdin scheme).

- Readline advertises to Emacs the functions the current program
  supports  by writing the information (a sexp?) to the stream

- Emacs reads the config from Readline and configures itself
  appropriately to bind Emacs keys to functions which send API calls
  to Readline over the stream.

- Readline communicates the status of the current line, and other
  status information (eg: completions) back over the stream for Emacs to

This seems like it wouldn't be that hard to add to Emacs and probably
not to Readline either.

Anyone have any thoughts?

Nic Ferrier

reply via email to

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