unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Mike Mattie <codermattie@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Torturedly threaded .emacs portability.  [Was: jump between if-fi]
Date: Tue, 1 Jan 2008 21:00:00 -0800	[thread overview]
Message-ID: <20080101210000.729c2737@reforged> (raw)
In-Reply-To: <20080101155304.GB3830@muc.de>


[-- Attachment #1.1: Type: text/plain, Size: 2060 bytes --]

On Tue, 1 Jan 2008 15:53:04 +0000
Alan Mackenzie <acm@muc.de> wrote:

> 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
>       ....)
>   (...)
>   ....)

(cond
  ;; linux
  ((string-equal "gnu/linux" system-type)
    (load-file "/usr/share/emacs/site-lisp/site-gentoo.el"))

  ;; darwin
  ((string-equal "darwin" system-type)
    (load-file (concat my-emacs-dir "darwin.el")))
  )

the cond form is a bit easier to extend as the platform list grows.

> (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) ....)
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

  parent reply	other threads:[~2008-01-02  5:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-30 23:02 jump between if-fi reader
2007-12-30 23:23 ` Lennart Borgman (gmail)
2007-12-31  6:29   ` reader
2007-12-31  8:12     ` Thierry Volpiatto
2007-12-31 14:41       ` reader
2008-01-01 15:47   ` reader
     [not found]   ` <mailman.5533.1199082573.18990.help-gnu-emacs@gnu.org>
2008-01-09  5:40     ` Stefan Monnier
2007-12-31 16:24 ` Alan Mackenzie
2008-01-01  2:29   ` reader
2008-01-01 14:18     ` Alan Mackenzie
2008-01-01 15:39       ` reader
2008-01-01 15:53     ` Torturedly threaded .emacs portability. [Was: jump between if-fi] Alan Mackenzie
2008-01-01 15:53       ` reader
2008-01-02  5:00       ` Mike Mattie [this message]
2008-01-05 18:33     ` jump between if-fi reader
2008-01-09  9:43 ` Arnaldo Mandel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080101210000.729c2737@reforged \
    --to=codermattie@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).