Further Emacs Customization
by Ian Kuon
Overview
If you've read the app notes you have likely read about VHDL Mode for GNU Emacs. This talks about various customizations for Emacs. Fortunately, these options have already been installed by default so all you have to do is run emacs with a VHDL (.vhd) file and the VHDL sensitive menu will appear. For some people further customization of emacs may be normal but, for the rest of us, sorting through all the options can be intimidating. Thus, I'll discuss a few further customizations and explain how to do your own.
Compiling
In the past app note it discussed compiling code separately in Maxplus2. This is somewhat annoying once you get accustomed to the extensive VHDL enhancements of emacs. It turns out that code can be compiled directly in emacs for both Maxplus2 or Mentor Graphics (QuickHDL). The following file will provide all the options required for compiling with Maxplus2 or Mentor Graphics. Copy this file to your home directory. If you have a .emacs file already just add the options in the file into your file. The default will be set to Maxplus2. Now to compile all that is required is to select VHDL -> Compile -> Compile buffer and the program will compile as in Maxplus2. Unfortunately you'll have to use Maxplus2 to make the original acf file so that the proper preferences (Device, etc) can be set; however, once that's done you can use emacs for most everything else. As it compiles it shows you any error messages that occur.
For the curious this is possible using the Maxplus2 command line options. This has been discussed in the past but to compile a program in Maxplus2 all that one must type is maxplus2 -c <filename>. Similarly QuickHDL can be compiled from the command-line using the following command qvhcom -nologo -source -explicit -93 <filename>.
Further Customizations
It is also possible to easily customize many other features of emacs. These customizations are sorted by groups. To access the groups of customizations select VHDL -> Customize -> Customization Groups. This presents a menu with the following groups. I have added the text in italics to explain what one might want to customize.
[-]-\ [Group] Vhdl
[+]-- [Group] Vhdl Mode
[+]-- [Group] Vhdl Compile
These are the selections for compilers and this is what I used to change the compiler options discussed above.
[+]-- [Group] Vhdl Style
The general style of the the code such as having emacs automatically change the case of words.
[+]-- [Group] Vhdl Electric
In the VHDL mode, VHDL will automatically start templates, etc based on your typing. This allows turning on and off of this feature.
[+]-- [Group] Vhdl Model
[+]-- [Group] Vhdl Port
[+]-- [Group] Vhdl Comment
This can be used to set the style of the comments.
[+]-- [Group] Vhdl Align
This is probably one of the more likely areas people would want to change. This affects how code is alligned so it should be adjusted to suit your preferences.
[+]-- [Group] Vhdl Highlight
Syntax highlight can be modified to highlight more or different things.
[+]-- [Group] Vhdl Menu
[+]-- [Group] Vhdl Print
This allows one to select the option of printing 2 per page or having post script specific fonts.
[+]-- [Group] Vhdl Misc
If you have any questions please e-mail me.
Written by Ian Kuon from the SecureT group. Last modified October 31, 2000.