emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Orgmode] run emacs.exe -> point to specific .emacs


From: Chris Randle
Subject: RE: [Orgmode] run emacs.exe -> point to specific .emacs
Date: Mon, 7 Sep 2009 23:40:10 +0100

Hi Erwin

Erwin Panen wrote:
> - Is there any command line parameter to point emacs to a specific
>     /dir/subdir/.emacs_2 file? This would allow me to experiment with
> various subsets of .emacs settings? 

Don't know if this helps at all, but I do the same thing myself. I have
a copy of Emacs on a USB stick, and my Org-mode files on a TrueCrypt
volume on the same stick. I synchronize the org files with my desktop
using Subversion and Tortoise SVN. Works a treat.

On the USB stick, I have a batch file called notepad.bat containing the
following. The equals signs just delineate the start and end of the
file, they're not part of the file:

==================
@echo off
set OLD-HOME=%HOME%
set HOME=%cd%

set /p DRIVE_LETTER=Enter drive letter of SD card: 
%DRIVE_LETTER%:\_Usb\Emacs\bin\runemacs.exe notepad.org

set HOME=%OLD-HOME%
set OLD-HOME=
set DRIVE_LETTER=
====================

Also on the stick, I have a shortcut to the batch file with

Target: N:\emacs-data\Notepad.bat
Start in: N:\emacs-data

Windows seems to be smart (unusual, I know) in that it has no problem
with the hard coded drive letter in the shortcut. If drive changes
letter on mounting, it copes. But you must create the shortcut with the
correct drive letter at that moment.

The Start in value designates the current directory which the batch file
picks up in the %cd% environment variable and sets HOME to it, so that
Emacs knows where to get the .emacs file. Perhaps you could make
different shortcuts with different Start in values pointing to folders
containing different .emacs files.

The complication with %DRIVE_LETTER% is because the USB stick and Emacs
itself get mounted with one drive letter and then my org files and
.emacs are mounted on the encrypted volume with another drive letter,
and the batch file encrypted volume has no way of knowing the drive
letter of the USB stick to start Emacs. If you're keeping everything on
the one drive letter, you won't need that bit.

-- 
Chris Randle
Windows XP Pro SP3 - GNU Emacs 22.1.1 - Org-mode 6.29c





reply via email to

[Prev in Thread] Current Thread [Next in Thread]