[geeks] Emacs .emacs question

Micah R Ledbetter vlack-lists at vlack.com
Fri Feb 8 16:38:07 CST 2008


Scotty Logan wrote:
> On Feb 8, 2008, at 7:49 AM, Joshua Boyd wrote:
>> I want to make something in my .emacs file conditional upon whether
>> emacs is running in a GUI (X11, OSX, Win32) window instead of a terminal
>> window.
> 
> (display-graphic-p)
> 
> returns non-nil if the current display is graphical.

I use "(eq window-system nil)", wrapping it with an "unless" (in this 
case, though an "if" would work too).

I actually have several conditions for various types of window systems; 
various values for window-system might be nil (as above), x, w32, 
Interix, ns (Cocoa-flavored Mac) or mac (Carbon-flavored Mac). (All of 
the preceding besides "nil" would be designated like so: "(eq 
window-system 'w32)", i.e., with the single-quote.) I also use "(eq 
system-type 'something)" for one or two things.

For the pathologically interested, you can see my .emacs here: 
<http://mrled.org/svn/dhd/hbase/.emacs>

  - Micah



More information about the geeks mailing list