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: Pascal Bourguignon
Subject: Re: How to detect if Emacs is running in a terminal
Date: 15 Apr 2005 18:11:05 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

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)

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

There is no worse tyranny than to force a man to pay for what he does not
want merely because you think it would be good for him. -- Robert Heinlein


reply via email to

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