help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to detect if Emacs is running in a terminal


From: Stefan Monnier
Subject: Re: How to detect if Emacs is running in a terminal
Date: Sat, 16 Apr 2005 08:18:47 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> (when (eq system-type 'gnu/linux) ...)
> (when (eq system-type 'windows-nt) ...)
> (when window-system ...)

In 99% of the cases, people want their Emacs to behave the same on all their
machines, so the config should be the same, no matter whether it's
GNU/Linux, w32, uses window-system, ...

What can happen, tho, is that depending on the machine some things may or
may not be available.  In that case just prepend each such customization
with a little test that ensures that feature can be used.
This test will generally not look at system-type or window-system, but will
instead check (fboundp <somefunctionIwanttouse), or (file-directory-p
"somedirectoryIwanttouse"), or even place a whole subexpression inside
a (ignore-errors ...my config...).


        Stefan


reply via email to

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