PageRenderTime 161ms CodeModel.GetById 11ms RepoModel.GetById 0ms 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
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  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. &lt;MODES&gt;
  22. &lt;MODE NAME="shellscript" FILE="shellscript.xml"
  23. FILE_NAME_GLOB="*.sh"
  24. FIRST_LINE_GLOB="#!/*sh*" /&gt;
  25. &lt;/MODES&gt;</pre></td></tr></table><p>
  26. In the above example, a mode named &#8220;<span class="quote">shellscript</span>&#8221; is
  27. defined, and is used for files whose names end with
  28. <tt class="filename">.sh</tt>, or
  29. whose first line starts with &#8220;<span class="quote">#!/</span>&#8221; and contains
  30. &#8220;<span class="quote">sh</span>&#8221;.
  31. </p><p>
  32. The <tt class="literal">MODE</tt> tag supports the following attributes:
  33. </p><div class="itemizedlist"><ul type="disc"><li><p><tt class="literal">NAME</tt> - the name of the edit mode, as it
  34. will appear in the <span><b class="guimenuitem">Buffer Options</b></span> dialog box, the
  35. status bar, and so on.</p></li><li><p><tt class="literal">FILE</tt> - the name of the XML file
  36. containing the mode definition.</p></li><li><p><tt class="literal">FILE_NAME_GLOB</tt> - files whose names match
  37. 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
  38. matches
  39. this glob pattern will be opened in this edit mode.</p></li></ul></div><p>
  40. Glob pattern syntax is described in
  41. <a href="globs.html" title="Appendix D. Glob Patterns">Appendix D, <i>Glob Patterns</i></a>.
  42. </p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
  43. If an edit mode in the user-specific catalog has the same name as
  44. an edit mode in the system catalog, the version in the user-specific catalog
  45. will override the system default.
  46. </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>