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

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

Torturedly threaded .emacs portability. [Was: jump between if-fi]


From: Alan Mackenzie
Subject: Torturedly threaded .emacs portability. [Was: jump between if-fi]
Date: Tue, 1 Jan 2008 15:53:04 +0000
User-agent: Mutt/1.5.9i

Hi, Reader!

On Mon, Dec 31, 2007 at 08:29:28PM -0600, reader@newsguy.com wrote:

[ .... ]

> On a slightly different subject... if I may torture the threading
> rules a little:
>   Speaking of portability... I'd like to get my emacs init files to be
>   more portable from one machine to the next but one I'm dealing with
>   now has different keyboard responses than most of the others and
>   requires differnt keybindings for delete-backward-char and a few
>   other things.

Have a look at the "Key Bindings" in the Emacs FAQ.

There are several variables you can test to find out what system you're
running under: system-type, system-name, ....   Have a look at page
"System Interface" in the Elisp manual.

>   I'd like to include those in .emacs but don't know how to separate
>   them off by making them depend on which host emacs is running on.

>   Can you give me a push in that direction?

(if (eq system-type 'gnu/linux)
    (progn
      ....)
  (...)
  ....)

(if (eq window-system 'x) .....) ; See elisp manual page "Window Systems"

>   How to access the env variable HOSTNAME or slurp the results of the
>   hostname shell command and make the keybindings dependant on the
>   results. 

(getenv "HOSTNAME") ; See elisp manual page "System Environment"

>   I've seen examples of something similar where the code tests if its 
>   fsf emacs or Xemacs as a condition.

I think you mean "GNU Emacs".  ;-)  ["fsf emacs" is regarded as rude by
the Emacs project, for reasons I don't fully understand.]

(if (featurep 'xemacs) ....)

-- 
Alan Mackenzie (Nuremberg, Germany)




reply via email to

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