|
|
Click here if you want to see some frequently asked questions and answers.
Click here if you want to see how to install it on Windows.
First, if you downloded the file over the web, then you can skip steps 1, 2 and 3 and go directly to step step 4. If instead you received the specman-mode via email, follow the directions it came with as to how to unpack the file. Typically it will be something like
If your uudecode doesn't work right, feel free to use this perl version of uudecode.
Note: you can remove the old lisp you may have from using a previous version of specman-mode; the below is all you need. The old stuff tried to complete the installation of font-lock mode, pick rational colors, and figure out what color your background screen was. Emacs is a fair bit better at this now.
An easy way to determine the right place is to type C-h v load-path RET to emacs; this will give you a list of the paths that are searched to find lisp files. Here, typing at FSF emacs, I get:
Coloring your code is really cool, impresses your friends, and actually does help one code quicker, and helps one understand others code. The only problem is that each version of emacs has different ways of specifying what color should be used, and hence it is a bear.
For a while, I distributed code folks could put in their .emacs that would attempt to figure out what version of emacs (FSF or XEmacs) was installed, and which sub version of the two major packages was in use. Further, it attempted to determine if the user had a dark, or a light background, and then would install my notion of what might be nice colors.
The world is changing too fast; and both XEmacs and FSF emacs now have easy to modify, and quite reasonable defaults. Therefore I removed my distributed code, and have added this section to support folks still using older emacsen. Find your version below, and see what hints I have for getting colors to work.
First: install specman-mode as per the above instructions.
If you do have a recent version of emacs, but still have no colors, then you need to check a few things. First some definitions. The package that does the coloration in all emacs is called font-lock. Font-lock is a minor mode, which means it is an add on to major modes like specman-mode, c-mode and so on. When a buffer is in the font-lock mode, font lock adds the string 'Font' to the mode line. So, the first question: Does the mode line look like
If it is the later, then you are not in font lock mode. Fix this by typing M-x font-lock RET. If suddenly everything leaps into color, then we've figured it out. Next you need to make it so specman files automatically get put into font lock mode. Do this by checking to make sure the following lines are in your .emacs file:
Of course, this should be the case if you followed the install instructions.
Now if these lines are already in your .emacs, then some how they are not getting executed. Add the following lines to the file. (Note that you can use this same method to debug the site install method if that isn't giving you automatic colors).
Now restart emacs, and watch the echo buffer carefully. If you see the message Adding font-lock to the specman-mode hook appear, and everything stop for ten seconds, then the file was indeed loaded. I'd fully expect that if you load a file that ends in .v it will appear in the Specman-mode, and in full Technicolor.
OK, we are nested in a few ifs now, Lets see, if you are reading this, you have a recent emacs, the buffer isn't already in font lock mode, and explicitly invoking font-lock got you into specman-mode, and we've debugged how to make this automatic. Let us unwind the stack. If explicitly loading font-lock somehow didn't work, then I don't know what to say. Do you get an error like 'M-x font-lock: [No match]'? In that case some how your installation doesn't have font lock, and I'd just ignore that installation and get a new one.
If you do have --(Specman Font)-- in the mode buffer, but no colors, then perhaps you are on a black and white tube? Or maybe you have the colors set to never use anything but black and white? If it is the later, use the menu bar Specman->Customize Specman Fonts and Colors to pick better colors.
If still things are not working, please file a bug report.
Q 1: I share my specman to someone using codewrite. When they edit the code it looks unindented. Is the problems tabs, can I control whether the tools inserts tabs???
A 1: This is a general problem sharing files between folks. It also occurs between folks using the same editor, as many editors allow one to set the tab width. The general solution is for you to add a write file hook that expands tabs to spaces.
Add the following to your .emacs file:
Some explanation: This arranges so that any file in specman mode (the "add-hook 'specman-mode-hook" part) gets added to it's 'local-write-file-hooks' a call to the function 'untabify' with arguments that are the first and last character in the buffer.
Q 2: If I use Helvetica as my font, the auto indent doesn't work.
A 2: The indent scheme used by the specman mode is based on counting spaces, and hence only works if you are using constant width fonts. Helvetica is not constant width, while Courier, or Fixed and the like are constant width. Sorry.
Q 3: How do I indent a region of code; typing
TAB on every line is getting old...
Is there any way to
indent a whole module/function/if clause etc. like
c-indent-exp [M-C-q] in C-mode ?
A 3: Use C-M-\ to indent a region (selected by setting the point at one end, and having the cursor at the other end, as usual). Perhaps a future version of the emacs mode will include functions that mimic some of C's extra bindings.
Q 4: I am an active user of your emacs for specman. I must congratulate you for your innovative work. At work I have unix work station. So no problem. But at home I wish work with emacs for specman on PC-win98. Can you please suggest some way I can do it?
A 4: First, this answer applies to the emacs port for the PC that I use; you can fetch that from here.
What is happening? The first step is to install an emacs. Probably any emacs will do; I know the above works for the version of emacs that I use.
The second and third step adds a directory where you can install third party lisp routines (like specman-mode). It is a really good idea to do this, so that later if you install a new version of emacs, you don't overwrite goodies that you have collected over the years.
The fourth step deals with the fact that (to my knowledge) the emacs ports to the PC don't convieniently support a .emacs file. Instead, we make a .bat file, where we can do some configuration of emacs. First we tell the script to work quietly. Then we define where we have installed emacs. If you decide to put it somewhere other than were I did, change this line. Then I define the SHELL I use. Then the key part: I tell emacs where to look for its lisp files. I here ask it to search c:\emacs\site-lisp first, then the standard place for this version of emacs, c:\emacs\lisp. This way, my lisp files can override the system versions. The remaining lines define more directory paths to parts of emacs. The last line actually invokes emacs with whatever command line arguments you (somehow) invoke it this .bat file with.
The fifth step deals with a limitation of Windows 95. If you are running Windows 98 or NT, perhaps you won't have to do this (And perhaps you will have to do something else! :-(). Basically, Win'95 by default does not allow very many characters in the environment, so here we saying "run the command em.bat, with an environment of 32768 characters". 32768 is probably overkill, but we certainly won't exceed it!
The sixth step makes it simple to find emacs.
The seventh step is your start up file, which tells emacs that you'd like files that have a suffix .v to be opened in the Specman mode.
Please send me any corrections, feedback, Win'98 or NT hints you have!
Q 5: I can't seem to insert tabs (fixed number of whitespaces) anywhere in the file -- for ex. between port list line and comment next to signal:
A 5: In general, in emacs you can escape the special meaning of any key by first typing C-q, which is documented as follows. (Type C-h k C-q to see the documentation yourself)
For this particular case (lining up comments) another key stroke is even more useful (and also works in most any emacs mode): M-; Escape ; is documented as follows:
So, it looks like it's seeing my specman-mode.el but not executing properly. Any help will be greatly appreciated!
A 6: You need hideif.el, which is a part of the XEmacs base package, which you somehow have not installed, or have not updated. The specman-mode depends on emacs having this basic functionality, and does not handle its lack gracefully.
A few years ago the XEmacs people unbundled all the packages from XEmacs, with the idea that because the two change on a different schedules, with the core XEmacs changing frequently; and further because the API between the packages and XEmacs almost never changes, you could happily update the core, or the packages, and still everything would work fine.
An unhappy consequence of this is that a number of people installed the new XEmacs core, and didn't notice that they have to install the package hierarcy (only once!).
It is fairly simple to do, assuming you have system privileges.
To do this, go to: http://www.XEmacs.org/Install/index.html and make sure steps 7 - 12 are followed.
Of course being a lowly verification engineer, it is possible that you do not have system privileges. (When will they learn that these computers, and the computer support staff are here to serve the verification engineers, not the other way around!!! *sigh*)
The best course is to ask whomever installed XEmacs to go to the above web site and finish the job.
If that is impossible, then click here to get a version of hideif.el; put this file in the same directory as your copy of specman-mode.el. Be sure it is saved as the filename hideif.el.
Take heart; The learning curve is steep; but the view from the top is wonderful!