Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bjb.butler

macrumors 6502a
Original poster
Aug 18, 2008
938
81
Southern California
Hey everyone

In school, I am learning to program. We use linux (CentOS). I usually just open a terminal and type ' emacs & ' , and that will open emacs in a new window, and i wil be able to use the terminal also. When i do this on mac, I get cryptic messages like:

[1] 2768

or

[2] 2769

[1]+ Stopped emacs

-------------------------------

when i type just 'emacs' It opens up emacs in the terminal, which is not what I want.

How do you open a new emacs window from the terminal?

thanks,bj
 

firestarter

macrumors 603
Dec 31, 2002
5,506
227
Green and pleasant land
Just a quick guess (because I never use Emacs). At school you probably have X windows running, and your DISPLAY environment variable is set. emacs & will start emacs running under X, as a background task.

On the Mac in a regular terminal, Emacs probably thinks you want to run using terminal emulation, since X isn't running by default, or configured. So it starts up in the background, can't figure out what it's supposed to do (since it has no terminal to write to) and quits.

You should learn vi anyway, if you want to program properly. :cool:
 

bjb.butler

macrumors 6502a
Original poster
Aug 18, 2008
938
81
Southern California
Just a quick guess (because I never use Emacs). At school you probably have X windows running, and your DISPLAY environment variable is set. emacs & will start emacs running under X, as a background task.

On the Mac in a regular terminal, Emacs probably thinks you want to run using terminal emulation, since X isn't running by default, or configured. So it starts up in the background, can't figure out what it's supposed to do (since it has no terminal to write to) and quits.

You should learn vi anyway, if you want to program properly. :cool:

Can you explain a little clearer about emacs running under X?

At school we use CentOS linux, when you type the program name, it launches the program separately.
How do I make this action happen the same on Leopard?

And also, we can use any editor we want, but I was just stating emacs because that's what the default is. What are the advantages of using vi over emacs?
 

firestarter

macrumors 603
Dec 31, 2002
5,506
227
Green and pleasant land
OK - I just read somewhere that OSX Emacs isn't compiled to use X windows (although it was a post from a couple of years back - but I can't get it to work under X, so I believe it).

You have 4 options:
  • Use Emacs in the terminal (ie, don't background it). If you want a new terminal window, just select 'New Window' in the terminal menu.
  • Download a full X version of Emacs (go to macports.org)
  • Use vi (which is small, light, fast, simple and powerful)
  • Buy TextMate or BBEdit. These two are stunning programmer's editors - very productive with code templates etc.
 

alaceo

macrumors member
Feb 21, 2008
32
0
If you want to use Emacs, open two terminal windows - type "emacs" in one to launch Emacs, then just use the other as a terminal. The others have explained why, but this will give you roughly the same environment (minus X11). Vi/Vim is also another option, and there are also several graphical text editors such as Xcode, Smultron, TextWrangler, etc.
 

yeroen

macrumors 6502a
Mar 8, 2007
944
2
Cambridge, MA
Like the others said, leave off the ampersand (I'm guessing on you linux box, emacs is aliased in your shell to the XEmacs program).

Also in your Mac, you have the option of installing and running Emacs.app or Aquaemacs, both of which provide an nice Aqua wrapper around emacs.
 

bjb.butler

macrumors 6502a
Original poster
Aug 18, 2008
938
81
Southern California
Can you access your school's system though SSH on terminal or X11 and use the program that way?

On OSX, I cop out and use Aquamacs.

Ok thanks for the replies everyone.

I've downloaded Aquamacs, and will start using that, but I can't figure out how to turn on the syntax highlighting. I've went through the menus, and have looked at the documentation. How do you turn on syntax highlighting?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.