From: "ISHIKAWA,chiaki" <ishikawa@yk.rim.or.jp>
To: help-gnu-emacs@gnu.org
Subject: Question: Is there any way to use the bash completion feature from Emacs shell mode.
Date: Sun, 9 Oct 2016 04:14:23 +0900 [thread overview]
Message-ID: <51ed4bfc-fbb1-9c29-afe9-fafabab3b7ce@yk.rim.or.jp> (raw)
Hi,
I have been using GNU emacs more than 30 years and thank you for
maintaining the great package.
I have a question.
Bash, the GNU shell interpreter has a feature called completion, and
over the years, people have created various completion databases for
many commands which are useful.
Case in point.
I just noticed the source control system called mercurial (known as "hg"
with its main command) has a very nice bash completion database.
The completion understands where the various so called MERCURIAL's patch
queues are stored and thus can offer the alternatives quite easily.
e.g.
After including
. /usr/share/bash-completion/completions/hg
(I am using Debian GNU/Linux and the above is where the completion code
for hg is stored.)
I can do the following inside a bash on an ordinary console.
$ hg qq [TAB]
expands to
$ hg qqueue
another couple of [TABS] expands to
--create TEST patches
--delete TEST-Q pristine
--list one-letter-C-locale submission
--purge partial4upload submission1
--rename partial4upload-1
$ hg qqueue
hitting pa[TAB] expands to
$hg qqueue pa
partial4upload partial4upload-1 patches
ishikawa@ip030:/NREF-COMM-CENTRAL/comm-central/mozilla$ hg qqueue pa
Very nice.
However, due to various reasons, I prefer to run bash inside Emacs's
shell buffer. It is easy to copy&paste the result of bash output and
reuse commands is one reason. (I am so used to keyboard and copy&paste
using mouse or other pointing device takes much longer.)
Unfortunately, bash's completion feature does not work in Emacs shell mode.
Obviously, [TAB] is stolen by Emacs for its own handling of TAB character.
Emacs's tab completion for filenames works great.
But I would like Bash's completion somehow works, too.
Is there a way?
Am I missing the obvious?
(Does using eshell mode helps?)
TIA
next reply other threads:[~2016-10-08 19:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-08 19:14 ISHIKAWA,chiaki [this message]
2016-10-09 18:11 ` Question: Is there any way to use the bash completion feature from Emacs shell mode Dan Hitt
2016-10-10 6:06 ` Eli Zaretskii
2016-10-10 14:05 ` Dan Hitt
2016-10-10 14:13 ` Dan Hitt
2016-10-11 1:02 ` Bob Proulx
2016-10-11 0:59 ` Bob Proulx
2016-10-11 12:12 ` Filipp Gunbin
2016-10-10 0:49 ` Bob Proulx
2016-10-10 13:40 ` Oleksandr Gavenko
2016-10-10 23:24 ` Dmitry Gutov
2016-10-12 0:25 ` ISHIKAWA,chiaki
2016-10-12 18:50 ` Oleksandr Gavenko
2016-10-19 1:12 ` Robert Thorpe
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51ed4bfc-fbb1-9c29-afe9-fafabab3b7ce@yk.rim.or.jp \
--to=ishikawa@yk.rim.or.jp \
--cc=help-gnu-emacs@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).