JED ModesAs you probably know JED has a really cool programming interface which makes it easy to do syntax highlighting, auto indenting and various other useful things for various mode. My JED ModesFrom time to time I manage to get fed up (or I'm just lazy or both) enough doing a certain task that I write a mode to simplify those tasks. Below is a list of modes which I have written so far and which you may or may not find useful.
Most of the modes above just provide syntax highlighting. Some exceptions are the diff and mutt modes which provide all sorts of other functionality as well. In order to use my MIB mode, you might need to patch JED. Other JED ModesI also have some other JED modes which I'm sure I did not write (I may have improved them), but which others do not seem to have. Here are some of them. Links to other JED AfficionadosBelow is a list of pages which you might want to visit.
Tips & tricksByte compiling .sl filesAssuming your JED_ROOT is set to /usr/share/jed/lib and all your .sl files reside there, change to that directory and edit bytecomp.sl. Search for a line that says
Insert the files you want to compile in there. Now run jed as follows
If you have any files that uses DFA syntax highlighting, you should also edit codeparse.sl and insert a line that says
somewhere between the HAS_DFA_SYNTAX directives. Of course, you have to replace some_filename.sl with the name of your .sl file. Alternatively, change to the directory where the .sl file is that you want to byte compile, start up an empty buffer in jed, and in there type this
Now type evalbuffer in the mini_buffer to the M-x prompt. Remember though that you need to be in the same directory as your .sl file when you do. Of course, you have to replace some_filename.sl with the name of your .sl file. Loading .sl modes (and adding it as the default mode for certain file extensions)This is easiest explained with examples, so here goes:
You can either put this in the system wide jed.rc file or in your ~/.jedrc. Binding keys to built-in jed functionsTo find out what built-in functions there is in jed, start jed, type M-x (That's Meta X (as in ALT-X or ESC-X) if you don't know what I'm talking about and press TAB twice. A small buffer will pop up through which you can browse through all the functions. When you've chosen one, open you configuration file and insert the following:
Just replace your_command with the command you have chosen and ^a with your hotkey. ^ is Ctrl and \ is Meta. Adding keywords in JED modesSomething which caught me when I wrote my first JED mode was JED's strange way of specifying keywords. Just look at the following statements:
What is immediately obvious is that you specify all the keywords of a certain length after each other and you have keyword statements for each length keyword. What is not so obvious (at least it wasn't obvious to me), is that those keywords should also be alphabetically sorted. To help with the painful process of sorting keywords, I wrote a small application to sort all the keywords for you. You might find this application useful if you write JED modes from time to time. Debian PackageI maintain my own Debian package which you can find below. It does not use the resolver library, and has a small patch applied to support my MIB mode. |