help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Disable certain commands in non window mode


From: Alex Bennee
Subject: Re: Disable certain commands in non window mode
Date: Thu, 25 Sep 2008 16:54:07 +0100

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.





reply via email to

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