From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Feature request : Tab-completion for 'shell-comand' Date: Wed, 05 Mar 2008 01:17:22 +0200 Organization: JURTA Message-ID: <87myperse5.fsf@jurta.org> References: <874pbmjgsy.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1204672888 6599 80.91.229.12 (4 Mar 2008 23:21:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 4 Mar 2008 23:21:28 +0000 (UTC) Cc: paul r , TSUCHIYA Masatoshi , emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 05 00:21:54 2008 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 1JWgS8-0003XL-3z for ged-emacs-devel@m.gmane.org; Wed, 05 Mar 2008 00:21:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JWgRa-0005Z4-QJ for ged-emacs-devel@m.gmane.org; Tue, 04 Mar 2008 18:21:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JWgRW-0005Yq-Cq for emacs-devel@gnu.org; Tue, 04 Mar 2008 18:21:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JWgRU-0005YY-Vi for emacs-devel@gnu.org; Tue, 04 Mar 2008 18:21:06 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JWgRU-0005YT-QG for emacs-devel@gnu.org; Tue, 04 Mar 2008 18:21:04 -0500 Original-Received: from relay03.kiev.sovam.com ([62.64.120.201]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JWgRU-0007fS-D4 for emacs-devel@gnu.org; Tue, 04 Mar 2008 18:21:04 -0500 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay03.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1JWgRJ-000Huo-9B; Wed, 05 Mar 2008 01:21:01 +0200 In-Reply-To: <874pbmjgsy.fsf@gmx.de> (Michael Albinus's message of "Tue, 04 Mar 2008 22:54:53 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-unknown-linux-gnu) X-Scanner-Signature: 308c5668300cb665e09cc4617523e4c8 X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2355 [Mar 4 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Info: {TO: local part of email appears in body} X-SpamTest-Method: none X-SpamTest-Rate: 20 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release X-detected-kernel: by monty-python.gnu.org: FreeBSD 6.x (1) 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:91336 Archived-At: >> M-x shell-command, as well as its relatives (shell-command-on-region, >> grep, grep-find, compile and maybe more), do not provide any kind of >> completion in the minibuffer. This is a surprising behaviour, because >> almost any other interactive function prompting for something that can >> be tab-completed do provide tab-completion. >> TSUCHIYA Masatoshi wrote an enhancement for it, that can be found >> http://namazu.org/~tsuchiya/elisp/shell-command.el . This code works >> against current head. > > It's a neat package. However, its implementation is based mainly on > defadvices of shell-command, shell-command-on-region, grep, grep-find > and compile. I don't believe that it shall be integrated into the Emacs > core lisp *this* way. This could be a conflict, because the author seems > to be interested in offering this package for different Emacs version, > where this approach looks necessary. This is a useful feature to add to Emacs, and it is a pity it uses defadvices. Perhaps defadvices could be replaced by a new shell-command specific minibuffer keymap that just redefines TAB to perform completion on commands and file names. What I mean basically is: (define-key shell-command-minibuffer-local-map "\t" (lambda () (interactive) (require 'shell) (let ((comint-dynamic-complete-functions shell-dynamic-complete-functions)) (comint-dynamic-complete)))) and use this map for reading commands in shell-command, shell-command-on-region, grep, grep-find and compile. -- Juri Linkov http://www.jurta.org/emacs/