How can I have a portable Emacs?
Asked Answered
W

5

28

Is there a way run Emacs from a USB drive? I am a Windows user and I would like to be able use it on any PC without an Emacs install.

Whitneywhitson answered 8/12, 2008 at 18:14 Comment(2)
I would start by reading this.Directorial
The question would fit nicely for emacs.stackexchange.com I guess ;-)Memorable
S
30

Yes, the "normal" Emacs distribution for Windows is precompiled and just runs without having to do any install. Just get one of the *.zip files from the usual place, unpack it onto a USB disk, and you can use it directly. (The actual binary is inside the "bin/" directory.)

The only thing you may want to do is set it up to look for ".emacs" always on the USB disk instead of on your hard drive; see

 (info "(emacs) Windows HOME")

on how to do that.

Socialist answered 8/12, 2008 at 18:21 Comment(5)
-1: You don't address how to deal with changing drive letters.Laise
@SamB: It is covered under "the only thing you may want to do" (where the "may" indicates it's also something one may not really care about), but feel free to add that information in an answer.Socialist
I guess I meant you should have mentioned %~d0 and/or %~dp0, which expand to the drive and directory which the containing batch file is on/in, respectively, as documented on MS's website (and partly in the output of help call under cmd.exe) and more explicitly at ss64.com/nt/syntax-args.html.Laise
(info "(emacs) Windows HOME") did not help me too much (gnu.org/software/emacs/manual/html_node/emacs/Windows-HOME.html). Do you have more info about how to tell emacs to start with a specified .emacs file? This did not help either: gnu.org/software/emacs/manual/html_node/emacs/… . I understand you can write a batch and change HOME before running. What if I don't want to change HOME?Unexacting
Actually couldn't find the answer in the emacs docs but there is a guide here which helps emacs on USB guideCommunize
D
8

You can read Emacs-related pages at PortableApps.com, and if they have not yet ported Emacs to their set of portable applications, then please ask them kindly to add Emacs to the list of text editors. With enough requests they will do this eventually.

Dietrich answered 8/12, 2008 at 22:21 Comment(0)
N
3

There is a beta version of a Portable Apps version of emacs 23.2 here. Initial test works fine here.

Nochur answered 16/6, 2010 at 14:32 Comment(0)
C
2

Create a directory in the root of your USB drive called home.

Create site-start.el in the site-lisp folder and then copy this and you are all set to go.

(defvar %~dp0 (substring data-directory 0 3))
(defvar usb-home-dir (concat %~dp0 "home/"))
(setenv "HOME" usb-home-dir)
Communize answered 14/7, 2011 at 11:59 Comment(1)
Two questions: 1) Can you comment (in the elisp source) about %~dp0? 2) is usb-home-dir necessary as temporary variable? Or is all you really need setting HOME? If so, it could be a single elisp expression, I guess.Memorable
T
1

I have ported emacs to portable apps format.

http://esnm.sourceforge.net/download.html

Teleutospore answered 20/1, 2010 at 16:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.