From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Suvayu Ali Newsgroups: gmane.emacs.help Subject: Re: Machine-dependent elisp Date: Wed, 21 Apr 2010 14:41:54 -0700 Message-ID: <4BCF7122.20009@gmail.com> References: <84mxww8rff.fsf@csr.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1271886167 18479 80.91.229.12 (21 Apr 2010 21:42:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 21 Apr 2010 21:42:47 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 21 23:42:46 2010 connect(): No such file or directory 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.69) (envelope-from ) id 1O4hgz-0004rY-58 for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Apr 2010 23:42:45 +0200 Original-Received: from localhost ([127.0.0.1]:58666 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4hgy-0002RW-L6 for geh-help-gnu-emacs@m.gmane.org; Wed, 21 Apr 2010 17:42:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O4hfo-0002E6-QA for help-gnu-emacs@gnu.org; Wed, 21 Apr 2010 17:41:32 -0400 Original-Received: from [140.186.70.92] (port=47593 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4hfm-0002Ck-Hj for help-gnu-emacs@gnu.org; Wed, 21 Apr 2010 17:41:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O4hfk-0002xP-UH for help-gnu-emacs@gnu.org; Wed, 21 Apr 2010 17:41:30 -0400 Original-Received: from mail-pz0-f188.google.com ([209.85.222.188]:45935) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O4hfk-0002xE-38 for help-gnu-emacs@gnu.org; Wed, 21 Apr 2010 17:41:28 -0400 Original-Received: by pzk26 with SMTP id 26so5495672pzk.6 for ; Wed, 21 Apr 2010 14:41:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=50A5QA07QKhXjqq4Ok4jeVvrjJ7xA6WXkpWy/AVRbsk=; b=IYCrqE3tuMtmNr1g7WLxcP7X6OtcWtxACUQ/sVbTTVS7AgjJaA1AqAVDfN1vqj4a06 CClf56+nDogZCiLNP0a6AYpMWnEpMcBg3o7l/4yrRnsNGUiXIeNv7/si8aO+DBhqDogz tLC3PWxJag+TiA/j4iEw8g7xYZFEZw9NRonXY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; b=XKzB5zamjaX6HTjpzUlfccNaw7+YsorUiBIUy4J5HwCuAZ9yo7ENkjVeDXZEsJfNYb /r4LYxLnh0Ed5/LBroEv647KWaZ8TftcqdZYkG0Z3jsUuSOD86Ww1eOkbN3ryMbZaVBe 5ja1wwB6t5wmGc1ReglvXWfmoqU9NubBSLScE= Original-Received: by 10.115.99.2 with SMTP id b2mr8112201wam.131.1271886086603; Wed, 21 Apr 2010 14:41:26 -0700 (PDT) Original-Received: from [142.58.122.14] (p8460-6.phys.sfu.ca [142.58.122.14]) by mx.google.com with ESMTPS id c22sm493237wam.18.2010.04.21.14.41.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 21 Apr 2010 14:41:25 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 In-Reply-To: <84mxww8rff.fsf@csr.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:72785 Archived-At: On Wednesday 21 April 2010 01:46 PM, pocmatos@gmail.com wrote: > Hi all, > > I have some code which I would like to make dependent on the machine I > am currently working on. I have a single .emacs shared between my work > machine and my home machine. I thought about making dependent on the ip > address (or hostname) but then I need a way to get the ip address (or > hostname) of my current machine. > > Any suggestions on the best way to do this? > I use something very crude, but it works. If the usernames are different on the two hosts, then you could try enclosing the host dependent lines with something like this, > (if (string= (getenv "USER") "username") > ;; do stuff > ) > -- > PMatos > -- Suvayu Open source is the future. It sets us free.