PageRenderTime 160ms CodeModel.GetById 22ms app.highlight 7ms RepoModel.GetById 129ms app.codeStats 0ms

/www/tags/NOV_07_2009/htdocs/42docs/users-guide/installing-modes.html

#
HTML | 47 lines | 46 code | 1 blank | 0 comment | 0 complexity | b60139a889d08bc9e467e3e82ee0c0b7 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.65.1"><link rel="home" href="index.html" title="jEdit 4.2 User's Guide"><link rel="up" href="writing-modes-part.html" title="Part II. Writing Edit Modes"><link rel="previous" href="mode-syntax-tokens.html" title="Token Types"><link rel="next" href="updating-modes.html" title="Chapter 12. Updating Edit Modes for jEdit 4.1/4.2"></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-syntax-tokens.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></div></div><p>
 2  jEdit looks for edit modes in two locations; the
 3  <tt class="filename">modes</tt> subdirectory of
 4  the jEdit settings directory, and the
 5  <tt class="filename">modes</tt> subdirectory of the jEdit install directory.
 6  The location of the settings directory is system-specific;
 7  see <a href="settings-directory.html" title="The jEdit Settings Directory">the section called &#8220;The jEdit Settings Directory&#8221;</a>.
 8 </p><p>
 9  Each mode directory contains a <tt class="filename">catalog</tt> file. All edit
10  modes contained in that directory must be listed in the catalog, otherwise
11  they will not be available to jEdit.
12 </p><p>
13  Catalogs, like modes themselves, are written in XML. They consist of a
14  single <tt class="literal">MODES</tt>
15  tag, with a number of <tt class="literal">MODE</tt> tags inside. Each mode tag
16  associates a mode name with an XML file, and specifies the file name
17  and first line pattern for the mode. A sample mode catalog looks as
18  follows:
19 </p><table border="0" bgcolor="#E0E0E0"><tr><td><pre class="programlisting">&lt;?xml version="1.0"?&gt;
20&lt;!DOCTYPE CATALOG SYSTEM "catalog.dtd"&gt;
21
22&lt;MODES&gt;
23    &lt;MODE NAME="shellscript" FILE="shellscript.xml"
24        FILE_NAME_GLOB="*.sh"
25        FIRST_LINE_GLOB="#!/*sh*" /&gt;
26&lt;/MODES&gt;</pre></td></tr></table><p>
27  In the above example, a mode named &#8220;<span class="quote">shellscript</span>&#8221; is
28  defined, and is used for files whose names end with
29  <tt class="filename">.sh</tt>, or
30  whose first line starts with &#8220;<span class="quote">#!/</span>&#8221; and contains
31  &#8220;<span class="quote">sh</span>&#8221;.
32 </p><p>
33  The <tt class="literal">MODE</tt> tag supports the following attributes:
34 </p><div class="itemizedlist"><ul type="disc"><li><p><tt class="literal">NAME</tt> - the name of the edit mode, as it
35  will appear in the <span><b class="guimenuitem">Buffer Options</b></span> dialog box, the
36  status bar, and so on.</p></li><li><p><tt class="literal">FILE</tt> - the name of the XML file
37  containing the mode definition.</p></li><li><p><tt class="literal">FILE_NAME_GLOB</tt> - files whose names match
38  this glob pattern will be opened in this edit mode.</p></li><li><p><tt class="literal">FIRST_LINE_GLOB</tt> - files whose first line
39  matches
40  this glob pattern will be opened in this edit mode.</p></li></ul></div><p>
41  Glob pattern syntax is described in
42  <a href="globs.html" title="Appendix D. Glob Patterns">Appendix D, <i>Glob Patterns</i></a>.
43 </p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
44   If an edit mode in the user-specific catalog has the same name as
45   an edit mode in the system catalog, the version in the user-specific catalog
46   will override the system default.
47  </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="mode-syntax-tokens.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">Token Types </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 for jEdit 4.1/4.2</td></tr></table></div></body></html>