emacs-devel
[Top][All Lists]
Advanced

[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 00:35:01 +0000

Stefan Monnier <address@hidden> writes:

>> - Emacs starts a Readline program, eg: psql (the PostgreSQL client)
>>   with a special option specifying signifying this mode of operation.
>
> A command-line argument is probably a bad idea (for cases like when you
> start psql via a script (or a make file), ...).  An env-var would be good.
>
>> This seems like it wouldn't be that hard to add to Emacs and probably
>> not to Readline either.
>
> Sounds like a good idea.
>
> Such tools often offer things like a `listcompletions' commands which
> Emacs can use to implement the completion itself.  Such a thing is used by
> GUD for gdb.  

Readline has a few standard functions:

  int rl_complete_internal (int what_to_do)

  int rl_complete (int ignore, int invoking_key)

  int rl_possible_completions (int count, int invoking_key)

  int rl_insert_completions (int count, int invoking_key)

  int rl_completion_mode (rl_command_func_t *cfunc)

Which, AFAIK, is what *most* programs doing completion use.  This is
what Readline should advertise to Emacs (or whatever, this wouldn't be
Emacs specific necessarily).

There are a number of other Readline completion tools and, with
slightly a complex advertising protocol, it would be possible to hook
those in too.


> Standardizing support for such things directly in comint might
> also be a good idea, tho not as good because it only works for those
> programs that go to the trouble of providing a `listcompletions'
> command.

But it wouldn't be difficult for comint to detect when this behaviour
is offered by Readline, either:

- do a version detect on the readline .so

- have this feature make readline send a "hello", when the "hello"
  isn't received then comint will know this feature is not available.

-- 
Nic Ferrier
http://www.tapsellferrier.co.uk




reply via email to

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