Lugaru's Epsilon
Programmer's
Editor

Context:
Epsilon User's Manual and Reference
   Commands by Topic
      Buffers and Files
         Buffers
         Files
            . . .
            File Name Prompts
            File Name Case
            File Variables
         Internet Support
            URL Syntax
         . . .

Previous   Up    Next
File Name Case  Commands by Topic   Internet Support


Epsilon User's Manual and Reference > Commands by Topic > Buffers and Files > Files >

File Variables

The find-file command examines a file's name and contents to determine an appropriate language mode for it. For instance, files with a .c extension are put in C mode. You can override this decision with a "file variable".

These are specially-formatted lines at the top or bottom of a file that indicate the file should use a particular language mode or tab size. For example, you can put -*- mode: VBasic -*- anywhere on the first line of a file to force Epsilon to Visual Basic mode, or write -*- tab-size: 3 -*- to make Epsilon use that tab size setting.

Epsilon recognizes a syntax for file variables that's designed to be generally compatible with Emacs. The recognized formats are as follows. First, the first line of the file (or the second, if the first starts with #!, to accommodate the Unix "shebang" line) may contain text in one of these formats:

-*- mode: modename -*-

-*- modename -*-

-*- tab-size: number -*-

-*- tab-width: number -*-

-*- mode: modename; tab-width: number -*-

Other characters may appear before or after each possibility above; typically there would be commenting characters, so a full line might read /* -*- mode: shell -*- */. The first two examples set that buffer to the specified mode name, such as Perl or VBasic or C, by running a command named modename-mode if one exists. (A mode name of "C++" makes Epsilon uses the C++ submode of C mode.) The next two behave identically, setting the width of a tab character for that buffer. (Epsilon recognizes either name for compatibility.)

The other syntax for file variables must appear at the end of the file, starting within the last 3000 characters. It looks like this:

Local Variables:
mode: modename
tab-size: number
End:

The first and last lines are required; inside are the settings, one per line. Each line may have additional text at the start and end of each line (so it will look like a comment in the file's programming language).



Previous   Up    Next
File Name Case  Commands by Topic   Internet Support


Lugaru Copyright (C) 1984, 2020 by Lugaru Software Ltd. All rights reserved.