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

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

One .emacs for three operating system


From: Eric Lilja
Subject: One .emacs for three operating system
Date: Tue, 14 Aug 2007 23:45:52 +0200
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)

Hello, I run emacs under windows xp, fedora 7 and solaris (unknown version). I want to use the same .emacs for all three operating systems. On Windows and fedora I have 22.1 or later, on Solaris I have 21.4 because the admins don't like to upgrade software at all, it seems.

Anyway, I have a few things I need to do differently on Solaris so I've been trying to determine if I'm running Solaris by checking the value of $HOME (crude, I know, I'd like to hear of a better way). Since I don't know lisp this is not trivial for me.

First I did (in scratch):

(getenv "HOME")C-j
Prints expected string.

Then I tried to do a comparison

(if (eq (getenv "HOME") "/home/on/solaris")
   (message "Duh")
)C-j

but I get the output Nil from that.

So I thought that maybe it doens't like the nested getenv call for some reason, so I tried.
(setq u (getenv "HOME"))C-j
Ok, prints expected result.
But then I noticed something that's odd to me who doesn't know lisp, if I do
(print u)C-j
it prints the home directory twice...so I started to wondering if u contains the string once or twice... When I tried use the variable u in the if statement instead of the nested getenv call the result was Nil once again.

anyway, as you can see I'm really confused, I just want to add some if/else-statements to my emacs.

if running-under-solaris is true
   do this
else ; assume we are running under winxp or fedora7
   do that

- Eric





reply via email to

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