Can't open cocoa emacs from terminal using open -a
        Posted  
        
            by 
                Shane
            
        on Super User
        
        See other posts from Super User
        
            or by Shane
        
        
        
        Published on 2011-02-04T14:40:34Z
        Indexed on 
            2011/02/06
            7:28 UTC
        
        
        Read the original article
        Hit count: 396
        
I installed emacs on my MacBook Air running Mac OS X 10.6.5 from this site http://emacsformacosx.com/. I believe this is what used to be called cocoa emacs. I dragged it into my Application folder and it works fine when I run it from there. I want to be able to run it from the Terminal. After some googling, I tried open -a /Application/Emacs.app foo.txt (foo.txt was and existing file). I got two emacs windows - one with welcome screen and one with foo.txt loaded. I tried a few applications in the /Applications directory and they did not seem to behave like this. I had installed it using my own account (an admin account) so after doing ls -l on /Application I noticed that the owner and group were different from the other entries in this folder. I recursively changed the owner and group to root and wheel, like the others, but this did not help. The only thing that looks funny now is that there that ls -l show a @ character which has something to do with extended attributes but I don't know how to check these. 
Any suggestions on what to check next?
Is using the open command the only to run the program? Can I simulate what it does using a shell script?
© Super User or respective owner