From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ismael Valladolid Torres Newsgroups: gmane.emacs.help Subject: Re: How to detect if Emacs is running in a terminal Date: Sat, 16 Apr 2005 14:05:58 +0200 Message-ID: <20050416120558.GB4644@gmail.com> References: <8764yo9g12.fsf@thalassa.informatimago.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0936569684==" X-Trace: sea.gmane.org 1113653462 23124 80.91.229.2 (16 Apr 2005 12:11:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 16 Apr 2005 12:11:02 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 16 14:11:00 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DMm8B-00080E-SB for geh-help-gnu-emacs@m.gmane.org; Sat, 16 Apr 2005 14:10:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DMmBs-0000w4-Bn for geh-help-gnu-emacs@m.gmane.org; Sat, 16 Apr 2005 08:14:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DMm68-0005yT-5A for help-gnu-emacs@gnu.org; Sat, 16 Apr 2005 08:08:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DMm64-0005w4-UN for help-gnu-emacs@gnu.org; Sat, 16 Apr 2005 08:08:26 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DMm64-0005vh-4I for help-gnu-emacs@gnu.org; Sat, 16 Apr 2005 08:08:24 -0400 Original-Received: from [80.38.119.13] (helo=localhost.localdomain) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DMm4x-0005u7-Mt for help-gnu-emacs@gnu.org; Sat, 16 Apr 2005 08:07:16 -0400 Original-Received: from ismael by localhost.localdomain with local (Exim 4.50) id 1DMm3l-0001GN-AB for help-gnu-emacs@gnu.org; Sat, 16 Apr 2005 14:06:01 +0200 Original-To: help-gnu-emacs@gnu.org Mail-Followup-To: help-gnu-emacs@gnu.org In-Reply-To: <8764yo9g12.fsf@thalassa.informatimago.com> User-Agent: Mutt/1.5.8i X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor 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:25748 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:25748 --===============0936569684== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QKdGvSO+nmPlgiQ/" Content-Disposition: inline --QKdGvSO+nmPlgiQ/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Pascal Bourguignon escribe: > Denis Bueno writes: >=20 > > 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? > >=20 > > 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. > >=20 > > 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. > >=20 > > So, when I want to use Emacs in the terminal, I run: > >=20 > > emacs -nw -q -l ~/.emacs-terminal > >=20 > > Is there a better way? >=20 > (list system-type system-name window-system) >=20 > ;; 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" >=20 > In a terminal, (null window-system) >=20 For if it's useful for you, I use clauses like these extensively in mi =2Eemacs: (when (eq system-type 'gnu/linux) ...) (when (eq system-type 'windows-nt) ...) (when window-system ...) Cordially, Ismael --QKdGvSO+nmPlgiQ/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCYP+mQFdFxx5Rt40RAhhoAKCMopB3wx/RHatEXrFphMm4A+wz2QCfUWnt 7im9+5V5Wr6ao8f7EqZpTYg= =hKiV -----END PGP SIGNATURE----- --QKdGvSO+nmPlgiQ/-- --===============0936569684== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs --===============0936569684==--