unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: zugzwang <buyoninternt@bluebottle.com>
To: help-gnu-emacs@gnu.org
Subject: Re: emacs-home variable for Windows
Date: Wed, 14 Oct 2009 18:15:45 -0700 (PDT)	[thread overview]
Message-ID: <48393af3-3a36-4a5a-83ad-1ee69edb1803@z24g2000yqb.googlegroups.com> (raw)
In-Reply-To: S5CdneI7_so6_kvXnZ2dnUVZ_uli4p2d@sysmatrix.net

On Oct 14, 4:49 pm, "B. T. Raven" <ni...@nihilo.net> wrote:
> Lennart Borgman wrote:
> > On Wed, Oct 14, 2009 at 6:50 AM, B. T. Raven <ni...@nihilo.net> wrote:
> >> Lennart Borgman wrote:
> >>> On Wed, Oct 14, 2009 at 2:00 AM, ken <geb...@mousecar.com> 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.
<drive_letter>:\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 <Emacs_Home> to %variable_1%<desired_path>
execute %variable_1%:\<desired path_name + executable file_name>



  reply	other threads:[~2009-10-15  1:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-14  0:00 emacs-home variable for Windows ken
2009-10-14  0:04 ` Lennart Borgman
2009-10-14  0:05 ` Andreas Politz
2009-10-14  7:45   ` ken
     [not found] ` <mailman.8717.1255478707.2239.help-gnu-emacs@gnu.org>
2009-10-14  4:50   ` B. T. Raven
2009-10-14 16:31     ` Lennart Borgman
     [not found]     ` <mailman.8799.1255537948.2239.help-gnu-emacs@gnu.org>
2009-10-14 23:49       ` B. T. Raven
2009-10-15  1:15         ` zugzwang [this message]
2009-10-15  9:49           ` Bernardo
2009-10-15 10:03           ` B. T. Raven
2009-10-19 11:58             ` Henri Fischer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48393af3-3a36-4a5a-83ad-1ee69edb1803@z24g2000yqb.googlegroups.com \
    --to=buyoninternt@bluebottle.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).