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: Ismael Valladolid Torres
Subject: Re: How to detect if Emacs is running in a terminal
Date: Sat, 16 Apr 2005 14:05:58 +0200
User-agent: Mutt/1.5.8i

Pascal Bourguignon escribe:
> Denis Bueno <address@hidden> writes:
> 
> > Is there some emacs lisp function that I could call to detect whether
> > the current emacs process is running from within a terminal or not?
> > 
> > I'd like to be able to change my font-lock faces based on whether
> > emacs is running in a terminal or not. At the moment I deal with this
> > in the following way.
> > 
> > I have a .emacs-common which contains code that should be loaded
> > regardless of the emacs interface. My .emacs is of course loaded by
> > default whenever I run Emacs in a window (not in a terminal). This
> > contains various font settings and colors used in the windowed Emacs.
> > I have a .emacs-terminal which contains various font settings and
> > colors used in the terminal Emacs.
> > 
> > So, when I want to use Emacs in the terminal, I run:
> > 
> >     emacs -nw -q -l ~/.emacs-terminal
> > 
> > Is there a better way?
> 
> (list system-type system-name window-system)
> 
> ;; system-type          darwin   gnu/linux  cygwin
> ;; system-name          "naiad.informatimago.com" "hermes.afaa.asso.fr"
> ;; system-configuration "i686-pc-linux-gnu" "i686-pc-cygwin"
> ;; window-system        nil x mac
> ;; emacs-major-version  18 19 20 21
> ;; emacs-minor-version  0 1 2 3
> ;; emacs-version        "20.7.2" "21.2.1"
> 
> In a terminal, (null window-system)
> 

For if it's useful for you, I use clauses like these extensively in mi
.emacs:

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

Cordially, Ismael

Attachment: signature.asc
Description: Digital signature


reply via email to

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