jEdit Lite: running jEdit from a floppy disk
Submitted by Saturday, 17 November, 2001 - 17:13
on
First, I decided that I would do without the help documentation and the "Tip of the day" feature. Opening jedit.jar with a zip file utility, I removed all of the files in the /doc directory and all of the HTML tip files. The resulting jedit.jar shrunk to 986KB. Not bad for a start.
Next, I looked at the edit modes in the /modes directory. What would I really need on the road? I narrowed the selection down to the following: beanshell, c, cplusplus, html, java, javascript, perl, php, python, text, xml and xsl. The largest price paid was for the php mode: the file was 97KB, over four times the size of the next largest. Maybe someday we'll have a php-lite mode, but I decided to keep it in.
The catalog file in the /modes directory had to be edited to reflect the reduced selection of modes. I also added .sgml and .dtd to the xml mode specification and deleted the reference to the "first line" element. The /modes directory was now reporting a total size of 172KB.
Macros were next. I reduced the count from about 40 to 23. I also added a one-line macro, No_Help.bsh, which I associated to the F1 key:
Macros.error(view,"Help is not available for this version of jEdit.");
I also kept the two installation startup scripts in the /startup directory
The "lite" version of the /macros and /startup directories took up another 60KB.
Now for the hard part: what to about plugins. I decided that shell access and a working Error List facility were the essentials for a portable version of jEdit version. Adding EditBus.jar, Console.jar and ErrorList.jar added another 174KB to the floppy disk's contents.
The final task was to create a properties files that would smooth over some of the rough edges I created. It would be read at startup to do three things:
That was it - no hacking source code, no rebuilding. Total unused space on the floppy: 20.5 KB. Oh yes, and it worked!
There's a few more details to address. There's no room for user settings on the floppy. The application creates a user settings directory tree at startup if it doesn't find one, but it doesn't clean up after itself. So when you go visiting another computer and run your floppy, you may have to designate a -settings location on the command line where you have permissions to create directories and write files. You should also be polite and clean up the settings directory when you are done.
You could also put a group of shortcut assignments in another .props file in the /properties directory to personalize your portable version. And, of course, no one has figured out how to put a Java Runtime Environment on a floppy disk, so you will have to have one waiting for you. Nevertheless, the result of this exercise was a portable, functional copy of the latest stable version of jEdit. By following these procedures, you will never have to do without your favorite cross-platform text editor.
Next, I looked at the edit modes in the /modes directory. What would I really need on the road? I narrowed the selection down to the following: beanshell, c, cplusplus, html, java, javascript, perl, php, python, text, xml and xsl. The largest price paid was for the php mode: the file was 97KB, over four times the size of the next largest. Maybe someday we'll have a php-lite mode, but I decided to keep it in.
The catalog file in the /modes directory had to be edited to reflect the reduced selection of modes. I also added .sgml and .dtd to the xml mode specification and deleted the reference to the "first line" element. The /modes directory was now reporting a total size of 172KB.
Macros were next. I reduced the count from about 40 to 23. I also added a one-line macro, No_Help.bsh, which I associated to the F1 key:
Macros.error(view,"Help is not available for this version of jEdit.");
I also kept the two installation startup scripts in the /startup directory
The "lite" version of the /macros and /startup directories took up another 60KB.
Now for the hard part: what to about plugins. I decided that shell access and a working Error List facility were the essentials for a portable version of jEdit version. Adding EditBus.jar, Console.jar and ErrorList.jar added another 174KB to the floppy disk's contents.
The final task was to create a properties files that would smooth over some of the rough edges I created. It would be read at startup to do three things:
- prevent the help shortcut key from triggering an application error by invoking a missing help file,
- hide the "tip of the day" display, and
- make sure that the plugins were properly placed.
help.shortcut=
Misc/No_Help.shortcut=F1
tip.show=false
error-list.dock-position=bottom
hypersearch-results.dock-position=bottom
log-viewer.dock-position=bottom
console.dock-position=bottom
That was it - no hacking source code, no rebuilding. Total unused space on the floppy: 20.5 KB. Oh yes, and it worked!
There's a few more details to address. There's no room for user settings on the floppy. The application creates a user settings directory tree at startup if it doesn't find one, but it doesn't clean up after itself. So when you go visiting another computer and run your floppy, you may have to designate a -settings location on the command line where you have permissions to create directories and write files. You should also be polite and clean up the settings directory when you are done.
You could also put a group of shortcut assignments in another .props file in the /properties directory to personalize your portable version. And, of course, no one has figured out how to put a Java Runtime Environment on a floppy disk, so you will have to have one waiting for you. Nevertheless, the result of this exercise was a portable, functional copy of the latest stable version of jEdit. By following these procedures, you will never have to do without your favorite cross-platform text editor.