From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bernardo Newsgroups: gmane.emacs.help Subject: Re: emacs-home variable for Windows Date: Thu, 15 Oct 2009 20:49:57 +1100 Message-ID: <4AD6F045.8050709@pobox.com> References: <4AD514B1.5080503@mousecar.com> <48393af3-3a36-4a5a-83ad-1ee69edb1803@z24g2000yqb.googlegroups.com> Reply-To: bernardo.bacic@pobox.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1255601119 11328 80.91.229.12 (15 Oct 2009 10:05:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Oct 2009 10:05:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 15 12:05:11 2009 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 1MyNCm-0002f4-Ns for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Oct 2009 12:05:09 +0200 Original-Received: from localhost ([127.0.0.1]:44525 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MyNCm-0001hU-7S for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Oct 2009 06:05:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MyMzH-0000gc-Fy for help-gnu-emacs@gnu.org; Thu, 15 Oct 2009 05:51:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MyMzB-0000aK-4w for help-gnu-emacs@gnu.org; Thu, 15 Oct 2009 05:51:10 -0400 Original-Received: from [199.232.76.173] (port=57054 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MyMzA-0000Zx-SN for help-gnu-emacs@gnu.org; Thu, 15 Oct 2009 05:51:04 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:52096 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MyMzA-00067z-FP for help-gnu-emacs@gnu.org; Thu, 15 Oct 2009 05:51:04 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id AE5D35906F for ; Thu, 15 Oct 2009 05:51:03 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=message-id :date:from:reply-to:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; s=sasl; bh= H0OkskrxOfVq0YY6iTzyjSo5QOM=; b=NVa2PEF9H8H/UjRydVQSevHbW4AxvRZe shiy9Y/fdu8KU+YsCtb7hlshhQyk0SLDPqom0o6XDTEPHCVTPqjWBDcNitJqKq0K r0yZ0wWVzVrzQVd6gNsfSUK8TbGEoYjlXYDjdgySQ91zm3XGHt3G/l2PvAmdoQnW PWZPW7ShRIM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=message-id:date :from:reply-to:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; q=dns; s=sasl; b=XFU2NO O5P7Ff/gPWtAs5AZ4XYwZfRVq/W0hljsXIrJrocqcKhG9+BluD0lwvOg2utlF9Jc fqTLy94NFhHgR/tDESNFDyFSEqImxvTxtE/UZac4WU6IRuqT8UOK6MhF6fxp6w8y mPqkUd2EAlg71DPoQ9d7x+s3JeqScb8qkR6+4= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id AAF3C5906E for ; Thu, 15 Oct 2009 05:51:03 -0400 (EDT) Original-Received: from [192.168.1.10] (unknown [115.70.111.33]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id AF1C95906D for ; Thu, 15 Oct 2009 05:51:02 -0400 (EDT) User-Agent: Thunderbird 2.0.0.23 (X11/20090812) In-Reply-To: <48393af3-3a36-4a5a-83ad-1ee69edb1803@z24g2000yqb.googlegroups.com> X-Pobox-Relay-ID: 4076CC4A-B970-11DE-87BD-1B12EE7EF46B-14340206!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) 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:68986 Archived-At: zugzwang said the following on 10/15/09 12:15: > On Oct 14, 4:49 pm, "B. T. Raven" wrote: >> Lennart Borgman wrote: >>> On Wed, Oct 14, 2009 at 6:50 AM, B. T. Raven wrote: >>>> Lennart Borgman wrote: >>>>> On Wed, Oct 14, 2009 at 2:00 AM, ken wrote: >>>>>> I carry a USB stick to the job. It's got emacs installed on it and >>>>>> there's a link on my desktop that I click (after inserting the stick) >>>>>> and emacs fires up. It's nice. I use it every day. With the paucity >>>>>> of decent editors from Windows, I *need* it. >>>>>> There's a couple minor hassles though that I'd like to dispense with. >>>>>> One is that I don't know a way to tell emacs what the HOME directory is. >>>>>> In the past I've just gone into the registry and change some variable >>>>>> there. I don't remember where that is or how to do it though. Besides, >>>>>> I prefer to have the variable defined in my .emacs (which is at the >>>>>> top-level directory on the USB stick). (After emacs loads, I do "M-x >>>>>> loadfile RETURN e:/.emacs" and that little task loads up the rest of the >>>>>> stuff emacs needs to know. But I don't know how tell emacs to make e:/ >>>>>> the home directory. >>>>> There is a library usb-setup.el in Emacs+EmacsW32 for this. >>>> Can this .el file be downloaded separately from EmacsW32 to use with the >>>> standard Emacs w32 build? Is it somewhere in nXhtml 1.97 or has it been >>>> removed? >>> No, at the moment it is only in Emacs+EmacsW32 and I have not had time >>> to setup a repository for that. >>> However all that file does is to use the ideas from >>> http://at-aka.blogspot.com/2006/06/portable-emacs-22050-on-usb.html >>> and reorganises them a bit. So just look there instead. >> Thanks, Lennart. I almost understand the stuff at that link but I can't >> see how the variable 'data-directory refers to the right drive letter >> until after Emacs is launched from the flash drive. The drive letter >> could be G:\ when plugged in today and H:\ tomorrow. >> >> With GnuW32 utils I got as far as producing: >> >> df -a | tail -1 > usbemacs.bat >> >> with the result: >> >> STORE N GO 4021232 1850100 2171132 47% G:\ >> >> I am at a loss as to where I should go from here. >> >> Thanks again, >> >> Ed > > I've never used emacs, and my Dos batch-writing skills are rusty, so > all I can offer is a conceptual solution. Presumably, your emacs > distribution contains a directory not found on any other drive (e.g. > :\MyEmacsDir\). Any unique path will do. Simply have > the desk icon start a batch file that begins as follows: > > dir C:\MyEmacsDir\ > If error: directory not exist, continue : else set variable_1 to 'C' > and then goto Label_1: > > dir D:\MyEmacsDir\ > If error: directory not exist, continue : else set variable_1 to 'D' > and then goto Label_1: > > dir E:\MyEmacsDir\ > If error: directory not exist, continue : else set variable_1 to 'E' > and then goto Label_1: > > ... > > Label_1: > set to %variable_1% > execute %variable_1%:\ > > it is simpler if you start with Andreas' batch file, copy it to the USB drive and modify the first line from: set HOME=e: to set HOME=%CD% double clicking on this batch file should work regardless of the drive name letter