Epsilon User's Manual and Reference >
Commands by Topic >
When you use the
find-file command to read in a file, Epsilon looks at the
file's extension to see if it has a mode appropriate for editing that
type of file. For example, when you read a .h file, Epsilon goes into
C mode. Specifically, whenever you use find-file and give it a
file name "foo.ext", after find-file reads in the
file, it executes a command named "
suffix_ext", if such
a command exists. The find-file command constructs a
subroutine name from the file extension to allow you to customize what
happens when you begin editing a file with that extension.
For example, if you want to enter C mode automatically whenever you
use find-file on a ".x" file, you simply create a command (a
keyboard macro would do) called "
suffix_x", and have that
command call c-mode, or even better, an existing
function. One way is to add a line like this to your einit.ecm
file (see Command Files):
(define-macro "suffix-x" "<!suffix-c>")
For another example, you can easily stop Epsilon from automatically
entering C mode on a ".h" file by using the delete-name
command to delete the subroutine "
suffix-h". (You can
_ characters in Epsilon command names.)
Or define a suffix-h macro so it calls the fundamental-mode
command in your einit.ecm file, as above.
When Epsilon doesn't recognize a file's extension, a file has no
extension, or when an extension is frequently used for different kinds
of data, Epsilon examines the file's contents to help pick the best
mode. A subroutine you can customize named
guess_mode_without_extension( ) performs this task.
A file's text can include a file variable (see File Variables) that specifies the correct mode to use, and
Epsilon will use that mode instead of choosing one itself.
Epsilon also has various features that are useful in many different
language modes. See the description of tagging in Tags
and the section in More Programming Features.
In addition to the language-specific modes described in the following
sections, Epsilon includes modes that support various Epsilon
features. For example, the buffer listing generated by the
bufed command on Ctrl-x Ctrl-b is actually in an Epsilon
buffer, and that buffer is in Bufed mode. Press F1 m to display help
on the current mode.
Many language modes will call a hook function if you've defined one.
For example, C mode tries to call a function named
A hook function is a good place to customize a mode by setting
buffer-specific variables. It can be a keyboard macro or a function
written in EEL, and it will be called whenever Epsilon loads a file
that should be in the specified mode.
To customize a mode's key bindings, see the example for C mode in C Mode.
The fundamental-mode command removes changes to key bindings
made by modes such as C mode, Dired mode, or Bufed mode. You can
configure Epsilon to highlight matching parentheses and other
delimiters in fundamental mode; see the
Also see File Name Prompts to customize the list of file
types shown in File/Open and similar dialogs in Epsilon for Windows.
Other C mode Features
Configuration File Mode
HTML, XML, and CSS Modes
Ini File Mode
TeX and LaTeX Modes
Visual Basic Mode
Epsilon Programmer's Editor 14.04 manual. Copyright (C) 1984, 2021 by Lugaru Software Ltd. All rights reserved.