From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Proposal for shell completion in M-x shell RET Date: Mon, 10 Sep 2007 14:44:56 +0200 Message-ID: <86r6l67kqf.fsf@lola.quinscape.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1189433306 3511 80.91.229.12 (10 Sep 2007 14:08:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 10 Sep 2007 14:08:26 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 11 00:08:13 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IUq7p-0005DH-1s for ged-emacs-devel@m.gmane.org; Mon, 10 Sep 2007 22:44:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IUidS-0001c5-Gg for ged-emacs-devel@m.gmane.org; Mon, 10 Sep 2007 08:45:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IUidP-0001a7-JO for emacs-devel@gnu.org; Mon, 10 Sep 2007 08:44:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IUidO-0001Z1-FO for emacs-devel@gnu.org; Mon, 10 Sep 2007 08:44:59 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IUidO-0001Ys-7k for emacs-devel@gnu.org; Mon, 10 Sep 2007 08:44:58 -0400 Original-Received: from pc3.berlin.powerweb.de ([62.67.228.11]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IUidN-0002mk-OU for emacs-devel@gnu.org; Mon, 10 Sep 2007 08:44:58 -0400 Original-Received: from quinscape.de (dslnet.212-29-44.ip210.dokom.de [212.29.44.210] (may be forged)) by pc3.berlin.powerweb.de (8.9.3p3/8.9.3) with ESMTP id OAA28207 for ; Mon, 10 Sep 2007 14:44:51 +0200 X-Delivered-To: Original-Received: (qmail 3209 invoked from network); 10 Sep 2007 12:44:56 -0000 Original-Received: from unknown (HELO lola.quinscape.zz) ([10.0.3.43]) (envelope-sender ) by ns.quinscape.de (qmail-ldap-1.03) with SMTP for ; 10 Sep 2007 12:44:56 -0000 Original-Received: by lola.quinscape.zz (Postfix, from userid 1001) id AB1A18F8EB; Mon, 10 Sep 2007 14:44:56 +0200 (CEST) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-Detected-Kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:78440 Archived-At: Hi, it turns out that when using bash's programmable completion, the results are typically much better than Emacs' completion. Since it is unfeasible to mimic or interpret the wealth of shell-completion scripts in Emacs, I would propose making it configurable to use the shell completion instead. The way this would work would be when TAB is pressed to send the partial line up to the cursor as input to the shell, followed by TAB, then capture the output from bash and interpret it (either inserting completed output, or offering a completion menu). When committing a line (or pressing TAB), when the partial line already submitted does not correspond with the one in the shell command line, the line is erased and committed fresh, otherwise only the rest of the line is submitted. This approach would have the advantage of leaving no trace of the completion in the shell history unless a command is actually sent to the shell. It should also work with other shells. -- David Kastrup