From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Pascal Bourguignon Newsgroups: gmane.emacs.help Subject: Re: How to detect if Emacs is running in a terminal Date: 15 Apr 2005 18:11:05 +0200 Organization: [posted via Easynet Spain] Message-ID: <8764yo9g12.fsf@thalassa.informatimago.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1113581565 21671 80.91.229.2 (15 Apr 2005 16:12:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Apr 2005 16:12:45 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 15 18:12:40 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DMTPy-0003GY-VW for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Apr 2005 18:11:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DMTTV-000445-Dj for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Apr 2005 12:15:21 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news2.google.com!newsread.com!newsprint.newsread.com!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!news.glorb.com!easynet-monga!easynet.net!easynet-post1!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-Lines: 39 Original-NNTP-Posting-Host: 62.93.174.79 Original-X-Trace: DXC=?5K List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:25727 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:25727 Denis Bueno 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