views:

106

answers:

1

Hello!

I'm running Carbon Emacs on Macs here, and my GUI emacs has an extremely pleasing colour scheme set up to use. Unfortunately, it looks like hell when running "emacs" in a Terminal window, which parses the same .emacs file in my root folder.

So, is there a way to conditionally execute code in my .emacs file so that I can select a different colour scheme for command line and "GUI" emacs?

Thanks!

+10  A: 

You can use the window-system variable to determine if you're running Emacs in a windowed environment. For example, you could add something like the following to your .emacs.el:

(when window-system
  (setq default-frame-alist
    (append
      '((background-color . "#102e4e")
        (background-mode  . dark)
        ...))))

Here's the documentation for the window-system variable (viewable within Emacs by typing C-h v window-system RET):

Name of window system through which the selected frame is displayed.
The value is a symbol--for instance, `x' for X windows.
The value is nil if the selected frame is on a text-only-terminal.

Emerick Rogul
Cheers. Did the trick.