From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex Bennee Newsgroups: gmane.emacs.help Subject: Re: Disable certain commands in non window mode Date: Thu, 25 Sep 2008 16:54:07 +0100 Message-ID: <1222358048.9439.45.camel@pitcairn.cambridgebroadband.com> References: <16c4e049-5c92-42f2-bfa9-a731c6d0bd03@k37g2000hsf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1222357870 25978 80.91.229.12 (25 Sep 2008 15:51:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Sep 2008 15:51:10 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: MiH Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 25 17:52:08 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kit8I-0006J2-W9 for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Sep 2008 17:51:59 +0200 Original-Received: from localhost ([127.0.0.1]:40560 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kit7G-0001ho-UZ for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Sep 2008 11:50:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kit6o-0001cG-QA for help-gnu-emacs@gnu.org; Thu, 25 Sep 2008 11:50:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kit6k-0001al-Vr for help-gnu-emacs@gnu.org; Thu, 25 Sep 2008 11:50:26 -0400 Original-Received: from [199.232.76.173] (port=49009 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kit6k-0001ab-PJ for help-gnu-emacs@gnu.org; Thu, 25 Sep 2008 11:50:22 -0400 Original-Received: from mailhost.cambridgebroadband.com ([212.44.17.77]:56741 helo=cambridgebroadband.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kit6i-0003Do-AI for help-gnu-emacs@gnu.org; Thu, 25 Sep 2008 11:50:21 -0400 Original-Received: from exchange.cbl.local (exchange.cambridgebroadband.com [212.44.17.76]) by cambridgebroadband.com (8.14.1/8.14.1) with ESMTP id m8PFo5Ok003851; Thu, 25 Sep 2008 16:50:06 +0100 Original-Received: from [10.0.0.166] ([10.0.0.166]) by exchange.cbl.local with Microsoft SMTPSVC(6.0.3790.3959); Thu, 25 Sep 2008 16:49:27 +0100 In-Reply-To: <16c4e049-5c92-42f2-bfa9-a731c6d0bd03@k37g2000hsf.googlegroups.com> X-Mailer: Evolution 2.22.3.1 X-OriginalArrivalTime: 25 Sep 2008 15:49:27.0234 (UTC) FILETIME=[4A49D220:01C91F26] X-Scanned-By: MIMEDefang 2.62 on 212.44.17.77 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:58078 Archived-At: On Thu, 2008-09-25 at 02:27 -0700, MiH wrote: > These are certain statements in my .emacs file. > > (add-to-list 'load-path "~/.emacs.d") > (global-font-lock-mode t) > (set-scroll-bar-mode 'right) > (require 'color-theme) > (color-theme-initialize) > (color-theme-whateveryouwant) > (mwheel-install) > > ;; rest of the .emacs file > > The thing is I want to disable loading of the above statements while > in non-window (emacs -nw) mode, but want them while using X11. Since I > am new to elisp, I am not yet quite sure how to do this. You can directly wrap them as others have noted. However as my .emacs is quite big I tend to define a number variables which I can test later. For example: (defvar I-am-in-X (eval 'window-system)); (defvar I-am-in-console (not (eval 'window-system))) (defvar I-am-on-MacOSX (string-match "Carbon" (emacs-version))) (defvar I-am-remote (getenv "SSH_TTY")) And then later I have code like: (if I-am-in-console (progn (color-theme-initialize) (color-theme-euphoria))) > > Thanks in advance to anyone providing a solution -- Alex Bennee, Software Engineer The best defense against logic is ignorance.