From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "PT" Newsgroups: gmane.emacs.help Subject: Re: Passing tab to inferiors shell in Shell mode Date: 24 Feb 2006 12:35:11 -0800 Organization: http://groups.google.com Message-ID: <1140813311.159507.251020@i39g2000cwa.googlegroups.com> References: <1140702691.193679.142200@v46g2000cwv.googlegroups.com> <1140763831.980129.168280@p10g2000cwp.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1141187302 5571 80.91.229.2 (1 Mar 2006 04:28:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 1 Mar 2006 04:28:22 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 01 05:28:22 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FEIwk-0005Rr-Gh for geh-help-gnu-emacs@m.gmane.org; Wed, 01 Mar 2006 05:28:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FEIwi-0001tx-Ri for geh-help-gnu-emacs@m.gmane.org; Tue, 28 Feb 2006 23:28:17 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!i39g2000cwa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Original-NNTP-Posting-Host: 81.182.145.128 Original-X-Trace: posting.google.com 1140813316 26712 127.0.0.1 (24 Feb 2006 20:35:16 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 24 Feb 2006 20:35:16 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Opera/8.50 (Windows NT 5.0; U; en),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: i39g2000cwa.googlegroups.com; posting-host=81.182.145.128; posting-account=b98TkQ0AAAD7PsllN8gfWGRoPOPWdnv4 Original-Xref: shelby.stanford.edu gnu.emacs.help:137783 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:33420 Archived-At: Barry Margolin wrote: > In article <1140763831.980129.168280@p10g2000cwp.googlegroups.com>, > > The problem is that shell-mode is NOT a video terminal emulator. Even > if you send TAB, the shell you're sending to won't be able to do all the > cursor control to display completions -- the escape sequences will just > show up as literal characters in the buffer. > I think I figured out what to do in theory: When tab is pressed a raw tab character is to be sent to the inferior shell (I found a code snippet which does this). The inferior shell performs the completion and displays the possible candidates. The displayed list is saved and removed from the shell buffer, otherwise it would be considered part of the input for the next command. Then the saved list is parsed and a completion buffer is popped up for the user to select a completion (like in case of file completion), The selected completion is then inserted back to the buffer. Of course, there will be a bit of flickering when the inferior shell writes its output and it is removed from the shell buffer, but it's not a great price for better completion. The only thing left is to implement the whole thing. :)