|
|
|
||||||||||
GNU Emacs is a highly extensible and customizable text editor. You can find many useful information (Manual, FAQ, ...) on the official GNU Emacs project page.
Most likely Emacs is already available on these platforms, otherwise
gzip -d -c emacs-21.4a.tar.gz | tar xvf -local installation Note: Adapt the prefix path
cd emacs-21.4
./configure
make
make install
gzip -d -c emacs-21.4a.tar.gz | tar xvf -
cd emacs-21.4
./configure --prefix=/path/to/my/emacs
make
make install
There are two rather different ways to use Emacs on the windows platform:
![]()
Cygwin is a Linux-like environment for Windows that emulates the Linux API (Application Programming Interface) and provides a broad collection of Linux tools that are ported to Cygwin (and run on top of the emulation layer).
A native Windows port however is noticeably faster and consumes much less disk space so if you solely need Emacs this is the recommended way.
The following is a brief description about how to install the GNU Emacs Windows port. For more detailed instructions and more information please see the GNU Emacs FAQ For Windows page.
![]()
Note: For newer Emacs versions the registry keys are no longer required, so if you don't like them you can delete them with the registry editor ("Start -> Run : regedit").
Note: For newer Emacs versions the registry keys are no longer required, so if you don't like them you can delete them with the registry editor ("Start -> Run : regedit"). Warnings:
Some functionality of Emacs relies on external binaries, e.g. the "Tools -> Compare" functions require the "diff" utility to be available on the system. Fortunately there exist native Windows ports for many Gnu Utilities. GnuWin32 is a very nice project with many packages available.
![]()
To install the DiffUtils package you can choose between an installer and a zip-file based method. For the full details please see the "Installation and Usage" section of the package and "General Installation Instructions".
![]()
global installation (Administrator rights required)
unpack or install to "C:\Program Files\GnuWin32"
local installation
unpack or install to a folder on your account, e.g. "My Documents\Applications\GnuWin32"
#option 1
Add the "GnuWin32\bin" folder to the "PATH" Windows environment variable. Emacs reads this variable at startup an adds its value to the search path for executables (i.e. exec-path). Unless the name of a new binary coincides with an existing windows binary it does not matter whether you prepend or append to "PATH". Note: This option has the advantage that you can easily run the new binaries from the windows command prompt too.
global installation (Administrator rights required)
Set the following system environment variable:
name = PATH
value = %PATH%;C:\Program Files\GnuWin32\bin
local installation
Set the following user environment variable (adapt value)
name = PATH
value = %PATH%;%USERPROFILE%\My Documents\Applications\GnuWin32
#option 2
Add the "GnuWin32\bin" folder directly to the Emacs "exec-path". This can be done in an Emacs customization file.
site-wide installation (Administrator rights required unless Emacs locally installed)
Add this to the site-start.el file (please note the forward slashes in the paths!):
; append
(setq exec-path (append exec-path (list "C:/Program Files/GnuWin32/bin")))
; prepend
;(setq exec-path (cons "C:/Program Files/GnuWin32/bin" exec-path))
per-user installation
Add this to your .emacs/_emacs file (please note the forward slashes in the paths!):
; append
(setq exec-path (append exec-path (list(expand-file-name "~/Applications/GnuWin32/bin"))))
; prepend
;(setq exec-path (cons (expand-file-name "~/Applications/GnuWin32/bin") exec-path))
Note: Adapt the path as needed. This example assumes that your Emacs "home" is set to "%USERPROFILE%\My Documents" as "~" will be replaced by its value.
Emacs customizations (actually lisp code) are usually stored in these files:
.emacs
site-start.el
At startup Emacs looks for "site-start.el" and ".emacs" (in this order) and loads them in turn if they exist. Therefore you can easily modify or override site-wide settings with your personal init file.
![]()
Note: For site-wide settings you could also have a default.el file that is loaded after the per-user settings.
![]()
It is always a good idea to check if there exist site-wide settings and have a closer look at them as they might considerably change the default behavior of Emacs.
Tip: Users here at D-ITET might want to read "Setup here at D-ITET" (see below).
Put the Emacs customization files in the following places:
.emacs
in your home directory, i.e. $HOME<tt></tt>
![]()
site-start.el
in the Emacs installation directory under "emacs-XX.X/share/emacs/site-lisp/"<tt></tt>
The file ".emacs" can alternatively be named "_emacs" to avoid problems when using the GUI to create this file. Note: do not use both files concurrently.
Put the Emacs customization files in the following places:
.emacs or _emacs<tt></tt>
Emacs will look for this file in your "home" directory, the location of which is determined as follows (take the first value defined/set or fall back to 4.):
- Value of the Windows environment variable named "HOME"
- Value of registry key <tt>"HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs\HOME"</tt>
- Value of registry key <tt>"HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs\HOME"</tt>
- "C:\"
Option 1. is a convenient method to set your Emacs "home" but make sure there arises no conflict with other software installed that uses this environment variable too (e.g. Cygwin, see here).
![]()
The best location to set Emacs "home" to might also depend on your Window setup, but here are two suggestions (using standard windows environment variables):
- <tt>%USERPROFILE%\My Documents</tt>
- <tt>%HOMEDRIVE%%HOMEPATH%</tt>
Note: You should also take into consideration that Emacs substitutes "~" in filenames (e.g. ~/_emacs) with the value of "home".
Troubleshooting HOME: To check what Emacs thinks your "home" is set to type the following lisp code in the *scratch* buffer and evaluate it with C-x C-e:
(insert (getenv "HOME"))The actual value of "home" should now be inserted in the same window just behind the lisp code.
site-start.elin the Emacs installation directory under <tt>"emacs-XX.X/site-lisp/"</tt>
VHDL Mode is an Emacs major mode for editing VHDL code. This mode has plenty of very useful features that greatly facilitate writing of VHDL code.
It was primarily developed with GNU Emacs but is compatible to XEmacs too.
![]()
Tip: Users here at D-ITET might want to read "Setup here at D-ITET" (see below).
With newer Emacs versions (>= 20.4 for Gnu Emacs) VHDL Mode is part of the distribution. To check the version and availability of VHDL Mode in your current Emacs installation start up Emacs and try to load vhdl-mode with the following command (in Emacs):
M-x vhdl-mode
Note: "ESC x" does exactly the same as "M-x", so if you do not have a Meta key you can always use the Escape key instead. Please note that the two keys "ESC" and "x" do not need to be pressed simultaneously (which would be written as "ESC-x"). Furthermore, on Windows the Alt key usually acts as Meta key.
Unless VHDL Mode is missing altogether you should now see the version number at the bottom of the Emacs window in the minibuffer. If you have an old version or no VHDL Mode at all follow the instructions below to install the latest version.
Note: site-wide installation means for all users of this particular Emacs installation and per-user installation means only for the current user, i.e. the user you are currently logged on.
(setq load-path (cons (expand-file-name "~/library/vhdl-mode-3.33.5") load-path))Notes:
(autoload 'vhdl-mode "vhdl-mode" "VHDL Mode" t)to the appropriate Emacs customization file:
(setq auto-mode-alist (cons '("\\.vhdl?$" . vhdl-mode) auto-mode-alist))
The VHDL Mode default settings are very reasonable, but to support a custom naming convention some extra configuration is needed. You can find this as well as an example ".emacs" file below.
To use these customizations add them to the appropriate Emacs customization file (.emacs/_emacs, site-start.el).
Note: To see all possible customizations of VHDL Mode use the "VHDL -> Options" menu in Emacs.
![]()
Troubleshooting: If VHDL Mode does not behave as expected and you are sure that the installation and configuration are correct then try this:
M-x byte-compile-file RET ~/mylisp/vhdl-mode.el RET
You can add, modify or delete windows environment variables through the "Environment Variables" Dialog (see below). There are per-user settings ("User variables") and system wide settings ("System variables"). To modify the latter Administrator rights are required.
![]()
To verify the settings you can open a command shell ("Start -> Run : cmd") and type "set" at the prompt to see all environment variables or type "set home" to show only variables that begin with "home".
If you want Windows to open a ".vhd" or ".vhdl" file with Emacs when you double-click it you need to create file type associations.
For a global installation do the following instructions with Administrative (or "Power User") rights, for a local installation make sure you do not have such rights, i.e. you are only member of the "Users" group.
To associate ".vhd" to "runemacs.exe":
![]()
Troubleshooting and background info:
There are basically three places in the registry where this information will be stored (with increasing precedence):
![]()
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.vhd
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\vhd_auto_file
HKEY_CURRENT_USER\SOFTWARE\Classes\.vhd
HKEY_CURRENT_USER\SOFTWARE\Classes\vhd_auto_file
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.vhd
The "SOFTWARE\Classes\.vhd" keys point to "vhd_auto_file" which in turn points to "runemacs.exe". The "Explorer\FileExts\.vhd" key stores the actual file association in a key named "Progid" or "Application" and NOT in the two subkeys "OpenWithList" and "OpenWithProgids" as it might appear.
You can have entries in one, two or even three of these places (precedence is as noted above). Note: A merged view of the keys under "SOFTWARE\Classes\" is available under "HKEY_CLASSES_ROOT", but it is more transparent to work with the original keys from "HKEY_LOCAL_MACHINE" and "HKEY_CURRENT_USER".
You can always remove associations by simply deleting above key(s) including all subkeys ("Start -> Run : regedit", select key and hit DEL). Particularly the "Explorer\FileExts\.vhd" can cause strange problems when creating new file associations with above method, so if you experience such problems simply delete this key and retry.
The GUI to change file associations (Tools -> Folder Options... -> File Types) is somewhat limited, e.g. it does not show entries from "Explorer\FileExts\" and does not allow a restricted user (no Administrator or Power User) to delete/modify the associations he was able to create beforehand.
Some points about the Emacs/VHDL-Mode setup here at D-ITET:
![]()
Wichtiger Hinweis:
Diese Website wird in älteren Versionen von Netscape ohne
graphische Elemente dargestellt. Die Funktionalität der
Website ist aber trotzdem gewährleistet. Wenn Sie diese
Website regelmässig benutzen, empfehlen wir Ihnen, auf
Ihrem Computer einen aktuellen Browser zu installieren. Weitere
Informationen finden Sie auf
folgender
Seite.
Important Note:
The content in this site is accessible to any browser or
Internet device, however, some graphics will display correctly
only in the newer versions of Netscape. To get the most out of
our site we suggest you upgrade to a newer browser.
More
information