bug-readline
[Top][All Lists]
Advanced

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

Re: Access to readline completions without line editing


From: Chet Ramey
Subject: Re: Access to readline completions without line editing
Date: Tue, 3 Oct 2023 11:15:12 -0400
User-agent: Mozilla Thunderbird

On 9/26/23 9:54 PM, sbaugh@catern.com wrote:

Hi,

GNU Emacs wraps many readline-using programs, but disables readline in
favor of its own line-editing commands.  However, it would be great for
Emacs to still be able to access readline completions on demand; then
Emacs would display those completions to the user in Emacs-y ways.

What do you mean by `readline completions'? Readline has builtin support
for only a few things: filename and directory name completion, username
completion for tilde expansion, and very little else.

Readline primarily offers support for determining the word to be completed,
calling an application-specific completion function if one is set, and
inserting or displaying the results. All of this requires that readline
be used to perform line editing and is part of the readline API.

Right now there's no support in Emacs for accessing these completions,
so completion in such programs is usually reimplemented inside Emacs in
ad-hoc ways, or isn't supported at all.

Again, it's not clear what you mean by `these completions'. Do you mean
something like bash-completion? If you do, then any access to application-
specific completion functions has to be provided by the application.

How should we access these completions if we want to disable
line-editing?

If you want to disable readline, then readline won't have any access to
the line editing data, and can't really do anything.

What do you recommend?  Is there an existing mechanism
which would be suitable for this?

There are application-specific mechanisms like bash's `compgen' builtin.

Or could a new feature for this be
added to readline?

How would that work? Readline's not in the picture here.

Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

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