[ Combined Document ] | Contents | Previous | Next
Open a command prompt (MSDOS) window. Decide on a directory in which to place Emacs. Move the distribution to that directory, and then unpack it. If you have the gzipped tar version, first use gunzip to uncompress the tar file, and then use tar with the "xvfm" flags to extract the files from the tar file:
% gunzip -c -d emacs*.tar.gz | tar xvf -
The "-d" flag forces gunzip to decompress (its behavior depends upon the case of the name of the executable, and sometimes it doesn't recognize that it is really gunzip), and the "-c" flag tells it to pipe its output to stdout. Similarly, the "-" flag to tar tells it to read the tar file from stdin. Unpacking the distribution this way leaves the distribution in compressed form so it takes up less space.
You may see messages from tar about not being able to change the modification time on directories, and from gunzip complaining about a broken pipe. These messages are harmless and you can ignore them.
If for some reason you also want to have the tar file gunzipped, then invoke gunzip without the -c option:
% gunzip -d emacs*.tar.gz
You can find precompiled versions of all of the compression and archive utilities in UnxUtils.zip file at http://unxutils.sourceforge.net/ (ftp mirrors).
After unpacking the archive there's very little left to do, you have the choice of:
See the section below on troubleshooting Emacs if, after downloading a precompiled distribution and unpacking it according to the instructions above, you have trouble running Emacs.
At its core Emacs contains a Lisp interpreter, this engine is used to implement most of the core functionality of Emacs.
To customize Emacs mostly involves writing extra functions in Lisp, or changing variables that affect the behaviour which is already present.
Emacs reads a file ".emacs" when it starts up, this is where it expects to find any customizations that you have made.
When Emacs starts up it attempts to load, and execute the contents of a file called ".emacs", or "_emacs". This file is where all the customizations are saved, and restored from when you restart Emacs. All of these settings are stored as Lisp expressions, for a general introduction to Lisp you could see : http://cons.org, more Emacs Specific information can be found in the Emacs Lisp Manuals.
Your startup file can be named either _emacs or .emacs, and should be placed in your "home" directory. If you have both files in your home directory, Emacs will load the .emacs file and ignore _emacs.
Your home directory is where the HOME configuration variable tells Emacs it is. As with the other Emacs configuration variables, HOME can be set in a number of ways:
If Emacs cannot find HOME set in any of the above locations, it will assume your HOME directory is "C:/".
The directory specified by HOME is also the directory substituted for tildes (~) in file names used in Emacs (so, by definition, you can always load your startup file in Emacs by doing C-x C-f "~/.emacs").
Troubleshooting: If you've set HOME to a directory using one of the above methods, and Emacs still doesn't load your startup file, the first thing you should do is check to see what Emacs thinks HOME is set to. You can do this by evaluating the following expression in the *scratch* buffer using C-x C-e:
(insert (getenv "HOME"))
Look carefully at what is printed and make sure the value is valid. For example, if the value has trailing whitespace, Emacs won't be able to find the directory. Also, be sure that the value isn't a relative drive letter (e.g., "d:" without a backslash); if it is, then HOME is going to be whatever the current directory on that drive is, which is likely not what you want to happen.
Ingo Koch <email@example.com> maintains a web site of sample .emacs files contributed by various users. His site is at http://www.dotemacs.de/.
There is also a small selection of sample .emacs files available at http://www.dotfiles.com
If you would like to have Emacs prompt you before closing, add the following to your startup file:
(setq confirm-kill-emacs 'yes-or-no-p)
You can use a package like gnuserv to associate files with Emacs so that opening a file outside of Emacs (e.g., by double-clicking on its icon) will create a new frame in a running Emacs displaying that file. It now works on all the Windows platforms that NTEmacs supports, and has a number of usefull features.
Be sure to place the gnuserv executables in your path (or modify your path or Emacs' exec-path to include them), and be sure that runemacs.exe is in your path if you use gnuserv to launch Emacs.
Note that you can set up file associations in Windows 95/98/NT 4.0 using Explorer by selecting the "View->Options..." menu operation, and then clicking on the "File Types" tab in the dialog that pops up. Clicking on a file type will allow you to edit it and associate the file with gnuclient.exe.
Warning: Be sure to quote the %1 in the association so that filenames with blanks in them are treated as one argument when sent to Emacs, e.g.:
[Discussion of other problems and solutions]
By default, gnuserv will load files into new frames. If you would rather have gnuserv load files into an existing frame, then evaluate the following in the chosen frame:
(setq gnuserv-frame (selected-frame))
Placing the above in your startup file, for example, will have gnuserv load files into the original Emacs frame. Note: one drawback of this approach is that if the frame associated with gnuserv is ever closed, gnuserv won't have a frame in which to place buffers.
You can use Emacs as the editor for composing mail for mailto: links, reading news for news: links, and editing HTML files in Internet Explorer. You first need to install the gnuserv utilities above, and then modify or create the following registry entries using regedit:
NewsKey: HKEY_CLASSES_ROOT\mailto\shell\open\command(Default) Value: gnudoit -q (message-mail (substring \"%1\" 7))
Edit HTMLKey: HKEY_CLASSES_ROOT\news\shell\open\command(Default) Value: gnudoit -q (gnus-fetch-group (substring \"%1\" 5))
Key: HKEY_CLASSES_ROOT\htmlfile\shell\edit\command(Default) Value: gnuclientw %1
Thanks to Jason Rumney <firstname.lastname@example.org> and Sigbjorn Finne <email@example.com> for these tips.
You can use Emacs to view document source from Netscape 3.1. First install the gnuserv utilities, and then edit the Preferences->Apps tab. In the "View Source" field, enter "gnuclientw.exe". Amy Abascal <firstname.lastname@example.org> describes what to do with Netscape 4.
I don't know of any way to have Netscape use Emacs for mailto: and news: links as with IE above.
Jerrad Pierce <email@example.com> has packaged together a PIF file and batch file for associating Emacs with file-types via gnuserv.
Files that you add to the desktop are stored in a directory somewhere under your Windows directory. On NT 4.0, this directory is %USERPROFILE%\desktop (in other words, c:\winnt\profiles(user)\desktop if you installed NT in c:\winnt).
If you're running Emacs in a windowing mode, and not in the console you may use a package called follow-mouse to make the current frame, or buffer the one with the mouse over it.
Find it here.
CapsLock and Control cannot be swapped from within Emacs, and Windows does not have a convenient mechanism like xmodmap to change virtual key bindings. Instead, new keyboard layouts or device drivers can be installed, or the registry can be modified, to swap the two keys.
WARNING: If you use a new keyboard layout to switch CapsLock and Control, beware of the option to use hotkey sequences to switch keyboard layouts. This option is in Control Panel->Keyboard under the Language (Windows 95) or Input Locales (Windows NT) tabs; the sequences themselves are "Left Alt+Control" and "Ctrl+Shift". If you enable one of these options, then you will likely at some point switch keyboard layouts while trying to use an Emacs key combination.
Windows 2000 can be treated in the same way as Windows NT, for swapping the Caps Lock.
Mark Russinovich has also written a freeware VxD that swaps CapsLock and Control under Windows 95. (I've been told that you might have to hit the real Control key once after installing the VxD to jumpstart the mapping.)
Windows 98: I've been told that the Windows 95 keyremap utility also works on Windows 98, despite the warnings on the web page.
There are several differences in the way in which Emacs behaves compared to a standard Windows application, however most of the functionality is already present within Emacs, its just a matter of enabling it.
Some behaviors typically found in other Windows apps, such as deleting typed-over highlighted selections, are not configured by default in Emacs. You can, however, enable them by loading various packages. If you would like to highlight the region between the point and the mark, see the help text for transient-mark-mode; if you would like highlighted selections to be deleted when you type over them, see the help text for delete-selection-mode; if you would like to change the semantics of keypad keys such as "home" and "end", see the help text for pc-selection-mode.
If you are used to standard Windows application keybindings, such as C-c for copy, C-v for paste, and C-x for cut, or selecting text with <shift>-movement, then you probably want to use Kim Storms <firstname.lastname@example.org> cua.el.
(defun w32-restore-frame () "Restore a minimized frame" (interactive) (w32-send-sys-command 61728)) (defun w32-maximize-frame () "Maximize the current frame" (interactive) (w32-send-sys-command 61488))
Binu Jose Philip <email@example.com> has written the dlgopen package to use the Windows Open File dialog box for opening files. Download dlgopen.zip, unpack, and read the top of the dlgopen.el file for directions on using the package.
The only thing that Emacs changes in your system is the registry (if you used addpm to install it). Emacs does not, for example, install any files in your system directory. If you don't mind the registry settings remaining in the registry, then you don't need to do anything to uninstall Emacs.
If you want to remove the registry settings, then you can use the regedt32 program to remove the Emacs registry keys. Depending upon what kind of permissions you have, the registry entries could have been installed in either HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs or HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs.
Emacs could have failed to run for a number of reasons. The most common symptom is that, when Emacs is started, the cursor changes for a second but nothing happens. If this happens to you, it is quite likely that the distribution was unpacked incorrectly.
Check for the following to see if there was a problem during unpacking:
If you are in doubt about whether the utilities you used unpacked the distribution incorrectly, use the gunzip, tar, and unzip executables provided in the utilities directory. These are the ones I use to create and test the distributions. My advice would be to use these utilities from the start.
If it is still not working, send mail to the list, describing what you've done, and what you are seeing. (The more information you send the more likely it is that you'll receive a helpfull response..
I have received reports that, after upgrading the operating system (e.g., from NT 3.51 to NT 4.0), an installed Emacs will start but will not accept keyboard or mouse input. Apparantly, running addpm.exe as described in the installation section above fixes the problem.
Some anti-virus software seems to interact badly with older version of Emacs, these programs shouldn't cause any problems if you are running a version of Emacs newer than 20.3.
A number of users have reported that Dr. Solomon's WinGuard prevent shell-related commands from working properly within Emacs. Turning off "Scan all files" makes it work, though.
A similar report from Charles Curley. <firstname.lastname@example.org> It has also been reported that you only need to select "Programming Files Only" instead of "All Files" to prevent Emacs from hanging.
A third report from Peter Haas about Norton Antivirus 2000 (Emacs 20.5.1, Win98): a DOS shell cannot be started within Emacs without disabling the antivirus autoprotect feature (e.g., clicking on the icon in the system tray).
There have been reports from some people that the McAfee virus scanner, (versions unreported), claims that the latest version of NTEmacs contains a virus.
Assuming that you are downloading from the official gnu.org site, then these are false positives which you might see in the following files:
These warnings seem to be artifacts of the way in which Emacs is built - the process of compiling a program, then using a "dumping" process to ensure that things are pre-loaded in the emacs.exe executable - and can be safely ignored.
To remove these warnings, update your virus scanner to the latest version.
Have you installed an Iomega Zip drive recently? The Iomega driver and Emacs appear to have a conflict that causes this crash. At present, the only solution is to disable the driver, reboot, and then use Emacs normally. To do this, look in the Startup folder (inside the Programs folder in the taskbar), locate the Iomega-related programs, and move them to a different folder. Then reboot. Emacs will work normally. If you want to use the Zip drive, manually execute the Iomega programs you moved. Then reboot before you use Emacs again. It's not convenient, but at least ou won't crash. Thanks to Will Duquette for this information.
Emacs initializes the variable "system-name" with the name of your computer upon startup. However, Emacs uses two different methods for determining the computer name depending upon whether Winsock is loaded by default when Emacs starts up. If Winsock is automatically loaded, then Emacs uses gethostname, otherwise Emacs uses GetComputerName. Alternatively, you can override all of this by explicitly setting system-name in your startup file (also look at user-mail-address for composing mail messages).
By default, Emacs does not automatically load Winsock because doing so will cause Winsock to establish a connection to the network. If you are connected to a LAN, then nothing will happen, but if you dialup to an ISP then invoking Emacs (thereby loading Winsock) will prompt you to unexpectedly dialup to your ISP.
You can have Emacs automatically load Winsock by defining the environment variable PRELOAD_WINSOCK. You can set it to an arbitrary value; Emacs just checks to see if it is defined. Similarly, you can create a registry entry PRELOAD_WINSOCK with the other Emacs registry entries (in HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs or HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs), which will do the same thing.
[ Combined Document ]
| Contents |
$Author: jasonr $ <email@example.com>
Updated: $Date: 2008/04/12 01:14:39 $