From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Henri Fischer Newsgroups: gmane.emacs.help Subject: Re: emacs-home variable for Windows Date: Mon, 19 Oct 2009 04:58:04 -0700 (PDT) Organization: http://groups.google.com Message-ID: <0e9f5915-6de8-48a5-92ac-389d33036b00@j24g2000yqa.googlegroups.com> References: <4AD514B1.5080503@mousecar.com> <48393af3-3a36-4a5a-83ad-1ee69edb1803@z24g2000yqb.googlegroups.com> <74OdncDTSZP9bkvXnZ2dnUVZ_jednZ2d@sysmatrix.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1255956044 8822 80.91.229.12 (19 Oct 2009 12:40:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Oct 2009 12:40:44 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 19 14:40:34 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 1MzrXN-000640-A5 for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Oct 2009 14:40:33 +0200 Original-Received: from localhost ([127.0.0.1]:45074 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MzrXM-0001ig-Lp for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Oct 2009 08:40:32 -0400 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!j24g2000yqa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 106 Original-NNTP-Posting-Host: 83.119.131.144 Original-X-Trace: posting.google.com 1255953484 26976 127.0.0.1 (19 Oct 2009 11:58:04 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 19 Oct 2009 11:58:04 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: j24g2000yqa.googlegroups.com; posting-host=83.119.131.144; posting-account=X7JwogoAAACP8PFLkqCKx34awu1aNwR6 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.27 Safari/532.0, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:173999 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:69083 Archived-At: On Oct 15, 3:03=A0am, "B. T. Raven" wrote: > 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. =A0It's got emacs installed on it = and > >>>>>> there's a link on my desktop that I click (after inserting the sti= ck) > >>>>>> and emacs fires up. =A0It's nice. =A0I use it every day. =A0With t= he paucity > >>>>>> of decent editors fromWindows, I *need* it. > >>>>>> There's a couple minor hassles though that I'd like to dispense wi= th. > >>>>>> One is that I don't know a way to tell emacs what the HOME directo= ry is. > >>>>>> =A0In the past I've just gone into the registry and change somevar= iable > >>>>>> there. =A0I don't remember where that is or how to do it though. = =A0Besides, > >>>>>> I prefer to have thevariabledefined in my .emacs (which is at the > >>>>>> top-level directory on the USB stick). =A0(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. =A0But I don't know how tell emacs to m= ake 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 b= een > >>>> removed? > >>> No, at the moment it is only in Emacs+EmacsW32 and I have not had tim= e > >>> to setup a repository for that. > >>> However all that file does is to use the ideas from > >>> =A0http://at-aka.blogspot.com/2006/06/portable-emacs-22050-on-usb.htm= l > >>> 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 thevariable'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 =A0 =A0 =A0 =A0 =A0 =A0 4021232 =A0 1850100 =A0 2171132 =A0= 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. =A0Presumably, your emacs > > distribution contains a directory not found on any other drive (e.g. > > :\MyEmacsDir\). =A0Any unique path will do. =A0Simply hav= e > > 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. To make sure home is on my USB I have the following in site- lisp>subdirs.el: (if (and invocation-directory (eq (string-match "[a-zA-Z]:" invocation-directory) 0)) (let ((drive (substring invocation-directory 0 1))) (setenv "HOME" (concat drive ":/home")))) Henri