unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Question: Is there any way to use the bash completion feature from Emacs shell mode.
@ 2016-10-08 19:14 ISHIKAWA,chiaki
  2016-10-09 18:11 ` Dan Hitt
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: ISHIKAWA,chiaki @ 2016-10-08 19:14 UTC (permalink / raw)
  To: help-gnu-emacs

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



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2016-10-19  1:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-08 19:14 Question: Is there any way to use the bash completion feature from Emacs shell mode ISHIKAWA,chiaki
2016-10-09 18:11 ` 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

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).