Lugaru's Epsilon Programmer's Editor
Context:
|
Epsilon User's Manual and Reference > Changing EpsilonEpsilon provides several ways for you to change its behavior. Some commands enable you to make simple changes. For example, set-fill-column can change the width of filled lines of text. Commands like bind-to-key and create-prefix-command can move commands around on the keyboard, and using keyboard macros, you can build simple new commands. The remaining chapters of the manual describe how to use the Epsilon Extension Language, EEL, to make more sophisticated commands and to modify existing commands.Unless you save them, all these types of changes go away when you exit, and you must reload them the next time you run Epsilon. As you'll see in the following chapters, extension language changes always exist in a bytecode file before they exist in Epsilon, so you could load the file again (with the load-bytes command) to restore changes made with the extension language. You can also save bindings and macros in a command file (using the insert-binding and insert-macro commands), so with some care you could preserve these types of changes from session to session via command files. However, Epsilon provides an easier way to preserve changes. When it starts, Epsilon reads a state file named epsilon.sta containing all of Epsilon's initial commands, variables, and bindings. You can change the set of initial commands by generating a new state file with the Epsilon command write-state on Ctrl-F3.
When Epsilon starts, it usually looks for a state file named
epsilon.sta. Alternatively, you can use Epsilon's -s flag to
make Epsilon load its state from some other file. For example,
" If you have just a few simple changes to make to Epsilon, you can make them permanent without learning EEL, the extension language. Simply start Epsilon, make your changes (bind some keys, set a variable, define some macros) and use the write-state command to put the changes in epsilon.sta. Your customizations will take effect each time you run Epsilon. Once you've learned a little EEL, you may want to modify some of Epsilon's built-in commands. We recommend that you keep your modifications to Epsilon in files other than the standard distributed source files. That way, when you get an update of Epsilon, you will find it easy to recompile your changes without accidentally loading in old versions of some of the standard functions. You may find it handy to have a file that loads your changes into a fresh Epsilon, then writes the new state file automatically. The following simple EEL file, which we'll call changes.e, uses features described in later chapters to do just that:
You can change most variables as in the example above. Some variables, however, have a separate value for each buffer. Consider, for example, the tab size (which corresponds to the value of the tab-size variable). This variable's value can potentially change from buffer to buffer. We call this a buffer-specific variable. Buffer-specific variables have one value for each buffer plus a special value called the default value. The default value specifies the value for the variable in a newly created buffer. A state file stores only the default value of a buffer-specific variable. Thus, to change the tab size permanently, you must change tab_size's default value. You can use the set-variable command to make the change, or an EEL program. The following version of changes.e sets the default tab size to 5.
To use this technique, first compile all the files that make up
Epsilon. If you have a "make" utility
program, you can use the makefile included with
Epsilon to do this. Then start Epsilon with the command You can then save the entire system in a state file using the write-state command. You may sometimes find it more convenient to modify the source files and build a new system, instead of using changes.e as outlined previously (for example, when you have made many changes to commands).
|