From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jonathan Oddie Newsgroups: gmane.emacs.help Subject: Re: Why is TAB-completion in shell not working for some commands? Date: Wed, 9 Nov 2011 17:38:16 +0000 Message-ID: <1979BC10-E138-4B26-83BD-CBBBEC6F09CC@gmail.com> References: <8BF2824B-97AC-4722-8F2C-C572C5F558FF@gmail.com> <1E4EE682-3100-41C9-A4C5-1E537BF01647@math.ethz.ch> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1320860315 16378 80.91.229.12 (9 Nov 2011 17:38:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 Nov 2011 17:38:35 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Marius Hofert Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 09 18:38:31 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ROC6Y-0000bx-3I for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Nov 2011 18:38:30 +0100 Original-Received: from localhost ([::1]:56409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROC6X-0002Qj-Iq for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Nov 2011 12:38:29 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:33111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROC6S-0002QT-TM for help-gnu-emacs@gnu.org; Wed, 09 Nov 2011 12:38:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROC6O-0007s1-M7 for help-gnu-emacs@gnu.org; Wed, 09 Nov 2011 12:38:24 -0500 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:38839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROC6O-0007rp-F5 for help-gnu-emacs@gnu.org; Wed, 09 Nov 2011 12:38:20 -0500 Original-Received: by wyg24 with SMTP id 24so2248614wyg.0 for ; Wed, 09 Nov 2011 09:38:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=1beMADlnOKL2JiCOhdLfkxdcNLlvck0DpXBtDE0Ynd0=; b=wwmf+oRDAmDs0/CT4oS7bULg10eyrAMXhMZZbRTl5QRRHX13gvx/SuZBHwG69MHC2P pdajLzhp+Zg0I6Nj0zgbtfwgao+EIZXEEiB0BQvAbskr2OIXke3Dqcz6wktqVDrB8trI MJ5WhvnuVhKRVxnWHtbRS1QVo2yKLWReb9zNk= Original-Received: by 10.227.206.200 with SMTP id fv8mr2503020wbb.11.1320860299552; Wed, 09 Nov 2011 09:38:19 -0800 (PST) Original-Received: from stu-40-200.magd.ox.ac.uk (stu-40-200.magd.ox.ac.uk. [129.67.40.200]) by mx.google.com with ESMTPS id ep13sm882322wbb.8.2011.11.09.09.38.17 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Nov 2011 09:38:17 -0800 (PST) In-Reply-To: <1E4EE682-3100-41C9-A4C5-1E537BF01647@math.ethz.ch> X-Mailer: Apple Mail (2.1084) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:82825 Archived-At: Hi Marius, > 1) If I start emacs from the terminal, TAB-completion works (as = reported earlier). Now the emacs I start from the terminal is actally = (output of "which emacs"): > /Applications/Emacs.app/Contents/MacOS//emacs > and not the /Applications/Emacs.app (the GUI version one clicks on in = the dock). So when I started emacs from the terminal, I used Options -> = Keep in Dock to keep that in the dock instead of = /Applications/Emacs.app. Starting the former, I again did not have = TAB-completion, so it only works when (really) starting emacs from the = terminal (which is funny cause I thought I can get rid of the Mac's = terminal since I have a shell in emacs...) > Don't know if that makes sense to the experts, I just wanted to report = on this. Those two are actually the same thing. /Applications/Emacs.app/Contents/MacOS/emacs is just the executable file hidden inside the Emacs.app bundle. So it really does depend on starting from the Terminal and picking up your PATH settings. > [snip] >=20 > =3D> Clearly, the /opt-directories are missing. I haven't tried but = one might just add all directories from PATH to exec-path, but whenever = I change PATH, I have to remember to do the same for exec-path. Is there = a nicer way? Yes, I'd try adding your /opt directories to `exec-path' first and see = if that fixes the problem. You can either something like the (setq exec-path (append = ... )) solution in my last email, or the following: (add-to-list 'exec-path "/some/path/here") Note that you might *also* need to set the environment PATH variable from within Emacs; that's the line with `mapconcat' in my prev email. As I said, I forget exactly how each of these things interacts with shell-mode's tab-completion. If that works, the nicer solution would probably involve having your .emacs run a short shell script to print out and parse the value of PATH set in your .bashrc (or wherever), and set PATH and `exec-path' based on that. I'll try and work out a quick hack for this later this evening, if someone doesn't beat me to it ;-) cheers, Jonathan >=20 > Cheers, >=20 > Marius >=20 >=20