From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Torturedly threaded .emacs portability. [Was: jump between if-fi] Date: Tue, 1 Jan 2008 15:53:04 +0000 Message-ID: <20080101155304.GB3830@muc.de> References: <87y7bbpz12.fsf@newsguy.com> <20071231162438.GA1211@muc.de> <87wsqujn1z.fsf@newsguy.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1199202293 19423 80.91.229.12 (1 Jan 2008 15:44:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Jan 2008 15:44:53 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: reader@newsguy.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 01 16:45:05 2008 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 1J9jIf-0007SP-1t for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Jan 2008 16:45:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J9jII-0007cB-IX for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Jan 2008 10:44:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J9jHv-0007Zn-Db for help-gnu-emacs@gnu.org; Tue, 01 Jan 2008 10:44:19 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J9jHq-0007TW-KX for help-gnu-emacs@gnu.org; Tue, 01 Jan 2008 10:44:18 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J9jHq-0007TT-GQ for help-gnu-emacs@gnu.org; Tue, 01 Jan 2008 10:44:14 -0500 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J9jHq-0007lX-36 for help-gnu-emacs@gnu.org; Tue, 01 Jan 2008 10:44:14 -0500 Original-Received: (qmail 21744 invoked by uid 3782); 1 Jan 2008 15:44:12 -0000 Original-Received: from acm.muc.de (p57AF58EF.dip.t-dialin.net [87.175.88.239]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Tue, 01 Jan 2008 16:44:09 +0100 Original-Received: (qmail 5492 invoked by uid 1000); 1 Jan 2008 15:53:04 -0000 Content-Disposition: inline In-Reply-To: <87wsqujn1z.fsf@newsguy.com> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 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:50413 Archived-At: 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)