From: Daniel Jacobowitz <drow@mvista.com>
To: bug-readline@gnu.org
Cc: gdb@sources.redhat.com
Subject: Difficulty with the readline completion interface in GDB
Date: Sun, 18 Jan 2004 22:49:00 -0000 [thread overview]
Message-ID: <20040118224929.GA8226@nevyn.them.org> (raw)
Hi Chet,
I've spent this morning trying to fix a long-standing bug in GDB's tab
completion. I think it's unsolvable with the current readline interface, so
I'd like your suggestions on how to improve the situation.
The gist of the problem is that different parts of the command line have
different word break characters. For example, '/' is a word break character
after a command or a symbol, but not after a directory name. There's no way
to explain this to Readline. Right now, we do a lot of fudging
rl_completer_word_break_chars, but it's never quite in time. As a result,
we get this chain of events:
- rl_completer_word_break_chars contains '/' and '.'
- The user enters "file ./gdb.base<TAB>"
- GDB's complete_line is called from rl_complete. The text parameter
is "base", because . was treated as a word separator.
- We return, and readline stats the file to figure out whether to add
a slash after it. It stats "base", having lost the "./gdb.". Stat
fails.
- A space is inserted instead of the slash (gdb.base is a directory).
There's a lot of possible solutions. There could be a hook called before
rl_complete generates the matches list, which could fudge the complete
characters - most direct solution, not very elegant. A function could be
called to get the list of complete characters, which would then be sensitive
to rl_point - not sure what other issues this could cause. The filename
completion code could search backwards according to the list of filename
wordbreak characters; this would solve the specific problem but not the
more general one. Probably there are others.
What do you think?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next reply other threads:[~2004-01-18 22:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-18 22:49 Daniel Jacobowitz [this message]
2004-01-19 6:14 ` Eli Zaretskii
2004-01-28 20:09 ` Chet Ramey
2004-01-28 20:17 ` Daniel Jacobowitz
2004-01-29 23:33 ` Elena Zannoni
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=20040118224929.GA8226@nevyn.them.org \
--to=drow@mvista.com \
--cc=bug-readline@gnu.org \
--cc=gdb@sources.redhat.com \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox