From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "B. T. Raven" Newsgroups: gmane.emacs.help Subject: Re: emacs-home variable for Windows Date: Thu, 15 Oct 2009 05:03:05 -0500 Message-ID: <74OdncDTSZP9bkvXnZ2dnUVZ_jednZ2d@sysmatrix.net> References: <4AD514B1.5080503@mousecar.com> <48393af3-3a36-4a5a-83ad-1ee69edb1803@z24g2000yqb.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1255603309 17972 80.91.229.12 (15 Oct 2009 10:41:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Oct 2009 10:41:49 +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:41:41 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 1MyNm7-0005gU-9j for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Oct 2009 12:41:39 +0200 Original-Received: from localhost ([127.0.0.1]:37655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MyNm5-0000nU-74 for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Oct 2009 06:41:37 -0400 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!news2.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.sysmatrix.net!news.sysmatrix.net.POSTED!not-for-mail Original-NNTP-Posting-Date: Thu, 15 Oct 2009 05:03:12 -0500 User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) Original-Newsgroups: gnu.emacs.help In-Reply-To: <48393af3-3a36-4a5a-83ad-1ee69edb1803@z24g2000yqb.googlegroups.com> X-No-Archive: yes Original-Lines: 78 X-Usenet-Provider: http://www.giganews.com Original-NNTP-Posting-Host: 12.73.132.2 Original-X-Trace: sv3-DbFhBkkzROMCLxpWm7+WahgvXRxUOVA/43NaRVV3+d5yGTtgUm0w57bybcm0dYBstmQIBfpk6FWCWUa!U4usGel5CnZ7GU3+xbtP8LLQjTyD81PvE3xeZTrCotj0bRWkGf3Vr6toqGIf82qpHxxQ4LpNSHKY!gfyc206g760OH8TL9jAmAyjJi/xT Original-X-Complaints-To: abuse@sysmatrix.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Original-Xref: news.stanford.edu gnu.emacs.help:173903 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 X-Gmane-Expiry: 2009-10-29 Xref: news.gmane.org gmane.emacs.help:68988 Archived-At: zugzwang wrote: > 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%:\ > Thanks "forced move." ;-) Newer batch commands allow: If exist e:\emacs set HOME e:\ but I want to set it to the drive letter of the last device plugged into a usb port.