< ==== Selecting the Home directory with !EmacsOptions.exe ====
> ==== Selecting the Home directory with EmacsOptions.exe ====
< == Running !EmacsPortable.App ==
> == Running EmacsPortable.App ==
< == How !EmacsPortable.App Works ==
> == How EmacsPortable.App Works ==
< === TODO Add !NotifyPlugin to the downloads. ===
> === TODO Add NotifyPlugin to the downloads. ===
EmacsPortable.App attempts to make a portable version of Emacs that runs off a USB drive under either Windows, or Mac OSX.
To install before a release, please follow [[*Using%20EmacsPortable.App%20before%20a%20release][the directions for using EmacsPortable.App before a release]].
The HOME Directory is where Emacs stores the .emacs file; Other emacs programs also store information here. EmacsPortable.App has a few options for home directories
If the DatainiEmacsPortableApp.ini file contains an ini Home Entry
The USB directory is changed for what EmacsPortableApp deems is the usb directory. This setting uses the PortableApps Documents Directory as the home-directory. This is slightly different depending on the platform.
The advantage of this methodology is that under windows, Emacs can be copied to the hard-drive to speed up the run-time, and the initialization from the hard drive
If the DatainiEmacsPortableApp.ini file contains an ini Home Entry
The EXEDIR directory is changed for the base directory that EmacsPortable.App is run from.
The advantage to this methodology is that you can drag and drop Emacs and all your customizations will be dragged with it.
If the DatainiEmacsPortableApp.ini file contains a full path, then the home is set when that file exists. For example:
will set the home directory to c:\ on Windows computers. Currently, this is supported only on windows.
If the DatainiEmacsPortableApp.ini file contains an ini Home Entry that doesn’t start with either EXEDIR:/ or USB:/, and doesn’t exist then the original home directory is maintained.
[EmacsPortableApp] Home=Set as original
When using EmacsOptions.exe, you do not have to worry about selecting which type of file is used. If you select a directory on the USB drive, the EmacsPortableApp is updated accordingly. If you select location within the portable app directory, the EXEDIR is replaced. Note that any where else may change depending on the computer you use.
Emacs has a list of aliases that are convinces, but do not correspond with an actual directory.
|Alias||True Directory||Directory Purpose|
|tmp||Temporary Directory||Temporary Directory.|
|~ahk/||Other/source/ahk||AHK Sources Directory|
|~app/||App/||EmacsPortable.App Application Files|
|~doc/||USB Drive:/Documents||Documents Directory|
|~el-get||Data/lisp/el-get||El Git package Repository|
|~elpa/||Data/lisp/elpa||Elpa Package Repository|
|~h/||System Home Directory||System Home Directory|
|~ini/||Data/ini||EmacsPortable.App ini files|
|~nsi/||Other/source/nsi||NSIS Sources Directory|
|~pa/||USB Drive:/PortableApps||Portable Apps|
|~rcp/||Data/lisp/kicker/rcp||extra el-get recipies Directory|
|~site-lisp/||App/site-lisp||Site Lisp Directory|
|~src/||Data/src||EmacsPortable.App lisp source files|
|~themes/||Data/themes||Emacs 24 Theme Directory|
|~usb/||USB Drive||USB Drive|
Other aliases are added ~el-get/package/elpa is changed to ~elpa, as if it were a symbolic link. Since symbolic links are not supported in windows, this is handled by emacs only.
Will install specific fonts, if needed.
Under windows, debug mode starts gdb if found. Additionally, if App/gdbinit is found, gdb sources this before running emacs. You can download an appropriate gdbinit for emacs here.
The settings in EmacsPortable.app were originally fork of the literate starter kit by Eric Schulte (some of my documentation text is probably reminiscent of . Now my philosophy is a little more liberal in providing a customized emacs that does not include too much startup customizations, but allow you to pull your own startup customizations if you wish, or test out other people’s startup settings.
The defaults built into the EmacsPortable.App are only the beginning of most users customization of Emacs to suite their needs. EmacsPortable.App provides provides a number of places for additional user and system specific customization. These are designed in such a way that it will be easy for you to continue tracking your own personal customization inside EmacsPortable.App while retaining your ability to pull down general updates to EmacsPortable.App without conflict.
The EmacsOptions.exe allows you to set Emacs startup options via a GUI. This is mirrored in the DatainiEmacsPortable.ini file.
This selects the version of Emacs that EmacsPortable.App will be running. This is useful if you run different versions of Emacs to possibly test lisp code, or use features not previously used.
This registers Org-protocol and also associates org-protocol actions with adobe acrobat/adobe acrobat reader.
This allows the initial font/color and gemoetry options to be specified so that emacs will startup with these options enabled. These are called from the command line and do not affect the registry.
This allows proxy settings to be dynamically determined based on your location. Your password is encrypted based on the location as well. This works on windows only.
By creating or editing an environment ini file at Data/ini/Environment.ini, startup environmental variables may be set. For example, if you use the colemak keyboard with the ergoemacs package, the following ini-file will set the ERGOEMACS_KEYBOARD_LAYOUT to the proper value
Emacs binaries can be zipped to save space. This requires that the emacs binaries are extracted to the temporary directory before running. I have found that running emacs in this manner is faster than running it on the USB stick alone. If not selected the binaries will run from the usb drive. If you are running EmacsPortable.App locally
EmacsPortable.App will add LiberKey File associations when it locates LiberKey, and the LiberKey support is checked. Note that you should restart LiberKey and make sure that the associations actually installed correctly.
EmacsPortable.App handles file associations in the following ways:
If your configuration starts to feel cramped in a single file (although with the nested headlines of an Org-mode file, that could take a while) and you want to stretch your config’s legs, you can also create a directory named after your system user name, like Data/init/user/$USER. If a such a directory exists, it will be added to the load-path, and any elisp or org-mode w/embedded elisp files in it will be loaded.
In windows, the hostname is found by right-clicking on my-computer and clicking on Properties. After that, click on the Computer Name tab. This should have two properties:
When the domain is removed from the Full computer name, the hostname is found. In this case, the host-name is bob.
If a specific setup for a host gets too cramped, you can also create a directory named after your system user name, like Data/init/user/$USER. If a such a directory exists, it will be added to the load-path, and any elisp or org-mode w/embedded elisp files in it will be loaded.
Note that el-get allows you to be more up-to-date since it usually syncs with the software developer’s repository. This is good and bad, so beware the bleeding edge. As a consequence, this requires command line versions of git and other package managers to be available to el-get.
Load Path for source directory is in Data/src.
When using EmacsPortable.App’s startup mechanism, t
The Pseudo-Daemon Start-up script among other things:
This allows you to “close” out of Emacs while maintaining a running Emacs.
The startup script also sets the environment variable EMACS_SERVER_FILE to the temporary directory
Subsequent calls to emacsclient.exe specify this server location. Therefore an emacs server can be run for each distinct emacs version
More information about the startup is found in site-start.org
EmacsPortable.App will setup the HTTPS_PROXY, HTTP_PROXY and FTP_PROXY based on the connection specific setup. To use a proxy, set it up with EmacsOptions.exe.
This is sufficient for some packages, but not for gnus.
The information is stored by the blowfish encryption algorithm. However the HTTP_PROXY environment variable will contain the password in clear text.
Under windows the fonts in the Appfonts directory are temporarily installed by opening them using fontview (if they are not already installed on the base system). This is done by a autohotkey script. Once Emacs Exits, the fonts are “uninstalled” by closing the fontview window. Currently this is done by showing the window and then closing it.
The dos version starts up emacs in a dos command prompt window. When trying to do anything with the EmacsPortableDOS command, it will attempt to do that command in the initial DOS box. This is just a test environment, and is likely not very reasonable to use.
Most of the specific applications work by adding paths and changing environmental variables. This is controlled by App/ini/paths.ini. EmacsPortableApp looks at the following sections
Local paths are paths that emacs checks that are locally available. They are specified by NAME=Local Path Snippet. An example of this is:
[local] git=msysgit\msysgit\bin git2=msysgit\bin gitmsys=msysgit\msysgit\mingw\bin gitmsys2=msysgit\mingw\bin
In this example git The following paths are checked:
If they exist they are added to the path environment before starting emacs. If the directory in fact exists, then two additional ini sections are checked, [local.git.path] and [local.git.set].
For the git local setup, there are two sections. The first local.git.path is specified as follows:
Then each key is added to the environment putting the root location before the right handed value. In this case, the environmental variable is set to c:\msysgit\msysgit or %ProgramFiles%\msysgit\msysgit depending on which path was found.
The other type of section that is used is the [local.git.set]. In the case of git this section is defined as:
Therefore, if git is found then the environmental variable PLINK_PROTOCOL is set to ssh.
The portable paths are set in the same way as the local paths with the exception of the places they check for the existence of paths. The portable section checks for paths in USB:\, and USB:\PortableApps\.
The exedir section checks for paths relative to the portable application.
Emacs uses Info for most everything. You can add info paths that Emacs doesn’t know about by a similar manner as the general paths, above.
By installing Python Portable into your PortableApps Directory, python is available to Emacs. This is useful for installing Bazaar, which Emacs uses as its version control.
I have created a portable Bazaar. There are some reports of troubling errors.
Not quite portable, but you can get the binaries here.
Running in subversion from within EmacsPortable.App is portable, though. Emacs will set the %AppData% Environment variable to Data/AppData and set %ALLUSERSPROFILE% to Data/AppData
EmacsPortableApp looks for the gpg package that is installed with Mozilla Thunderbird. First install Thunderbird Portable:
Then install gpg from here
If you extract MikTeX portable to PortableApps/MikTexPortable/, EmacsPortable.App will be recognized and used.
Supports MSYS portable.
Since magit and OpenSSH does not work correctly in windows, you can use PuTTY to connect to your host via plink. Note that you must connect to the host first via PuTTY or you will get one of the following error messages:
The server's host key is not cached in the registry. You have no guarantee that the server is the computer you think it is. The server's rsa2 key fingerprint is: ssh-rsa 2048 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 Connection abandoned. fatal: The remote end hung up unexpectedly
WARNING - POTENTIAL SECURITY BREACH! The server's host key does not match the one PuTTY has cached in the registry. This means that either the server administrator has changed the host key, or you have actually connected to another computer pretending to be the server. The new rsa2 key fingerprint is: ssh-rsa 2048 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 Connection abandoned. fatal: The remote end hung up unexpectedly
The information about setting up GIT to use putty are located here.
This is done automatically when running TRAMP.
Therefore, if you want to use magit for github, you need open puttyportable and attempt to open email@example.com so it can cache the host id.
From Jeremy Engilsh there is a tutorial on how to get TRAMP to work with windows 2K. This is adapted from that tutorial.
EmacsPortable.App will download and setup the appropriate files for PuTTY portable, if you need them. In addition to putty.exe, you will need:
Use Puttygen to generate a key. Puttygen should be in the PuttyPortable application.
This is under File->Save Private Key
This is under Conversions->Export OpenSSH Key
This can be done with a secure file transfer like FileZilla.
Or, if ssh is working for you, you can use the following shell command
scp key user@host:~/
ssh example.server.com mkdir ~./ssh chmod 700 ~/.ssh cat ~/key >> ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys rm ~/key
Use EmacsOptions.exe to select the PuTTy key. If you want it to be portable keep the key on the USB drive OR in the executable directory.
EmacsPortable.App will start pageant.exe if it is not already running and set up tramp to use plink. This is done by the site-start.
To use the settings of PuTTYPortable, you have to have a PuTTYPortable session open.
PuTTY currently stores proxy settings in the registry. If EmacsPortable.App is started up AND PuTTY Pageant has not started up, then:
Therefore, you do not need to always manually edit proxy settings, and plink should work most of the time.
Icons came from various places:
These are notes to use the bleeding edge emacs.
Goto the App directory, and under a command prompt that has bzr installed, type
bzr branch --stacked bzr://bzr.savannah.gnu.org/emacs/trunk emacs-bzr
[2011-12-14 Wed 21:48]
(should be the same between platforms)