From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: shell command completion gone Date: Fri, 7 Jan 2011 08:14:32 -0800 Message-ID: References: <87pqs9cive.fsf@towardsfreedom.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1294417477 20444 80.91.229.12 (7 Jan 2011 16:24:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 7 Jan 2011 16:24:37 +0000 (UTC) To: "'prad'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 07 17:24:33 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PbF78-0007ld-Ha for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Jan 2011 17:24:32 +0100 Original-Received: from localhost ([127.0.0.1]:58530 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbF1B-0004zC-MT for geh-help-gnu-emacs@m.gmane.org; Fri, 07 Jan 2011 11:18:21 -0500 Original-Received: from [140.186.70.92] (port=42755 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbEyR-00039B-II for help-gnu-emacs@gnu.org; Fri, 07 Jan 2011 11:15:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PbEyQ-0000yk-1K for help-gnu-emacs@gnu.org; Fri, 07 Jan 2011 11:15:31 -0500 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:19086) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PbEyP-0000xq-SF for help-gnu-emacs@gnu.org; Fri, 07 Jan 2011 11:15:29 -0500 Original-Received: from rcsinet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p07GFP3B025942 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 7 Jan 2011 16:15:26 GMT Original-Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by rcsinet13.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id p079leIU011488; Fri, 7 Jan 2011 16:15:25 GMT Original-Received: from abhmt002.oracle.com by acsmt355.oracle.com with ESMTP id 908237981294416874; Fri, 07 Jan 2011 08:14:34 -0800 Original-Received: from dradamslap1 (/10.159.218.13) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 07 Jan 2011 08:14:34 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <87pqs9cive.fsf@towardsfreedom.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 thread-index: AcuuNnx53KVVYmCwSAuNOzdii9EWDwAR1B3w X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:78295 Archived-At: > when i do M-!, type a few characters and then press tab it used to > complete. suddenly it doesn't anymore. the only thing i can think of > having done is that i reinstalled icicles from the site (not my arch > distribution), but i don't see what that would have to do with it, > because it doesn't use icicles afaik. > > if i go into a shell, everything completes just fine. > what does completion depend upon for the shell command? Yes, it is because by default Icicles provides a different kind of completion for shell commands. Admittedly, this has confused more than one person. You can customize option `icicle-redefine-standard-commands-flag' to `nil' to restore the vanilla Emacs behavior here, if that's what you prefer. For info about this completion: http://www.emacswiki.org/emacs/Icicles_-_Shell-Command_Enhancements There are 3 possible sources of completion candidates here: 1. Programs on your $PATH (if `icicle-guess-commands-in-path' is non-nil), as proxy candidates. (nil is the default value.) 2. Programs deemed appropriate for the target file types, as proxy candidates. E.g., in Dired, `gunzip -qc * | tar xvf -' might be a candidate command for target file `foo.tgz'. 3. Programs anywhere - file names. To make #1 and #2 available, you must turn on proxy candidates (if off). Use `C-M-_' during completion to do that (once). (You can customize option `icicle-add-proxy-candidates-flag' to turn it on by default.) Wrt #3: Icicles completion here is file-name completion, to let you complete against command files anywhere, not just those on your $PATH. It is this that is particularly confusing at first (unexpected). The idea is that not every program/command you might want to use is on your PATH or preconfigured by a file-type association. The former is especially true on Windows, I think - PATH is not used as much on Windows, especially by users who do not program on Windows (which means most Windows users). For #2, there are in turn two sources of "appropriate" programs: 2a. Whatever `dired-guess-default' guesses for the target files. This is determined by variable `dired-guess-shell-alist-default' and user option `dired-guess-shell-alist-user'. This is available only if you load `dired-x.el'. 2b. Whatever `mailcap-file-default-commands' returns for the target files (based on MIME types of the target files). This is only for Emacs 23 and later. Note that #2 is true in Dired for `!' and outside Dired for `M-!' (provided you load `dired-x.el'). These candidates are available whenever a shell command is read in Icicles. File-name completion is very different from command completion, so in order to allow completion of arbitrary program files I opted for file-name completion and then brought in proxy candidates for the known commands (those on $PATH and the others mentioned above). When you complete, the proxy candidates are sorted first, and they are highlighted specially in *Completions* for easy recognition. If `icicle-guess-commands-in-path' is nil (the default), then the only proxy candidates are those from #2: programs that are known to be appropriate candidates for the file type in question. This takes effect in contexts such as Dired where the files that are the targets of the command you will choose are already known. E.g., for a PDF file in Dired, `!' will include commands such as `gv -safer', `xpdf', and `pdftotext ? -'. Sorry for any confusion. HTH.