PageRenderTime 92ms CodeModel.GetById 70ms app.highlight 5ms RepoModel.GetById 15ms app.codeStats 0ms


HTML | 28 lines | 27 code | 1 blank | 0 comment | 0 complexity | 383e9143355a20c8e6e3e87c405c52c8 MD5 | raw file
 1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 11. Installing Edit Modes</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="jEdit 4.3 User's Guide"><link rel="up" href="writing-modes-part.html" title="Part II. Writing Edit Modes"><link rel="prev" href="mode-match-type.html" title="The MATCH_TYPE Attribute"><link rel="next" href="updating-modes.html" title="Chapter 12. Updating Edit Modes"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 11. Installing Edit Modes</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="mode-match-type.html">Prev</a> </td><th width="60%" align="center">Part II. Writing Edit Modes</th><td width="20%" align="right"> <a accesskey="n" href="updating-modes.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="installing-modes"></a>Chapter 11. Installing Edit Modes</h2></div></div></div><p>jEdit looks for edit modes in two locations; the
 2    <code class="filename">modes</code> subdirectory of the jEdit settings directory, and
 3    the <code class="filename">modes</code> subdirectory of the jEdit install directory.
 4    The location of the settings directory is system-specific; see <a class="xref" href="settings-directory.html" title="The jEdit Settings Directory">the section called &#8220;The jEdit Settings Directory&#8221;</a>.</p><p>Each mode directory contains a <code class="filename">catalog</code> file. All
 5    edit modes contained in that directory must be listed in the catalog,
 6    otherwise they will not be available to jEdit.</p><p>Catalogs, like modes themselves, are written in XML. They consist of a
 7    single <code class="literal">MODES</code> tag, with a number of
 8    <code class="literal">MODE</code> tags inside. Each mode tag associates a mode name
 9    with an XML file, and specifies the file name and first line pattern for the
10    mode. A sample mode catalog looks as follows:</p><pre class="programlisting">&lt;?xml version="1.0"?&gt;
11&lt;!DOCTYPE CATALOG SYSTEM "catalog.dtd"&gt;
14    &lt;MODE NAME="shellscript" FILE="shellscript.xml"
15        FILE_NAME_GLOB="*.sh"
16        FIRST_LINE_GLOB="#!/*sh*" /&gt;
17&lt;/MODES&gt;</pre><p>In the above example, a mode named &#8220;<span class="quote">shellscript</span>&#8221; is
18    defined, and is used for files whose names end with
19    <code class="filename">.sh</code>, or whose first line starts with &#8220;<span class="quote">#!/</span>&#8221;
20    and contains &#8220;<span class="quote">sh</span>&#8221;.</p><p>The <code class="literal">MODE</code> tag supports the following
21    attributes:</p><div class="itemizedlist"><ul type="disc"><li><p><code class="literal">NAME</code> - the name of the edit mode, as it
22            will appear in the <span class="guimenuitem"><strong>Buffer Options</strong></span> dialog
23            box, the status bar, and so on.</p></li><li><p><code class="literal">FILE</code> - the name of the XML file containing
24            the mode definition.</p></li><li><p><code class="literal">FILE_NAME_GLOB</code> - files whose names match
25            this glob pattern will be opened in this edit mode.</p></li><li><p><code class="literal">FIRST_LINE_GLOB</code> - files whose first line
26            matches this glob pattern will be opened in this edit mode.</p></li></ul></div><p>Glob pattern syntax is described in <a class="xref" href="globs.html" title="Appendix D. Glob Patterns">Appendix D, <i>Glob Patterns</i></a>.</p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>If an edit mode in the user-specific catalog has the same name as
27        an edit mode in the system catalog, the version in the user-specific
28        catalog will override the system default.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="mode-match-type.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="writing-modes-part.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="updating-modes.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The MATCH_TYPE Attribute </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 12. Updating Edit Modes</td></tr></table></div></body></html>