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: Re: Proposal for shell completion in M-x shell RET Date: Mon, 10 Sep 2007 16:30:01 +0200 Message-ID: <86ejh64mqe.fsf@lola.quinscape.zz> References: <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 1189437784 20026 80.91.229.12 (10 Sep 2007 15:23:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 10 Sep 2007 15:23:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 11 01:22:51 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 1IUrlu-0007HN-4r for ged-emacs-devel@m.gmane.org; Tue, 11 Sep 2007 00:30:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IUkHX-0006Ex-Jo for ged-emacs-devel@m.gmane.org; Mon, 10 Sep 2007 10:30:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IUkH7-0005wd-56 for emacs-devel@gnu.org; Mon, 10 Sep 2007 10:30:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IUkH5-0005uv-Qy for emacs-devel@gnu.org; Mon, 10 Sep 2007 10:30:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IUkH5-0005ui-Bm for emacs-devel@gnu.org; Mon, 10 Sep 2007 10:30:03 -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 1IUkH4-0000QN-R6 for emacs-devel@gnu.org; Mon, 10 Sep 2007 10:30:03 -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 QAA00545 for ; Mon, 10 Sep 2007 16:29:54 +0200 X-Delivered-To: Original-Received: (qmail 9353 invoked from network); 10 Sep 2007 14:30:01 -0000 Original-Received: from unknown (HELO www.quinscape.de) ([10.0.3.43]) (envelope-sender ) by ns.quinscape.de (qmail-ldap-1.03) with SMTP for ; 10 Sep 2007 14:30:01 -0000 Original-Received: by www.quinscape.de (Postfix, from userid 1001) id 36D3A8F8EE; Mon, 10 Sep 2007 16:30:01 +0200 (CEST) In-Reply-To: (Stefan Monnier's message of "Mon\, 10 Sep 2007 10\:19\:24 -0400") 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:78453 Archived-At: Stefan Monnier writes: >> 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, > > It would most likely have to be another key, because shell.el cannot know if > the command is sent to bash or to some other application, so it could only > be the user's choice to either get local completion or to send "prefix string > plus TAB" to the application. Maybe this can help on some platforms? process-running-child-p is a built-in function in `C source code'. (process-running-child-p &optional PROCESS) Return t if PROCESS has given the terminal to a child. If the operating system does not make it possible to find out, return t unconditionally. [back] Anyway, one could just send the partial line plus TAB to the other application, anyway. If it just echoes it, no harm is done. The behavior should work for most applications that use either a normal stty setting or readline. -- David Kastrup