[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is TAB-completion in shell not working for some commands?

From: Jonathan Oddie
Subject: Re: Why is TAB-completion in shell not working for some commands?
Date: Wed, 9 Nov 2011 17:38:16 +0000

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/
> and not the /Applications/ (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/ 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/ is just the
executable file hidden inside the bundle. So it really does
depend on starting from the Terminal and picking up your PATH

> [snip]

> => 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 
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,
> Marius

reply via email to

[Prev in Thread] Current Thread [Next in Thread]