<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.wesnoth.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wildpenguin</id>
	<title>The Battle for Wesnoth Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.wesnoth.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wildpenguin"/>
	<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/Special:Contributions/Wildpenguin"/>
	<updated>2026-04-26T14:19:18Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=28368</id>
		<title>Wesnoth Mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=28368"/>
		<updated>2009-02-27T08:46:31Z</updated>

		<summary type="html">&lt;p&gt;Wildpenguin: Updated for upcoming release.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is a major mode for Emacs which assists in the editing of&lt;br /&gt;
the markup language extensively used in Wesnoth, a turn-based fantasy&lt;br /&gt;
strategy game.  From the Wesnoth Wiki: &amp;quot;The Wesnoth Markup Language&lt;br /&gt;
(WML) is used to code almost everything in Wesnoth, including scenarios,&lt;br /&gt;
units, savefiles, and the user interface layout.&amp;quot; (1)&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is supported under GNU Emacs 21 onwards and (with some&lt;br /&gt;
minor limitations) XEmacs 21.  Wesnoth Mode adds support for syntax&lt;br /&gt;
highlighting, automatic indentation, context-sensitive completion,&lt;br /&gt;
validation and much more when editing WML.&lt;br /&gt;
&lt;br /&gt;
This documentation attempts to provide a comprehensive guide to&lt;br /&gt;
functionality available within Wesnoth Mode 1.3.4, and assumes you are&lt;br /&gt;
familiar with basic usage, terminology and customisation of Emacs.  For&lt;br /&gt;
more information, please refer to the Emacs manual. (2)&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) http://www.wesnoth.org/wiki/ReferenceWML&lt;br /&gt;
 (2) http://www.gnu.org/software/emacs/manual/html_node/emacs/&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
&lt;br /&gt;
To use Wesnoth Mode, add the following to your '.emacs':&lt;br /&gt;
     (add-to-list 'load-path &amp;quot;path/to/wesnoth-mode&amp;quot;)&lt;br /&gt;
     (autoload 'wesnoth-mode &amp;quot;wesnoth-mode&amp;quot; &amp;quot;Major mode for editing WML.&amp;quot; t)&lt;br /&gt;
Optionally adding:&lt;br /&gt;
     (add-to-list 'auto-mode-alist '(&amp;quot;\\.cfg\\'&amp;quot; . wesnoth-mode))&lt;br /&gt;
to automatically load Wesnoth Mode for all files with a .cfg&lt;br /&gt;
extension.&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode can be activated as the current major-mode for a buffer via&lt;br /&gt;
'M-x wesnoth-mode'.&lt;br /&gt;
&lt;br /&gt;
The latest version of Wesnoth Mode along with release notes can be&lt;br /&gt;
found at http://www.wesnoth.org/forum/viewtopic.php?t=13798.&lt;br /&gt;
&lt;br /&gt;
Alternatively, the development version is available using git.  To checkout the latest changes, the following command can be used:&lt;br /&gt;
  git clone git://repo.or.cz/wesnoth-mode.git&lt;br /&gt;
&lt;br /&gt;
==Basic Usage==&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode provides a style of indentation equivalent to&lt;br /&gt;
that provided by 'wmlindent' tool distributed with Wesnoth.&lt;br /&gt;
'TAB' can be used to automatically indent the current line to the&lt;br /&gt;
correct depth.  'TAB' can perform two actions depending on the&lt;br /&gt;
context of point.  When there is an incomplete element immediately&lt;br /&gt;
preceding point, completion will be attempted, otherwise 'TAB' will&lt;br /&gt;
perform indentation.  See [[#Tab Completion|Tab Completion]].&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode will, by default, indent the current line appropriately&lt;br /&gt;
before inserting a newline when 'RET' or 'C-j' is&lt;br /&gt;
used. ('C-j' will also attempt to indent the new line.)&lt;br /&gt;
 &lt;br /&gt;
See [[#Modifying Indentation|Modifying Indentation]] for information on how to customise the behaviour of automatic indentation.&lt;br /&gt;
&lt;br /&gt;
===Navigation===&lt;br /&gt;
&lt;br /&gt;
Built-in commands for navigation are available.  This section describes&lt;br /&gt;
additional or modified navigation commands specific to Wesnoth Mode.&lt;br /&gt;
Next and previous opening elements can be navigated using 'C-M-e'&lt;br /&gt;
and 'C-M-a', respectively.  In each case, point will be positioned&lt;br /&gt;
immediately before the element.  When no more elements are available in&lt;br /&gt;
that direction, the position of point will not change.&lt;br /&gt;
&lt;br /&gt;
Moving to the matching element in a pair or locating the parent element&lt;br /&gt;
(depending on the position of point) can be performed via 'C-c C-o'.&lt;br /&gt;
When point is on the same line as an opening element, such as an opening&lt;br /&gt;
tag or opening preprocessor statement it will be moved to the start of&lt;br /&gt;
the matching closing element.  Otherwise, the jump will position point&lt;br /&gt;
at the beginning of the corresponding opening element.&lt;br /&gt;
&lt;br /&gt;
Structured navigation is available with 'C-M-n' and 'C-M-p'&lt;br /&gt;
providing the ability to move to the next and previous blocks&lt;br /&gt;
(respectively) which are at the same depth as the element where the&lt;br /&gt;
command was invoked.  'C-M-d' will move to the child of the element&lt;br /&gt;
at point and 'C-M-u' moving to the corresponding parent element.&lt;br /&gt;
&lt;br /&gt;
===Editing Extras===&lt;br /&gt;
&lt;br /&gt;
Additional commands have been added to assist editing regions of WML.&lt;br /&gt;
'C-M-k' can be used to kill the element at point up to the&lt;br /&gt;
corresponding closing element, including all contents.  Also, when point&lt;br /&gt;
is at an opening element, the mark can be placed at the end of the&lt;br /&gt;
corresponding closing element using 'C-M-SPC'.&lt;br /&gt;
&lt;br /&gt;
==Inserting Elements==&lt;br /&gt;
&lt;br /&gt;
===Standard Completion===&lt;br /&gt;
&lt;br /&gt;
Tags can be inserted via 'C-c C-t' and alternatively 'M-TAB' (when&lt;br /&gt;
this is not shadowed by the Window Manager, etc.).  This will prompt&lt;br /&gt;
for the tag to add.  The tag entered into the mini-buffer prompt and&lt;br /&gt;
its matching closing tag will be inserted and point positioned between.&lt;br /&gt;
&lt;br /&gt;
Attributes can be inserted via 'C-c C-a'.  The attribute entered at&lt;br /&gt;
the prompt will be inserted along with the '=', with point immediately&lt;br /&gt;
after.&lt;br /&gt;
&lt;br /&gt;
Both tag and attribute completion is context-sensitive.  If an&lt;br /&gt;
element is available in WML and not listed for completion, you may want&lt;br /&gt;
to add it to your 'addition file'.  See [[#Wesnoth Update|Wesnoth Update]] for more&lt;br /&gt;
information.&lt;br /&gt;
&lt;br /&gt;
Macro insertion can be performed via 'C-c C-m'.  Any arguments known&lt;br /&gt;
to be required for the macro will be prompted and inserted in order.&lt;br /&gt;
Insertion will be aborted if no value for an argument is provided.  When&lt;br /&gt;
within a macro definition, the arguments for the current macro are also&lt;br /&gt;
available for completion.  Any project-local or custom macros can be&lt;br /&gt;
made available for completion by opening the file in which they are&lt;br /&gt;
defined. For information on completing project-local macros, see [[#Macro Definitions|Macro Definitions]].&lt;br /&gt;
&lt;br /&gt;
Preprocessor statements are available for insertion via 'C-c C-p'.&lt;br /&gt;
Closing elements for preprocessor statements will be automatically&lt;br /&gt;
inserted where possible, with point positioned between.  Otherwise,&lt;br /&gt;
point will be placed immediately after the inserted text.&lt;br /&gt;
&lt;br /&gt;
===Tab Completion===&lt;br /&gt;
&lt;br /&gt;
Completion can also be performed immediately within the buffer via&lt;br /&gt;
'TAB' on a partial element.  For example:&lt;br /&gt;
     [scenario]&lt;br /&gt;
         vil-!-&lt;br /&gt;
Where '-!-' is the position of point.  Using 'TAB' in the example&lt;br /&gt;
will complete to 'vil' to 'village_gold='.  Tags, macros and&lt;br /&gt;
preprocessor statements can be completed similarly.  When the&lt;br /&gt;
current line does not contain a partially completed element, 'TAB'&lt;br /&gt;
will perform indentation on the current line.&lt;br /&gt;
&lt;br /&gt;
When there is more than one possible completion, a minibuffer prompt&lt;br /&gt;
will be provided, with the partial element entered.  'TAB' can be used&lt;br /&gt;
here to perform completion.  If multiple matches are available,&lt;br /&gt;
completion will be performed up to the smallest common substring with&lt;br /&gt;
further completion available via the minibuffer prompt.  When no matches&lt;br /&gt;
are found for the partial element, completion will not be prompted.&lt;br /&gt;
&lt;br /&gt;
When completing opening preprocessor statements and tags, Wesnoth&lt;br /&gt;
Mode will also attempt to insert a matching closing element if one is&lt;br /&gt;
not already available, acting in much the same way as if the element was&lt;br /&gt;
added via the minibuffer prompt.  However, if an matching closing&lt;br /&gt;
element is available, only the element at point will be completed.&lt;br /&gt;
&lt;br /&gt;
A numeric argument can be provided when performing tab completion of&lt;br /&gt;
opening elements to wrap around the next 'n' blocks.  For example,&lt;br /&gt;
to wrap the completed opening and closing pair around the next three&lt;br /&gt;
blocks, 'C-u 3 TAB' can be used.  Refer to [[#Wrapping Elements|Wrapping Elements]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Wrapping Elements===&lt;br /&gt;
&lt;br /&gt;
When inserting tags and some preprocessor statements, either via their&lt;br /&gt;
respective insertion command or via 'TAB', an optional numeric argument&lt;br /&gt;
can be provided to specify the number of 'blocks' to wrap the element&lt;br /&gt;
around.  For example:&lt;br /&gt;
&lt;br /&gt;
     [multiplayer]&lt;br /&gt;
      -!-[part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [event]&lt;br /&gt;
             ...&lt;br /&gt;
&lt;br /&gt;
Where point is at the position indicated by '-!-'.  A pair of&lt;br /&gt;
'story' tags can be inserted around both existing 'part' tags using&lt;br /&gt;
'C-u 2 C-c C-t story'.  When the number of blocks specified to wrap&lt;br /&gt;
around exceeds the number of blocks available, Wesnoth Mode will only&lt;br /&gt;
wrap around the number of available so that the nesting of elements is&lt;br /&gt;
correct.&lt;br /&gt;
&lt;br /&gt;
===Missing Elements===&lt;br /&gt;
&lt;br /&gt;
Missing closing elements can be inserted using 'C-c C-/'.  By default,&lt;br /&gt;
this will insert the first missing closing element found in the current&lt;br /&gt;
buffer at point.  If all elements appear to be matched or if there is an excess of closing tags, a notification will be displayed and no element will be inserted.&lt;br /&gt;
&lt;br /&gt;
==Validating WML==&lt;br /&gt;
&lt;br /&gt;
===Usage and Capabilities===&lt;br /&gt;
&lt;br /&gt;
Validating WML in the current buffer can be performed using 'C-c C-c'.  A&lt;br /&gt;
summary of all warnings located will be provided in a separate buffer.&lt;br /&gt;
Point can be jumped to the next and previous warning using 'C-c C-f'&lt;br /&gt;
(or 'C-x `') and 'C-c C-b', respectively.  For visibility,&lt;br /&gt;
warnings will be underlined in red by default.  Note: Warning underlines may not be available in XEmacs.&lt;br /&gt;
&lt;br /&gt;
The WML validation built-in to Wesnoth Mode is not intended to&lt;br /&gt;
be an alternative to tools such as `wmllint', but may often be a&lt;br /&gt;
convenient substitute while editing WML.&lt;br /&gt;
&lt;br /&gt;
The following conditions can be tested in Wesnoth Mode:&lt;br /&gt;
* Correct nesting of tags and preprocessor statements&lt;br /&gt;
* Known macro definitions (1)&lt;br /&gt;
* Availability of elements within the given context&lt;br /&gt;
* Arguments are given to preprocessor statements when required&lt;br /&gt;
* Attributes have a value assigned&lt;br /&gt;
* Corresponding FOREACH..NEXT pairs&lt;br /&gt;
&lt;br /&gt;
WML validation is specific to the version of WML known by Wesnoth Mode. See [[#Wesnoth Update|Wesnoth Update]] for more information.&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) [[#Macro Definitions|Macro Definitions]]&lt;br /&gt;
&lt;br /&gt;
==Customisation==&lt;br /&gt;
&lt;br /&gt;
===Modifying Indentation===&lt;br /&gt;
&lt;br /&gt;
The style of indentation can be customised using&lt;br /&gt;
'wesnoth-indent-savefile'.  The default value is 'non-nil', which&lt;br /&gt;
results in all children being indented a level deeper than their&lt;br /&gt;
parent.  When set to 'nil', children will be indented to the same level&lt;br /&gt;
as their parent element.  This option is provided only for +consistency when editing (very) old WML.  It is recommended that this be non-nil for all new WML.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-indent-preprocessor-bol' controls how preprocessor&lt;br /&gt;
statements should be indented.  If non-nil, all preprocessor statements&lt;br /&gt;
will be indented to the beginning of the line.  Otherwise, preprocessor&lt;br /&gt;
statements will be indented as to the level indicated by its context.&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode will attempt indentation of the current line&lt;br /&gt;
and create a newline and when 'RET' or 'C-j' are used.&lt;br /&gt;
'wesnoth-auto-indent-flag' controls whether Wesnoth Mode will attempt&lt;br /&gt;
to indent the current line automatically.  Setting this to 'nil' will&lt;br /&gt;
prevent automatic indentation.  Note that this does not affect the&lt;br /&gt;
behaviour of 'C-j' performing indentation following the newline; this&lt;br /&gt;
only determines whether indentation will be automatically performed on&lt;br /&gt;
the current line.&lt;br /&gt;
&lt;br /&gt;
The following can be used to change 'RET' to automatically indent the&lt;br /&gt;
newline:&lt;br /&gt;
&lt;br /&gt;
 (add-hook 'wesnoth-mode-hook&lt;br /&gt;
   '(lambda ()&lt;br /&gt;
     (define-key wesnoth-mode-map (kbd &amp;quot;C-m&amp;quot;)&lt;br /&gt;
     'wesnoth-newline-and-indent)))&lt;br /&gt;
&lt;br /&gt;
'wesnoth-base-indent' controls the depth of indentation for each&lt;br /&gt;
level.  Its value should be an integer.  This is set to '4' by default,&lt;br /&gt;
which is the convention used when indenting WML.&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode will use spaces for indentation.  Tabs can instead be used with the following:&lt;br /&gt;
&lt;br /&gt;
 (add-hook 'wesnoth-mode-hook&lt;br /&gt;
   '(lambda ()&lt;br /&gt;
     (setq indent-tabs-mode t&lt;br /&gt;
           tab-width wesnoth-base-indent)))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'wesnoth-warning-face' is the face used to display the overlay for&lt;br /&gt;
warnings detected when checking WML (See [[#Validating WML|Validating WML]]).  By&lt;br /&gt;
default this is a red underline.  Note: use of this face may not be supported&lt;br /&gt;
under XEmacs.&lt;br /&gt;
&lt;br /&gt;
===Wesnoth Update===&lt;br /&gt;
&lt;br /&gt;
Wesnoth Update is an extension to Wesnoth Mode which retrieves information regarding valid WML structure using WML included with Wesnoth.  To update this information, two variables need to be set appropriately:&lt;br /&gt;
'wesnoth-root-directory' and 'wesnoth-update-output-directory'.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-root-directory' should be the path to the root directory of&lt;br /&gt;
a Wesnoth installation or Wesnoth source code.  Wesnoth Update will&lt;br /&gt;
search recursively in this directory for WML, using the information&lt;br /&gt;
found to provide context-sensitive completion and WML validation.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-update-output-directory' specifies the path to store the&lt;br /&gt;
WML data found.  This path should be within the 'load-path', and&lt;br /&gt;
preferably, in the same directory as Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 (setq wesnoth-root-directory &amp;quot;/usr/local/share/wesnoth/&amp;quot;&lt;br /&gt;
       wesnoth-update-output-directory &amp;quot;~/.emacs.d/wesnoth-mode/&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Once set, 'M-x wesnoth-update' will generate and load a new cache of&lt;br /&gt;
WML data ready for use for the current and future sessions.  Note:&lt;br /&gt;
'wesnoth-update' may take some time to run.&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode 1.3.6 uses WML data retrieved from Wesnoth 1.5.11, by default.&lt;br /&gt;
&lt;br /&gt;
===Addition File===&lt;br /&gt;
'wesnoth-addition-file' specifies the `addition file' to use.  An&lt;br /&gt;
addition file is an outline of a valid WML structure which is processed to provide more comprehensive completion of validation by providing access to element which may not have been available when running [[#Wesnoth Update|Wesnoth Update]]&lt;br /&gt;
&lt;br /&gt;
The value of 'wesnoth-addition-file' shield be set as the path to a suitable addition file.  A sample addition file is included with Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
For example, the following could be used to specify an addition file:&lt;br /&gt;
&lt;br /&gt;
 (setq wesnoth-addition-file&lt;br /&gt;
      &amp;quot;~/.emacs.d/wesnoth-mode/wesnoth-wml-additions.cfg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
The addition file is read and information regarding WML structure&lt;br /&gt;
updated any time WML information is required.  Therefore, no further&lt;br /&gt;
action is required to use the updated WML data once any changes to the&lt;br /&gt;
addition file are saved to disk.&lt;br /&gt;
&lt;br /&gt;
===Macro Definitions===&lt;br /&gt;
&lt;br /&gt;
While built-in macros are always available, local macro definitions are&lt;br /&gt;
automatically scanned and made known to Wesnoth Mode for each WML file&lt;br /&gt;
which is loaded in the session. 'C-c C-u' can be used to update the&lt;br /&gt;
known macro definitions for any buffer which has since been modified.&lt;br /&gt;
(Note that this is not required when the macro is defined in the WML&lt;br /&gt;
file currently being edited as such definitions will be automatically&lt;br /&gt;
updated when needed.)  'C-u C-c C-u' can be used to clear known local&lt;br /&gt;
macro definitions.&lt;/div&gt;</summary>
		<author><name>Wildpenguin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=28207</id>
		<title>Wesnoth Mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=28207"/>
		<updated>2009-02-09T01:54:58Z</updated>

		<summary type="html">&lt;p&gt;Wildpenguin: Fix incorrect formatting in example code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is a major mode for Emacs which assists in the editing of&lt;br /&gt;
the markup language extensively used in Wesnoth, a turn-based fantasy&lt;br /&gt;
strategy game.  From the Wesnoth Wiki: &amp;quot;The Wesnoth Markup Language&lt;br /&gt;
(WML) is used to code almost everything in Wesnoth, including scenarios,&lt;br /&gt;
units, savefiles, and the user interface layout.&amp;quot; (1)&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is supported under GNU Emacs 21 onwards and (with some&lt;br /&gt;
minor limitations) XEmacs 21.  Wesnoth Mode adds support for syntax&lt;br /&gt;
highlighting, automatic indentation, context-sensitive completion,&lt;br /&gt;
checking and much more when editing WML.&lt;br /&gt;
&lt;br /&gt;
This documentation attempts to provide a comprehensive guide to&lt;br /&gt;
functionality available within Wesnoth Mode 1.3.4, and assumes you are&lt;br /&gt;
familiar with basic usage, terminology and customisation of Emacs.  For&lt;br /&gt;
more information, please refer to the Emacs manual. (2)&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) http://www.wesnoth.org/wiki/ReferenceWML&lt;br /&gt;
 (2) http://www.gnu.org/software/emacs/manual/html_node/emacs/&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
&lt;br /&gt;
To use Wesnoth Mode, add the following to your '.emacs':&lt;br /&gt;
     (add-to-list 'load-path &amp;quot;path/to/wesnoth-mode&amp;quot;)&lt;br /&gt;
     (autoload 'wesnoth-mode &amp;quot;wesnoth-mode&amp;quot; &amp;quot;Major mode for editing WML.&amp;quot; t)&lt;br /&gt;
Optionally adding:&lt;br /&gt;
     (add-to-list 'auto-mode-alist '(&amp;quot;\\.cfg\\'&amp;quot; . wesnoth-mode))&lt;br /&gt;
to automatically load Wesnoth Mode for all files with a .cfg&lt;br /&gt;
extension.&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode can be activated as the current major-mode for a buffer via&lt;br /&gt;
'M-x wesnoth-mode'.&lt;br /&gt;
&lt;br /&gt;
The latest version of Wesnoth Mode along with release notes can be&lt;br /&gt;
found at http://www.wesnoth.org/forum/viewtopic.php?t=13798.&lt;br /&gt;
&lt;br /&gt;
==Basic Usage==&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode provides a style of indentation equivalent to&lt;br /&gt;
that provided by the 'wmlindent' tool included with Wesnoth.&lt;br /&gt;
'TAB' can be used to indent the current line manually.  Wesnoth Mode&lt;br /&gt;
will, by default, indent the current line appropriately before inserting&lt;br /&gt;
a newline when 'RET' or 'C-j' is used. ('C-j' will also&lt;br /&gt;
attempt to indent the new line.)&lt;br /&gt;
 &lt;br /&gt;
See [[#Modifying Indentation|Modifying Indentation]] for information on how to customise the behaviour of automatic indentation.&lt;br /&gt;
&lt;br /&gt;
'TAB' performs two actions depending on the context of point.  When&lt;br /&gt;
there is an incomplete element immediately preceeding point, completion&lt;br /&gt;
will be attempted, otherwise 'TAB' will perform indentation.  See&lt;br /&gt;
[[#Tab-Completion|Tab-Completion]].&lt;br /&gt;
&lt;br /&gt;
===Navigation===&lt;br /&gt;
&lt;br /&gt;
Next and previous opening elements can be navigated using 'C-M-e'&lt;br /&gt;
and 'C-M-a', respectively.  In each case, point will be positioned&lt;br /&gt;
immediately before the element.  When no more elements are available in&lt;br /&gt;
that direction, point will not move.&lt;br /&gt;
&lt;br /&gt;
Moving to the matching element in a pair or locating the parent element&lt;br /&gt;
(depending on the position of point) can be performed via 'C-c C-o'.&lt;br /&gt;
When point is on the same line as an opening element, such as an opening&lt;br /&gt;
tag or opening preprocessor statement it will be moved to the start of&lt;br /&gt;
the matching closing element.  Otherwise, the jump will position point&lt;br /&gt;
at the beginning of the corresponding opening element.&lt;br /&gt;
&lt;br /&gt;
==Inserting Elements==&lt;br /&gt;
&lt;br /&gt;
===Standard Completion===&lt;br /&gt;
&lt;br /&gt;
Tags can be inserted via 'C-c C-t' and alternatively 'M-TAB' (when&lt;br /&gt;
this is not shadowed by the Window Manager, etc.).  This will prompt&lt;br /&gt;
for the tag to add.  The tag entered into the mini-buffer prompt and&lt;br /&gt;
its matching closing tag will be inserted and point positioned between.&lt;br /&gt;
&lt;br /&gt;
Attributes can be inserted via 'C-c C-a'.  The attribute entered at&lt;br /&gt;
the prompt will be inserted along with the '=', with point immediately&lt;br /&gt;
after.&lt;br /&gt;
&lt;br /&gt;
Both tag and attribute completion is context-sensitive.  If an&lt;br /&gt;
element is available in WML and not listed for completion, you may want&lt;br /&gt;
to add it to your 'addition file'.  See [[#Wesnoth Update|Wesnoth Update]] for more&lt;br /&gt;
information.&lt;br /&gt;
&lt;br /&gt;
Macro insertion can be performed via 'C-c C-m'.  Any arguments known&lt;br /&gt;
to be required for the macro will be prompted and inserted in order.&lt;br /&gt;
Insertion will be aborted if no value for an argument is provided.  When&lt;br /&gt;
within a macro definition, the arguments for the current macro are also&lt;br /&gt;
available for completion.  Any project-local or custom macros can be&lt;br /&gt;
made available for completion by opening the file in which they are&lt;br /&gt;
defined. For information on completing project-local macros, see [[#Macro Definitions|Macro Definitions]].&lt;br /&gt;
&lt;br /&gt;
Preprocessor statements are available for insertion via 'C-c C-p'.&lt;br /&gt;
Closing elements for preprocessor statements will be automatically&lt;br /&gt;
inserted where possible, with point positioned between.  Otherwise,&lt;br /&gt;
point will be placed immediately after the inserted text.&lt;br /&gt;
&lt;br /&gt;
===Tab-Completion===&lt;br /&gt;
&lt;br /&gt;
Completion can also be performed immediately within the buffer via&lt;br /&gt;
'TAB' on a partial element.  For example:&lt;br /&gt;
     [scenario]&lt;br /&gt;
         vil-!-&lt;br /&gt;
Where '-!-' is the position of point.  Using 'TAB' in the example&lt;br /&gt;
will complete to 'vil' to 'village_gold='.  Tags, macros and&lt;br /&gt;
preprocessor statements can be completed similarly.  When the&lt;br /&gt;
current line does not contain a partially completed element, 'TAB'&lt;br /&gt;
will perform indentation on the current line.&lt;br /&gt;
&lt;br /&gt;
When there is more than one possible completion, a minibuffer prompt&lt;br /&gt;
will be provided, with the partial element entered.  'TAB' can be used&lt;br /&gt;
here to perform completion.  If multiple matches are available,&lt;br /&gt;
completion will be performed up to the smallest common substring with&lt;br /&gt;
further completion available via the minubuffer prompt.  When no matches&lt;br /&gt;
are found for the partial element, completion will not be prompted.&lt;br /&gt;
&lt;br /&gt;
When completing opening preprocessor statements and tags, Wesnoth&lt;br /&gt;
Mode will also attempt to insert a matching closing element if one is&lt;br /&gt;
not already available, acting in much the same way as if the element was&lt;br /&gt;
added via the minibuffer prompt.  However, if an matching closing&lt;br /&gt;
element is available, only the element at point will be completed.&lt;br /&gt;
&lt;br /&gt;
A numeric argument can be provided when performing tab-completion of&lt;br /&gt;
opening elements to wrap around the next 'n' blocks.  For example,&lt;br /&gt;
to wrap the completed opening and closing pair around the next three&lt;br /&gt;
blocks, 'C-u 3 TAB' can be used.  Refer to [[#Wrapping Elements|Wrapping Elements]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Wrapping Elements===&lt;br /&gt;
&lt;br /&gt;
When inserting tags and some preprocessor statements, either via their&lt;br /&gt;
respective insertion command or via 'TAB', an optional numeric argument&lt;br /&gt;
can be provided to specify the number of 'blocks' to wrap the element&lt;br /&gt;
around.  For example:&lt;br /&gt;
&lt;br /&gt;
     [multiplayer]&lt;br /&gt;
      -!-[part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [event]&lt;br /&gt;
             ...&lt;br /&gt;
&lt;br /&gt;
Where point is at the position indicated by '-!-'.  A pair of&lt;br /&gt;
'story' tags can be inserted around both existing 'part' tags using&lt;br /&gt;
'C-u 2 C-c C-t story'.  When the number of blocks specified to wrap&lt;br /&gt;
around exceeds the number of blocks available, Wesnoth Mode will only&lt;br /&gt;
wrap around the number of available so that the nesting of elements is&lt;br /&gt;
correct.&lt;br /&gt;
&lt;br /&gt;
===Missing Elements===&lt;br /&gt;
&lt;br /&gt;
Missing closing elements can be inserted using 'C-c C-/'.  By default,&lt;br /&gt;
this will insert the first missing closing element found in the current&lt;br /&gt;
buffer at point.  If all elements appear to be matched or if there is an excess of closing tags, a notification will be displayed and no element will be inserted.&lt;br /&gt;
&lt;br /&gt;
==Checking WML==&lt;br /&gt;
&lt;br /&gt;
===Usage and Capabilities===&lt;br /&gt;
&lt;br /&gt;
Checking of the current buffer can be performed using 'C-c C-c'.  A&lt;br /&gt;
summary of all warnings located will be provided in a separate buffer.&lt;br /&gt;
Point can be jumped to the next and previous warning using 'C-c C-f'&lt;br /&gt;
(or 'C-x `') and 'C-c C-b', respectively.  For visibility,&lt;br /&gt;
warnings will be underlined in red by default.  Note: Warning underlines may not be available in XEmacs.&lt;br /&gt;
&lt;br /&gt;
The WML checking built-in to Wesnoth Mode is not intended to&lt;br /&gt;
be an alternative to tools such as `wmllint', but may often be a&lt;br /&gt;
convenient substitute while editing WML.&lt;br /&gt;
&lt;br /&gt;
The following conditions can be detected by WML checking in Wesnoth&lt;br /&gt;
Mode:&lt;br /&gt;
* Correct nesting of tags and preprocessor statements&lt;br /&gt;
* Known macro definitions (1)&lt;br /&gt;
* Availability of elements within the given context&lt;br /&gt;
* Arguments are given to preprocessor statements when required&lt;br /&gt;
* Attributes have a value assigned&lt;br /&gt;
* Corresponding FOREACH..NEXT pairs&lt;br /&gt;
&lt;br /&gt;
WML checking is specific to the version of WML known by Wesnoth Mode. See [[#Wesnoth Update|Wesnoth Update]] for more information.&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) [[#Macro Definitions|Macro Definitions]]&lt;br /&gt;
&lt;br /&gt;
==Customisation==&lt;br /&gt;
&lt;br /&gt;
===Modifying Indentation===&lt;br /&gt;
&lt;br /&gt;
The style of indentation can be customised using&lt;br /&gt;
'wesnoth-indent-savefile'.  The default value is 'non-nil', which&lt;br /&gt;
results in all children being indented a level deeper than their&lt;br /&gt;
parent.  When set to 'nil', children will be indented to the same level&lt;br /&gt;
as their parent element.  This option is provided only for +consistency when editing (very) old WML.  It is recommended that this be non-nil for all new WML.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-indent-preprocessor-bol' controls how preprocessor&lt;br /&gt;
statements should be indented.  If non-nil, all preprocessor statements&lt;br /&gt;
will be indented to the beginning of the line.  Otherwise, preprocessor&lt;br /&gt;
statements will be indented as to the level indicated by its context.&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode will attempt indentation of the current line&lt;br /&gt;
and create a newline and when 'RET' or 'C-j' are used.&lt;br /&gt;
'wesnoth-auto-indent-flag' controls whether Wesnoth Mode will attempt&lt;br /&gt;
to indent the current line automatically.  Setting this to 'nil' will&lt;br /&gt;
prevent automatic indentation.  Note that this does not affect the&lt;br /&gt;
behaviour of 'C-j' performing indentation following the newline; this&lt;br /&gt;
only determines whether indentation will be automatically performed on&lt;br /&gt;
the current line.&lt;br /&gt;
&lt;br /&gt;
The following can be used to change 'RET' to automatically indent the&lt;br /&gt;
newline:&lt;br /&gt;
&lt;br /&gt;
 (add-hook 'wesnoth-mode-hook&lt;br /&gt;
   '(lambda ()&lt;br /&gt;
     (define-key wesnoth-mode-map (kbd &amp;quot;C-m&amp;quot;)&lt;br /&gt;
     'wesnoth-newline-and-indent)))&lt;br /&gt;
&lt;br /&gt;
'wesnoth-base-indent' controls the depth of indentation for each&lt;br /&gt;
level.  Its value should be an integer.  This is set to '4' by default,&lt;br /&gt;
which is the convention used when indenting WML.&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode will use spaces for indentation.  Tabs can instead be used with the following:&lt;br /&gt;
&lt;br /&gt;
 (add-hook 'wesnoth-mode-hook&lt;br /&gt;
   '(lambda ()&lt;br /&gt;
     (setq indent-tabs-mode t&lt;br /&gt;
           tab-width wesnoth-base-indent)))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'wesnoth-warning-face' is the face used to display the overlay for&lt;br /&gt;
warnings detected when checking WML (See [[#Checking WML|Checking WML]]).  By&lt;br /&gt;
default this is a red underline.  Note: use of this face may not be supported&lt;br /&gt;
under XEmacs.&lt;br /&gt;
&lt;br /&gt;
===Wesnoth Update===&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode uses WML as in Wesnoth 1.5.6, but the version of WML used can be changed using Wesnoth Update.  Wesnoth Update controls the known WML data for Wesnoth Mode.  To update this information, two variables need to be set appropriately:&lt;br /&gt;
'wesnoth-root-directory' and 'wesnoth-update-output-directory'.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-root-directory' should be the path to the root directory of&lt;br /&gt;
a Wesnoth installation or Wesnoth source code.  Wesnoth Update will&lt;br /&gt;
search recursively in this directory for WML, using the information&lt;br /&gt;
found to provide context-sensitive completion and WML checking.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-update-output-directory' specifies the path to store the&lt;br /&gt;
WML data found.  This path should be within the 'load-path', and&lt;br /&gt;
preferably, in the same directory as Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 (setq wesnoth-root-directory &amp;quot;/usr/local/share/wesnoth/&amp;quot;&lt;br /&gt;
       wesnoth-update-output-directory &amp;quot;~/.emacs.d/wesnoth-mode/&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Once set, 'M-x wesnoth-update' will generate and load a new cache of&lt;br /&gt;
WML data ready for use for the current and future sessions.  Note:&lt;br /&gt;
'wesnoth-update' may take some time to run.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-addition-file' specifies the `addition file' to use.  An&lt;br /&gt;
addition file is an outline of a valid WML file which is processed for&lt;br /&gt;
additional element data which may not have been detected when running&lt;br /&gt;
'wesnoth-update'.  This should be set as the path to a suitable&lt;br /&gt;
addition file.  A sample addition file is included with Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
The addition data is read from the file and updated any time tag&lt;br /&gt;
information is required, therefore no action needs to be taken to adjust&lt;br /&gt;
tag data other than saving the addition file when modified.&lt;br /&gt;
&lt;br /&gt;
For example, the following could be used to specify an addition file:&lt;br /&gt;
&lt;br /&gt;
 (setq wesnoth-addition-file&lt;br /&gt;
      &amp;quot;~/.emacs.d/wesnoth-mode/wesnoth-wml-additions.cfg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Macro Definitions===&lt;br /&gt;
&lt;br /&gt;
While built-in macros are always available, local macro definitions are&lt;br /&gt;
automatically scanned and made known to Wesnoth Mode for each WML file&lt;br /&gt;
which is loaded in the session. 'C-c C-u' can be used to update the&lt;br /&gt;
known macro definitions for any buffer which has since been modified.&lt;br /&gt;
(Note that this is not required when the macro is defined in the WML&lt;br /&gt;
file currently being edited as such definitions will be automatically&lt;br /&gt;
updated when needed.)  'C-u C-c C-u' can be used to clear known local&lt;br /&gt;
macro definitions.&lt;/div&gt;</summary>
		<author><name>Wildpenguin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27874</id>
		<title>Wesnoth Mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27874"/>
		<updated>2009-01-04T03:05:31Z</updated>

		<summary type="html">&lt;p&gt;Wildpenguin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is a major mode for Emacs which assists in the editing of&lt;br /&gt;
the markup language extensively used in Wesnoth, a turn-based fantasy&lt;br /&gt;
strategy game.  From the Wesnoth Wiki: &amp;quot;The Wesnoth Markup Language&lt;br /&gt;
(WML) is used to code almost everything in Wesnoth, including scenarios,&lt;br /&gt;
units, savefiles, and the user interface layout.&amp;quot; (1)&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is supported under GNU Emacs 21 onwards and (with some&lt;br /&gt;
minor limitations) XEmacs 21.  Wesnoth Mode adds support for syntax&lt;br /&gt;
highlighting, automatic indentation, context-sensitive completion,&lt;br /&gt;
checking and much more when editing WML.&lt;br /&gt;
&lt;br /&gt;
This documentation attempts to provide a comprehensive guide to&lt;br /&gt;
functionality available within Wesnoth Mode 1.3.4, and assumes you are&lt;br /&gt;
familiar with basic usage, terminology and customisation of Emacs.  For&lt;br /&gt;
more information, please refer to the Emacs manual. (2)&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) http://www.wesnoth.org/wiki/ReferenceWML&lt;br /&gt;
 (2) http://www.gnu.org/software/emacs/manual/html_node/emacs/&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
&lt;br /&gt;
To use Wesnoth Mode, add the following to your '.emacs':&lt;br /&gt;
     (add-to-list 'load-path &amp;quot;path/to/wesnoth-mode&amp;quot;)&lt;br /&gt;
     (autoload 'wesnoth-mode &amp;quot;wesnoth-mode&amp;quot; &amp;quot;Major mode for editing WML.&amp;quot; t)&lt;br /&gt;
Optionally adding:&lt;br /&gt;
     (add-to-list 'auto-mode-alist '(&amp;quot;\\.cfg\\'&amp;quot; . wesnoth-mode))&lt;br /&gt;
to automatically load Wesnoth Mode for all files with a .cfg&lt;br /&gt;
extension.&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode can be activated as the current major-mode for a buffer via&lt;br /&gt;
'M-x wesnoth-mode'.&lt;br /&gt;
&lt;br /&gt;
The latest version of Wesnoth Mode along with release notes can be&lt;br /&gt;
found at http://www.wesnoth.org/forum/viewtopic.php?t=13798.&lt;br /&gt;
&lt;br /&gt;
==Basic Usage==&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode provides a style of indentation equivalent to&lt;br /&gt;
that provided by the 'wmlindent' tool included with Wesnoth.&lt;br /&gt;
'TAB' can be used to indent the current line manually.  Wesnoth Mode&lt;br /&gt;
will, by default, indent the current line appropriately before inserting&lt;br /&gt;
a newline when 'RET' or 'C-j' is used. ('C-j' will also&lt;br /&gt;
attempt to indent the new line.)&lt;br /&gt;
 &lt;br /&gt;
See [[#Modifying Indentation|Modifying Indentation]] for information on how to customise the behaviour of automatic indentation.&lt;br /&gt;
&lt;br /&gt;
'TAB' performs two actions depending on the context of point.  When&lt;br /&gt;
there is an incomplete element immediately preceeding point, completion&lt;br /&gt;
will be attempted, otherwise 'TAB' will perform indentation.  See&lt;br /&gt;
[[#Tab-Completion|Tab-Completion]].&lt;br /&gt;
&lt;br /&gt;
===Navigation===&lt;br /&gt;
&lt;br /&gt;
Next and previous opening elements can be navigated using 'C-M-e'&lt;br /&gt;
and 'C-M-a', respectively.  In each case, point will be positioned&lt;br /&gt;
immediately before the element.  When no more elements are available in&lt;br /&gt;
that direction, point will not move.&lt;br /&gt;
&lt;br /&gt;
Moving to the matching element in a pair or locating the parent element&lt;br /&gt;
(depending on the position of point) can be performed via 'C-c C-o'.&lt;br /&gt;
When point is on the same line as an opening element, such as an opening&lt;br /&gt;
tag or opening preprocessor statement it will be moved to the start of&lt;br /&gt;
the matching closing element.  Otherwise, the jump will position point&lt;br /&gt;
at the beginning of the corresponding opening element.&lt;br /&gt;
&lt;br /&gt;
==Inserting Elements==&lt;br /&gt;
&lt;br /&gt;
===Standard Completion===&lt;br /&gt;
&lt;br /&gt;
Tags can be inserted via 'C-c C-t' and alternatively 'M-TAB' (when&lt;br /&gt;
this is not shadowed by the Window Manager, etc.).  This will prompt&lt;br /&gt;
for the tag to add.  The tag entered into the mini-buffer prompt and&lt;br /&gt;
its matching closing tag will be inserted and point positioned between.&lt;br /&gt;
&lt;br /&gt;
Attributes can be inserted via 'C-c C-a'.  The attribute entered at&lt;br /&gt;
the prompt will be inserted along with the '=', with point immediately&lt;br /&gt;
after.&lt;br /&gt;
&lt;br /&gt;
Both tag and attribute completion is context-sensitive.  If an&lt;br /&gt;
element is available in WML and not listed for completion, you may want&lt;br /&gt;
to add it to your 'addition file'.  See [[#Wesnoth Update|Wesnoth Update]] for more&lt;br /&gt;
information.&lt;br /&gt;
&lt;br /&gt;
Macro insertion can be performed via 'C-c C-m'.  Any arguments known&lt;br /&gt;
to be required for the macro will be prompted and inserted in order.&lt;br /&gt;
Insertion will be aborted if no value for an argument is provided.  When&lt;br /&gt;
within a macro definition, the arguments for the current macro are also&lt;br /&gt;
available for completion.  Any project-local or custom macros can be&lt;br /&gt;
made available for completion by opening the file in which they are&lt;br /&gt;
defined. For information on completing project-local macros, see [[#Macro Definitions|Macro Definitions]].&lt;br /&gt;
&lt;br /&gt;
Preprocessor statements are available for insertion via 'C-c C-p'.&lt;br /&gt;
Closing elements for preprocessor statements will be automatically&lt;br /&gt;
inserted where possible, with point positioned between.  Otherwise,&lt;br /&gt;
point will be placed immediately after the inserted text.&lt;br /&gt;
&lt;br /&gt;
===Tab-Completion===&lt;br /&gt;
&lt;br /&gt;
Completion can also be performed immediately within the buffer via&lt;br /&gt;
'TAB' on a partial element.  For example:&lt;br /&gt;
     [scenario]&lt;br /&gt;
         vil-!-&lt;br /&gt;
Where '-!-' is the position of point.  Using 'TAB' in the example&lt;br /&gt;
will complete to 'vil' to 'village_gold='.  Tags, macros and&lt;br /&gt;
preprocessor statements can be completed similarly.  When the&lt;br /&gt;
current line does not contain a partially completed element, 'TAB'&lt;br /&gt;
will perform indentation on the current line.&lt;br /&gt;
&lt;br /&gt;
When there is more than one possible completion, a minibuffer prompt&lt;br /&gt;
will be provided, with the partial element entered.  'TAB' can be used&lt;br /&gt;
here to perform completion.  If multiple matches are available,&lt;br /&gt;
completion will be performed up to the smallest common substring with&lt;br /&gt;
further completion available via the minubuffer prompt.  When no matches&lt;br /&gt;
are found for the partial element, completion will not be prompted.&lt;br /&gt;
&lt;br /&gt;
When completing opening preprocessor statements and tags, Wesnoth&lt;br /&gt;
Mode will also attempt to insert a matching closing element if one is&lt;br /&gt;
not already available, acting in much the same way as if the element was&lt;br /&gt;
added via the minibuffer prompt.  However, if an matching closing&lt;br /&gt;
element is available, only the element at point will be completed.&lt;br /&gt;
&lt;br /&gt;
A numeric argument can be provided when performing tab-completion of&lt;br /&gt;
opening elements to wrap around the next 'n' blocks.  For example,&lt;br /&gt;
to wrap the completed opening and closing pair around the next three&lt;br /&gt;
blocks, 'C-u 3 TAB' can be used.  Refer to [[#Wrapping Elements|Wrapping Elements]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Wrapping Elements===&lt;br /&gt;
&lt;br /&gt;
When inserting tags and some preprocessor statements, either via their&lt;br /&gt;
respective insertion command or via 'TAB', an optional numeric argument&lt;br /&gt;
can be provided to specify the number of 'blocks' to wrap the element&lt;br /&gt;
around.  For example:&lt;br /&gt;
&lt;br /&gt;
     [multiplayer]&lt;br /&gt;
      -!-[part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [event]&lt;br /&gt;
             ...&lt;br /&gt;
&lt;br /&gt;
Where point is at the position indicated by '-!-'.  A pair of&lt;br /&gt;
'story' tags can be inserted around both existing 'part' tags using&lt;br /&gt;
'C-u 2 C-c C-t story'.  When the number of blocks specified to wrap&lt;br /&gt;
around exceeds the number of blocks available, Wesnoth Mode will only&lt;br /&gt;
wrap around the number of available so that the nesting of elements is&lt;br /&gt;
correct.&lt;br /&gt;
&lt;br /&gt;
===Missing Elements===&lt;br /&gt;
&lt;br /&gt;
Missing closing elements can be inserted using 'C-c C-/'.  By default,&lt;br /&gt;
this will insert the first missing closing element found in the current&lt;br /&gt;
buffer at point.  If all elements appear to be matched or if there is an excess of closing tags, a notification will be displayed and no element will be inserted.&lt;br /&gt;
&lt;br /&gt;
==Checking WML==&lt;br /&gt;
&lt;br /&gt;
===Usage and Capabilities===&lt;br /&gt;
&lt;br /&gt;
Checking of the current buffer can be performed using 'C-c C-c'.  A&lt;br /&gt;
summary of all warnings located will be provided in a separate buffer.&lt;br /&gt;
Point can be jumped to the next and previous warning using 'C-c C-f'&lt;br /&gt;
(or 'C-x `') and 'C-c C-b', respectively.  For visibility,&lt;br /&gt;
warnings will be underlined in red by default.  Note: Warning underlines may not be available in XEmacs.&lt;br /&gt;
&lt;br /&gt;
The WML checking built-in to Wesnoth Mode is not intended to&lt;br /&gt;
be an alternative to tools such as `wmllint', but may often be a&lt;br /&gt;
convenient substitute while editing WML.&lt;br /&gt;
&lt;br /&gt;
The following conditions can be detected by WML checking in Wesnoth&lt;br /&gt;
Mode:&lt;br /&gt;
* Correct nesting of tags and preprocessor statements&lt;br /&gt;
* Known macro definitions (1)&lt;br /&gt;
* Availability of elements within the given context&lt;br /&gt;
* Arguments are given to preprocessor statements when required&lt;br /&gt;
* Attributes have a value assigned&lt;br /&gt;
* Corresponding FOREACH..NEXT pairs&lt;br /&gt;
&lt;br /&gt;
WML checking is specific to the version of WML known by Wesnoth Mode. See [[#Wesnoth Update|Wesnoth Update]] for more information.&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) [[#Macro Definitions|Macro Definitions]]&lt;br /&gt;
&lt;br /&gt;
==Customisation==&lt;br /&gt;
&lt;br /&gt;
===Modifying Indentation===&lt;br /&gt;
&lt;br /&gt;
The style of indentation can be customised using&lt;br /&gt;
'wesnoth-indent-savefile'.  The default value is 'non-nil', which&lt;br /&gt;
results in all children being indented a level deeper than their&lt;br /&gt;
parent.  When set to 'nil', children will be indented to the same level&lt;br /&gt;
as their parent element.  This option is provided only for +consistency when editing (very) old WML.  It is recommended that this be non-nil for all new WML.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-indent-preprocessor-bol' controls how preprocessor&lt;br /&gt;
statements should be indented.  If non-nil, all preprocessor statements&lt;br /&gt;
will be indented to the beginning of the line.  Otherwise, preprocessor&lt;br /&gt;
statements will be indented as to the level indicated by its context.&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode will attempt indentation of the current line&lt;br /&gt;
and create a newline and when 'RET' or 'C-j' are used.&lt;br /&gt;
'wesnoth-auto-indent-flag' controls whether Wesnoth Mode will attempt&lt;br /&gt;
to indent the current line automatically.  Setting this to 'nil' will&lt;br /&gt;
prevent automatic indentation.  Note that this does not affect the&lt;br /&gt;
behaviour of 'C-j' performing indentation following the newline; this&lt;br /&gt;
only determines whether indentation will be automatically performed on&lt;br /&gt;
the current line.&lt;br /&gt;
&lt;br /&gt;
The following can be used to change 'RET' to automatically indent the&lt;br /&gt;
newline:&lt;br /&gt;
&lt;br /&gt;
 (add-hook 'wesnoth-mode-hook&lt;br /&gt;
   '(lambda ()&lt;br /&gt;
     (define-key wesnoth-mode-map (kbd ``C-m'')&lt;br /&gt;
     'wesnoth-newline-and-indent)))&lt;br /&gt;
&lt;br /&gt;
'wesnoth-base-indent' controls the depth of indentation for each&lt;br /&gt;
level.  Its value should be an integer.  This is set to '4' by default,&lt;br /&gt;
which is the convention used when indenting WML.&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode will use spaces for indentation.  Tabs can instead be used with the following:&lt;br /&gt;
&lt;br /&gt;
 (add-hook 'wesnoth-mode-hook&lt;br /&gt;
   '(lambda ()&lt;br /&gt;
     (setq indent-tabs-mode t&lt;br /&gt;
           tab-width wesnoth-base-indent)))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'wesnoth-warning-face' is the face used to display the overlay for&lt;br /&gt;
warnings detected when checking WML (See [[#Checking WML|Checking WML]]).  By&lt;br /&gt;
default this is a red underline.  Note: use of this face may not be supported&lt;br /&gt;
under XEmacs.&lt;br /&gt;
&lt;br /&gt;
===Wesnoth Update===&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode uses WML as in Wesnoth 1.5.6, but the version of WML used can be changed using Wesnoth Update.  Wesnoth Update controls the known WML data for Wesnoth Mode.  To update this information, two variables need to be set appropriately:&lt;br /&gt;
'wesnoth-root-directory' and 'wesnoth-update-output-directory'.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-root-directory' should be the path to the root directory of&lt;br /&gt;
a Wesnoth installation or Wesnoth source code.  Wesnoth Update will&lt;br /&gt;
search recursively in this directory for WML, using the information&lt;br /&gt;
found to provide context-sensitive completion and WML checking.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-update-output-directory' specifies the path to store the&lt;br /&gt;
WML data found.  This path should be within the 'load-path', and&lt;br /&gt;
preferably, in the same directory as Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 (setq wesnoth-root-directory &amp;quot;/usr/local/share/wesnoth/&amp;quot;&lt;br /&gt;
       wesnoth-update-output-directory &amp;quot;~/.emacs.d/wesnoth-mode/&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Once set, 'M-x wesnoth-update' will generate and load a new cache of&lt;br /&gt;
WML data ready for use for the current and future sessions.  Note:&lt;br /&gt;
'wesnoth-update' may take some time to run.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-addition-file' specifies the `addition file' to use.  An&lt;br /&gt;
addition file is an outline of a valid WML file which is processed for&lt;br /&gt;
additional element data which may not have been detected when running&lt;br /&gt;
'wesnoth-update'.  This should be set as the path to a suitable&lt;br /&gt;
addition file.  A sample addition file is included with Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
The addition data is read from the file and updated any time tag&lt;br /&gt;
information is required, therefore no action needs to be taken to adjust&lt;br /&gt;
tag data other than saving the addition file when modified.&lt;br /&gt;
&lt;br /&gt;
For example, the following could be used to specify an addition file:&lt;br /&gt;
&lt;br /&gt;
 (setq wesnoth-addition-file&lt;br /&gt;
      &amp;quot;~/.emacs.d/wesnoth-mode/wesnoth-wml-additions.cfg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Macro Definitions===&lt;br /&gt;
&lt;br /&gt;
While built-in macros are always available, local macro definitions are&lt;br /&gt;
automatically scanned and made known to Wesnoth Mode for each WML file&lt;br /&gt;
which is loaded in the session. 'C-c C-u' can be used to update the&lt;br /&gt;
known macro definitions for any buffer which has since been modified.&lt;br /&gt;
(Note that this is not required when the macro is defined in the WML&lt;br /&gt;
file currently being edited as such definitions will be automatically&lt;br /&gt;
updated when needed.)  'C-u C-c C-u' can be used to clear known local&lt;br /&gt;
macro definitions.&lt;/div&gt;</summary>
		<author><name>Wildpenguin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27873</id>
		<title>Wesnoth Mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27873"/>
		<updated>2009-01-04T03:04:03Z</updated>

		<summary type="html">&lt;p&gt;Wildpenguin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is a major mode for Emacs which assists in the editing of&lt;br /&gt;
the markup language extensively used in Wesnoth, a turn-based fantasy&lt;br /&gt;
strategy game.  From the Wesnoth Wiki: &amp;quot;The Wesnoth Markup Language&lt;br /&gt;
(WML) is used to code almost everything in Wesnoth, including scenarios,&lt;br /&gt;
units, savefiles, and the user interface layout.&amp;quot; (1)&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is supported under GNU Emacs 21 onwards and (with some&lt;br /&gt;
minor limitations) XEmacs 21.  Wesnoth Mode adds support for syntax&lt;br /&gt;
highlighting, automatic indentation, context-sensitive completion,&lt;br /&gt;
checking and much more when editing WML.&lt;br /&gt;
&lt;br /&gt;
This documentation attempts to provide a comprehensive guide to&lt;br /&gt;
functionality available within Wesnoth Mode 1.3.4, and assumes you are&lt;br /&gt;
familiar with basic usage, terminology and customisation of Emacs.  For&lt;br /&gt;
more information, please refer to the Emacs manual. (2)&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) http://www.wesnoth.org/wiki/ReferenceWML&lt;br /&gt;
 (2) http://www.gnu.org/software/emacs/manual/html_node/emacs/&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
&lt;br /&gt;
To use Wesnoth Mode, add the following to your '.emacs':&lt;br /&gt;
     (add-to-list 'load-path &amp;quot;path/to/wesnoth-mode&amp;quot;)&lt;br /&gt;
     (autoload 'wesnoth-mode &amp;quot;wesnoth-mode&amp;quot; &amp;quot;Major mode for editing WML.&amp;quot; t)&lt;br /&gt;
Optionally adding:&lt;br /&gt;
     (add-to-list 'auto-mode-alist '(&amp;quot;\\.cfg\\'&amp;quot; . wesnoth-mode))&lt;br /&gt;
to automatically load Wesnoth Mode for all files with a .cfg&lt;br /&gt;
extension.&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode can be activated as the current major-mode for a buffer via&lt;br /&gt;
'M-x wesnoth-mode'.&lt;br /&gt;
&lt;br /&gt;
The latest version of Wesnoth Mode along with release notes can be&lt;br /&gt;
found at http://www.wesnoth.org/forum/viewtopic.php?t=13798.&lt;br /&gt;
&lt;br /&gt;
==Basic Usage==&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode provides a style of indentation equivalent to&lt;br /&gt;
that provided by the 'wmlindent' tool included with Wesnoth.&lt;br /&gt;
'TAB' can be used to indent the current line manually.  Wesnoth Mode&lt;br /&gt;
will, by default, indent the current line appropriately before inserting&lt;br /&gt;
a newline when 'RET' or 'C-j' is used. ('C-j' will also&lt;br /&gt;
attempt to indent the new line.)&lt;br /&gt;
 &lt;br /&gt;
See [[#Modifying Indentation|Modifying Indentation]] for information on how to customise the behaviour of automatic indentation.&lt;br /&gt;
&lt;br /&gt;
'TAB' performs two actions depending on the context of point.  When&lt;br /&gt;
there is an incomplete element immediately preceeding point, completion&lt;br /&gt;
will be attempted, otherwise 'TAB' will perform indentation.  See&lt;br /&gt;
[[#Tab-Completion|Tab-Completion]].&lt;br /&gt;
&lt;br /&gt;
===Navigation===&lt;br /&gt;
&lt;br /&gt;
Next and previous opening elements can be navigated using 'C-M-e'&lt;br /&gt;
and 'C-M-a', respectively.  In each case, point will be positioned&lt;br /&gt;
immediately before the element.  When no more elements are available in&lt;br /&gt;
that direction, point will not move.&lt;br /&gt;
&lt;br /&gt;
Moving to the matching element in a pair or locating the parent element&lt;br /&gt;
(depending on the position of point) can be performed via 'C-c C-o'.&lt;br /&gt;
When point is on the same line as an opening element, such as an opening&lt;br /&gt;
tag or opening preprocessor statement it will be moved to the start of&lt;br /&gt;
the matching closing element.  Otherwise, the jump will position point&lt;br /&gt;
at the beginning of the corresponding opening element.&lt;br /&gt;
&lt;br /&gt;
==Inserting Elements==&lt;br /&gt;
&lt;br /&gt;
===Standard Completion===&lt;br /&gt;
&lt;br /&gt;
Tags can be inserted via 'C-c C-t' and alternatively 'M-TAB' (when&lt;br /&gt;
this is not shadowed by the Window Manager, etc.).  This will prompt&lt;br /&gt;
for the tag to add.  The tag entered into the mini-buffer prompt and&lt;br /&gt;
its matching closing tag will be inserted and point positioned between.&lt;br /&gt;
&lt;br /&gt;
Attributes can be inserted via 'C-c C-a'.  The attribute entered at&lt;br /&gt;
the prompt will be inserted along with the '=', with point immediately&lt;br /&gt;
after.&lt;br /&gt;
&lt;br /&gt;
Both tag and attribute completion is context-sensitive.  If an&lt;br /&gt;
element is available in WML and not listed for completion, you may want&lt;br /&gt;
to add it to your 'addition file'.  See [[#Wesnoth Update|Wesnoth Update]] for more&lt;br /&gt;
information.&lt;br /&gt;
&lt;br /&gt;
Macro insertion can be performed via 'C-c C-m'.  Any arguments known&lt;br /&gt;
to be required for the macro will be prompted and inserted in order.&lt;br /&gt;
Insertion will be aborted if no value for an argument is provided.  When&lt;br /&gt;
within a macro definition, the arguments for the current macro are also&lt;br /&gt;
available for completion.  Any project-local or custom macros can be&lt;br /&gt;
made available for completion by opening the file in which they are&lt;br /&gt;
defined. For information on completing project-local macros, see [[#Macro Definitions|Macro Definitions]].&lt;br /&gt;
&lt;br /&gt;
Preprocessor statements are available for insertion via 'C-c C-p'.&lt;br /&gt;
Closing elements for preprocessor statements will be automatically&lt;br /&gt;
inserted where possible, with point positioned between.  Otherwise,&lt;br /&gt;
point will be placed immediately after the inserted text.&lt;br /&gt;
&lt;br /&gt;
===Tab-Completion===&lt;br /&gt;
&lt;br /&gt;
Completion can also be performed immediately within the buffer via&lt;br /&gt;
'TAB' on a partial element.  For example:&lt;br /&gt;
     [scenario]&lt;br /&gt;
         vil-!-&lt;br /&gt;
Where '-!-' is the position of point.  Using 'TAB' in the example&lt;br /&gt;
will complete to 'vil' to 'village_gold='.  Tags, macros and&lt;br /&gt;
preprocessor statements can be completed similarly.  When the&lt;br /&gt;
current line does not contain a partially completed element, 'TAB'&lt;br /&gt;
will perform indentation on the current line.&lt;br /&gt;
&lt;br /&gt;
When there is more than one possible completion, a minibuffer prompt&lt;br /&gt;
will be provided, with the partial element entered.  'TAB' can be used&lt;br /&gt;
here to perform completion.  If multiple matches are available,&lt;br /&gt;
completion will be performed up to the smallest common substring with&lt;br /&gt;
further completion available via the minubuffer prompt.  When no matches&lt;br /&gt;
are found for the partial element, completion will not be prompted.&lt;br /&gt;
&lt;br /&gt;
When completing opening preprocessor statements and tags, Wesnoth&lt;br /&gt;
Mode will also attempt to insert a matching closing element if one is&lt;br /&gt;
not already available, acting in much the same way as if the element was&lt;br /&gt;
added via the minibuffer prompt.  However, if an matching closing&lt;br /&gt;
element is available, only the element at point will be completed.&lt;br /&gt;
&lt;br /&gt;
A numeric argument can be provided when performing tab-completion of&lt;br /&gt;
opening elements to wrap around the next 'n' blocks.  For example,&lt;br /&gt;
to wrap the completed opening and closing pair around the next three&lt;br /&gt;
blocks, 'C-u 3 TAB' can be used.  Refer to [[#Wrapping Elements|Wrapping Elements]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Wrapping Elements===&lt;br /&gt;
&lt;br /&gt;
When inserting tags and some preprocessor statements, either via their&lt;br /&gt;
respective insertion command or via 'TAB', an optional numeric argument&lt;br /&gt;
can be provided to specify the number of 'blocks' to wrap the element&lt;br /&gt;
around.  For example:&lt;br /&gt;
&lt;br /&gt;
     [multiplayer]&lt;br /&gt;
      -!-[part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [event]&lt;br /&gt;
             ...&lt;br /&gt;
&lt;br /&gt;
Where point is at the position indicated by '-!-'.  A pair of&lt;br /&gt;
'story' tags can be inserted around both existing 'part' tags using&lt;br /&gt;
'C-u 2 C-c C-t story'.  When the number of blocks specified to wrap&lt;br /&gt;
around exceeds the number of blocks available, Wesnoth Mode will only&lt;br /&gt;
wrap around the number of available so that the nesting of elements is&lt;br /&gt;
correct.&lt;br /&gt;
&lt;br /&gt;
===Missing Elements===&lt;br /&gt;
&lt;br /&gt;
Missing closing elements can be inserted using 'C-c C-/'.  By default,&lt;br /&gt;
this will insert the first missing closing element found in the current&lt;br /&gt;
buffer at point.  If all elements appear to be matched or if there is an excess of closing tags, a notification will be displayed and no element will be inserted.&lt;br /&gt;
&lt;br /&gt;
==Checking WML==&lt;br /&gt;
&lt;br /&gt;
===Usage and Capabilities===&lt;br /&gt;
&lt;br /&gt;
Checking of the current buffer can be performed using 'C-c C-c'.  A&lt;br /&gt;
summary of all warnings located will be provided in a separate buffer.&lt;br /&gt;
Point can be jumped to the next and previous warning using 'C-c C-f'&lt;br /&gt;
(or 'C-x `') and 'C-c C-b', respectively.  For visibility,&lt;br /&gt;
warnings will be underlined in red by default.  Note: Warning underlines may not be available in XEmacs.&lt;br /&gt;
&lt;br /&gt;
The WML checking built-in to Wesnoth Mode is not intended to&lt;br /&gt;
be an alternative to tools such as `wmllint', but may often be a&lt;br /&gt;
convenient substitute while editing WML.&lt;br /&gt;
&lt;br /&gt;
The following conditions can be detected by WML checking in Wesnoth&lt;br /&gt;
Mode:&lt;br /&gt;
* Correct nesting of tags and preprocessor statements&lt;br /&gt;
* Known macro definitions (1)&lt;br /&gt;
* Availability of elements within the given context&lt;br /&gt;
* Arguments are given to preprocessor statements when required&lt;br /&gt;
* Attributes have a value assigned&lt;br /&gt;
* Corresponding FOREACH..NEXT pairs&lt;br /&gt;
&lt;br /&gt;
WML checking is specific to the version of WML known by Wesnoth Mode. See [[#Wesnoth Update|Wesnoth Update]] for more information.&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) [[#Macro Definitions|Macro Definitions]]&lt;br /&gt;
&lt;br /&gt;
==Customisation==&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
The style of indentation can be customised using&lt;br /&gt;
'wesnoth-indent-savefile'.  The default value is 'non-nil', which&lt;br /&gt;
results in all children being indented a level deeper than their&lt;br /&gt;
parent.  When set to 'nil', children will be indented to the same level&lt;br /&gt;
as their parent element.  This option is provided only for +consistency when editing (very) old WML.  It is recommended that this be non-nil for all new WML.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-indent-preprocessor-bol' controls how preprocessor&lt;br /&gt;
statements should be indented.  If non-nil, all preprocessor statements&lt;br /&gt;
will be indented to the beginning of the line.  Otherwise, preprocessor&lt;br /&gt;
statements will be indented as to the level indicated by its context.&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode will attempt indentation of the current line&lt;br /&gt;
and create a newline and when 'RET' or 'C-j' are used.&lt;br /&gt;
'wesnoth-auto-indent-flag' controls whether Wesnoth Mode will attempt&lt;br /&gt;
to indent the current line automatically.  Setting this to 'nil' will&lt;br /&gt;
prevent automatic indentation.  Note that this does not affect the&lt;br /&gt;
behaviour of 'C-j' performing indentation following the newline; this&lt;br /&gt;
only determines whether indentation will be automatically performed on&lt;br /&gt;
the current line.&lt;br /&gt;
&lt;br /&gt;
The following can be used to change 'RET' to automatically indent the&lt;br /&gt;
newline:&lt;br /&gt;
&lt;br /&gt;
 (add-hook 'wesnoth-mode-hook&lt;br /&gt;
   '(lambda ()&lt;br /&gt;
     (define-key wesnoth-mode-map (kbd ``C-m'')&lt;br /&gt;
     'wesnoth-newline-and-indent)))&lt;br /&gt;
&lt;br /&gt;
'wesnoth-base-indent' controls the depth of indentation for each&lt;br /&gt;
level.  Its value should be an integer.  This is set to '4' by default,&lt;br /&gt;
which is the convention used when indenting WML.&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode will use spaces for indentation.  Tabs can instead be used with the following:&lt;br /&gt;
&lt;br /&gt;
 (add-hook 'wesnoth-mode-hook&lt;br /&gt;
   '(lambda ()&lt;br /&gt;
     (setq indent-tabs-mode t&lt;br /&gt;
           tab-width wesnoth-base-indent)))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'wesnoth-warning-face' is the face used to display the overlay for&lt;br /&gt;
warnings detected when checking WML (See [[#Checking WML|Checking WML]]).  By&lt;br /&gt;
default this is a red underline.  Note: use of this face may not be supported&lt;br /&gt;
under XEmacs.&lt;br /&gt;
&lt;br /&gt;
===Wesnoth Update===&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode uses WML as in Wesnoth 1.5.6, but the version of WML used can be changed using Wesnoth Update.  Wesnoth Update controls the known WML data for Wesnoth Mode.  To update this information, two variables need to be set appropriately:&lt;br /&gt;
'wesnoth-root-directory' and 'wesnoth-update-output-directory'.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-root-directory' should be the path to the root directory of&lt;br /&gt;
a Wesnoth installation or Wesnoth source code.  Wesnoth Update will&lt;br /&gt;
search recursively in this directory for WML, using the information&lt;br /&gt;
found to provide context-sensitive completion and WML checking.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-update-output-directory' specifies the path to store the&lt;br /&gt;
WML data found.  This path should be within the 'load-path', and&lt;br /&gt;
preferably, in the same directory as Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 (setq wesnoth-root-directory &amp;quot;/usr/local/share/wesnoth/&amp;quot;&lt;br /&gt;
       wesnoth-update-output-directory &amp;quot;~/.emacs.d/wesnoth-mode/&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Once set, 'M-x wesnoth-update' will generate and load a new cache of&lt;br /&gt;
WML data ready for use for the current and future sessions.  Note:&lt;br /&gt;
'wesnoth-update' may take some time to run.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-addition-file' specifies the `addition file' to use.  An&lt;br /&gt;
addition file is an outline of a valid WML file which is processed for&lt;br /&gt;
additional element data which may not have been detected when running&lt;br /&gt;
'wesnoth-update'.  This should be set as the path to a suitable&lt;br /&gt;
addition file.  A sample addition file is included with Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
The addition data is read from the file and updated any time tag&lt;br /&gt;
information is required, therefore no action needs to be taken to adjust&lt;br /&gt;
tag data other than saving the addition file when modified.&lt;br /&gt;
&lt;br /&gt;
For example, the following could be used to specify an addition file:&lt;br /&gt;
&lt;br /&gt;
 (setq wesnoth-addition-file&lt;br /&gt;
      &amp;quot;~/.emacs.d/wesnoth-mode/wesnoth-wml-additions.cfg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Macro Definitions===&lt;br /&gt;
&lt;br /&gt;
While built-in macros are always available, local macro definitions are&lt;br /&gt;
automatically scanned and made known to Wesnoth Mode for each WML file&lt;br /&gt;
which is loaded in the session. 'C-c C-u' can be used to update the&lt;br /&gt;
known macro definitions for any buffer which has since been modified.&lt;br /&gt;
(Note that this is not required when the macro is defined in the WML&lt;br /&gt;
file currently being edited as such definitions will be automatically&lt;br /&gt;
updated when needed.)  'C-u C-c C-u' can be used to clear known local&lt;br /&gt;
macro definitions.&lt;/div&gt;</summary>
		<author><name>Wildpenguin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27872</id>
		<title>Wesnoth Mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27872"/>
		<updated>2009-01-04T03:02:57Z</updated>

		<summary type="html">&lt;p&gt;Wildpenguin: Updated for upcoming release&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is a major mode for Emacs which assists in the editing of&lt;br /&gt;
the markup language extensively used in Wesnoth, a turn-based fantasy&lt;br /&gt;
strategy game.  From the Wesnoth Wiki: &amp;quot;The Wesnoth Markup Language&lt;br /&gt;
(WML) is used to code almost everything in Wesnoth, including scenarios,&lt;br /&gt;
units, savefiles, and the user interface layout.&amp;quot; (1)&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is supported under GNU Emacs 21 onwards and (with some&lt;br /&gt;
minor limitations) XEmacs 21.  Wesnoth Mode adds support for syntax&lt;br /&gt;
highlighting, automatic indentation, context-sensitive completion,&lt;br /&gt;
checking and much more when editing WML.&lt;br /&gt;
&lt;br /&gt;
This documentation attempts to provide a comprehensive guide to&lt;br /&gt;
functionality available within Wesnoth Mode 1.3.4, and assumes you are&lt;br /&gt;
familiar with basic usage, terminology and customisation of Emacs.  For&lt;br /&gt;
more information, please refer to the Emacs manual. (2)&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) http://www.wesnoth.org/wiki/ReferenceWML&lt;br /&gt;
 (2) http://www.gnu.org/software/emacs/manual/html_node/emacs/&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
&lt;br /&gt;
To use Wesnoth Mode, add the following to your '.emacs':&lt;br /&gt;
     (add-to-list 'load-path &amp;quot;path/to/wesnoth-mode&amp;quot;)&lt;br /&gt;
     (autoload 'wesnoth-mode &amp;quot;wesnoth-mode&amp;quot; &amp;quot;Major mode for editing WML.&amp;quot; t)&lt;br /&gt;
Optionally adding:&lt;br /&gt;
     (add-to-list 'auto-mode-alist '(&amp;quot;\\.cfg\\'&amp;quot; . wesnoth-mode))&lt;br /&gt;
to automatically load Wesnoth Mode for all files with a .cfg&lt;br /&gt;
extension.&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode can be activated as the current major-mode for a buffer via&lt;br /&gt;
'M-x wesnoth-mode'.&lt;br /&gt;
&lt;br /&gt;
The latest version of Wesnoth Mode along with release notes can be&lt;br /&gt;
found at http://www.wesnoth.org/forum/viewtopic.php?t=13798.&lt;br /&gt;
&lt;br /&gt;
==Basic Usage==&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode provides a style of indentation equivalent to&lt;br /&gt;
that provided by the 'wmlindent' tool included with Wesnoth.&lt;br /&gt;
'TAB' can be used to indent the current line manually.  Wesnoth Mode&lt;br /&gt;
will, by default, indent the current line appropriately before inserting&lt;br /&gt;
a newline when 'RET' or 'C-j' is used. ('C-j' will also&lt;br /&gt;
attempt to indent the new line.)&lt;br /&gt;
 &lt;br /&gt;
See [[#Modifying Indentation|Modifying Indentation]] for information on how to customise the behaviour of automatic indentation.&lt;br /&gt;
&lt;br /&gt;
'TAB' performs two actions depending on the context of point.  When&lt;br /&gt;
there is an incomplete element immediately preceeding point, completion&lt;br /&gt;
will be attempted, otherwise 'TAB' will perform indentation.  See&lt;br /&gt;
[[#Tab-Completion|Tab-Completion]].&lt;br /&gt;
&lt;br /&gt;
===Navigation===&lt;br /&gt;
&lt;br /&gt;
Next and previous opening elements can be navigated using 'C-M-e'&lt;br /&gt;
and 'C-M-a', respectively.  In each case, point will be positioned&lt;br /&gt;
immediately before the element.  When no more elements are available in&lt;br /&gt;
that direction, point will not move.&lt;br /&gt;
&lt;br /&gt;
Moving to the matching element in a pair or locating the parent element&lt;br /&gt;
(depending on the position of point) can be performed via 'C-c C-o'.&lt;br /&gt;
When point is on the same line as an opening element, such as an opening&lt;br /&gt;
tag or opening preprocessor statement it will be moved to the start of&lt;br /&gt;
the matching closing element.  Otherwise, the jump will position point&lt;br /&gt;
at the beginning of the corresponding opening element.&lt;br /&gt;
&lt;br /&gt;
===Matching Elements===&lt;br /&gt;
&lt;br /&gt;
Moving to the matching element in a pair or locating the parent element&lt;br /&gt;
(depending on the position of point) can be performed via 'C-c C-o'.&lt;br /&gt;
When point is on the same line as an opening element, such as an opening&lt;br /&gt;
tag or opening preprocessor statement it will be moved to the start of&lt;br /&gt;
the matching closing element.  Otherwise, the jump will position point&lt;br /&gt;
at the beginning of the corresponding opening element.&lt;br /&gt;
&lt;br /&gt;
==Inserting Elements==&lt;br /&gt;
&lt;br /&gt;
===Standard Completion===&lt;br /&gt;
&lt;br /&gt;
Tags can be inserted via 'C-c C-t' and alternatively 'M-TAB' (when&lt;br /&gt;
this is not shadowed by the Window Manager, etc.).  This will prompt&lt;br /&gt;
for the tag to add.  The tag entered into the mini-buffer prompt and&lt;br /&gt;
its matching closing tag will be inserted and point positioned between.&lt;br /&gt;
&lt;br /&gt;
Attributes can be inserted via 'C-c C-a'.  The attribute entered at&lt;br /&gt;
the prompt will be inserted along with the '=', with point immediately&lt;br /&gt;
after.&lt;br /&gt;
&lt;br /&gt;
Both tag and attribute completion is context-sensitive.  If an&lt;br /&gt;
element is available in WML and not listed for completion, you may want&lt;br /&gt;
to add it to your 'addition file'.  See [[#Wesnoth Update|Wesnoth Update]] for more&lt;br /&gt;
information.&lt;br /&gt;
&lt;br /&gt;
Macro insertion can be performed via 'C-c C-m'.  Any arguments known&lt;br /&gt;
to be required for the macro will be prompted and inserted in order.&lt;br /&gt;
Insertion will be aborted if no value for an argument is provided.  When&lt;br /&gt;
within a macro definition, the arguments for the current macro are also&lt;br /&gt;
available for completion.  Any project-local or custom macros can be&lt;br /&gt;
made available for completion by opening the file in which they are&lt;br /&gt;
defined. For information on completing project-local macros, see [[#Macro Definitions|Macro Definitions]].&lt;br /&gt;
&lt;br /&gt;
Preprocessor statements are available for insertion via 'C-c C-p'.&lt;br /&gt;
Closing elements for preprocessor statements will be automatically&lt;br /&gt;
inserted where possible, with point positioned between.  Otherwise,&lt;br /&gt;
point will be placed immediately after the inserted text.&lt;br /&gt;
&lt;br /&gt;
===Tab-Completion===&lt;br /&gt;
&lt;br /&gt;
Completion can also be performed immediately within the buffer via&lt;br /&gt;
'TAB' on a partial element.  For example:&lt;br /&gt;
     [scenario]&lt;br /&gt;
         vil-!-&lt;br /&gt;
Where '-!-' is the position of point.  Using 'TAB' in the example&lt;br /&gt;
will complete to 'vil' to 'village_gold='.  Tags, macros and&lt;br /&gt;
preprocessor statements can be completed similarly.  When the&lt;br /&gt;
current line does not contain a partially completed element, 'TAB'&lt;br /&gt;
will perform indentation on the current line.&lt;br /&gt;
&lt;br /&gt;
When there is more than one possible completion, a minibuffer prompt&lt;br /&gt;
will be provided, with the partial element entered.  'TAB' can be used&lt;br /&gt;
here to perform completion.  If multiple matches are available,&lt;br /&gt;
completion will be performed up to the smallest common substring with&lt;br /&gt;
further completion available via the minubuffer prompt.  When no matches&lt;br /&gt;
are found for the partial element, completion will not be prompted.&lt;br /&gt;
&lt;br /&gt;
When completing opening preprocessor statements and tags, Wesnoth&lt;br /&gt;
Mode will also attempt to insert a matching closing element if one is&lt;br /&gt;
not already available, acting in much the same way as if the element was&lt;br /&gt;
added via the minibuffer prompt.  However, if an matching closing&lt;br /&gt;
element is available, only the element at point will be completed.&lt;br /&gt;
&lt;br /&gt;
A numeric argument can be provided when performing tab-completion of&lt;br /&gt;
opening elements to wrap around the next 'n' blocks.  For example,&lt;br /&gt;
to wrap the completed opening and closing pair around the next three&lt;br /&gt;
blocks, 'C-u 3 TAB' can be used.  Refer to [[#Wrapping Elements|Wrapping Elements]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Wrapping Elements===&lt;br /&gt;
&lt;br /&gt;
When inserting tags and some preprocessor statements, either via their&lt;br /&gt;
respective insertion command or via 'TAB', an optional numeric argument&lt;br /&gt;
can be provided to specify the number of 'blocks' to wrap the element&lt;br /&gt;
around.  For example:&lt;br /&gt;
&lt;br /&gt;
     [multiplayer]&lt;br /&gt;
      -!-[part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [event]&lt;br /&gt;
             ...&lt;br /&gt;
&lt;br /&gt;
Where point is at the position indicated by '-!-'.  A pair of&lt;br /&gt;
'story' tags can be inserted around both existing 'part' tags using&lt;br /&gt;
'C-u 2 C-c C-t story'.  When the number of blocks specified to wrap&lt;br /&gt;
around exceeds the number of blocks available, Wesnoth Mode will only&lt;br /&gt;
wrap around the number of available so that the nesting of elements is&lt;br /&gt;
correct.&lt;br /&gt;
&lt;br /&gt;
===Missing Elements===&lt;br /&gt;
&lt;br /&gt;
Missing closing elements can be inserted using 'C-c C-/'.  By default,&lt;br /&gt;
this will insert the first missing closing element found in the current&lt;br /&gt;
buffer at point.  If all elements appear to be matched or if there is an excess of closing tags, a notification will be displayed and no element will be inserted.&lt;br /&gt;
&lt;br /&gt;
==Checking WML==&lt;br /&gt;
&lt;br /&gt;
===Usage and Capabilities===&lt;br /&gt;
&lt;br /&gt;
Checking of the current buffer can be performed using 'C-c C-c'.  A&lt;br /&gt;
summary of all warnings located will be provided in a separate buffer.&lt;br /&gt;
Point can be jumped to the next and previous warning using 'C-c C-f'&lt;br /&gt;
(or 'C-x `') and 'C-c C-b', respectively.  For visibility,&lt;br /&gt;
warnings will be underlined in red by default.  Note: Warning underlines may not be available in XEmacs.&lt;br /&gt;
&lt;br /&gt;
The WML checking built-in to Wesnoth Mode is not intended to&lt;br /&gt;
be an alternative to tools such as `wmllint', but may often be a&lt;br /&gt;
convenient substitute while editing WML.&lt;br /&gt;
&lt;br /&gt;
The following conditions can be detected by WML checking in Wesnoth&lt;br /&gt;
Mode:&lt;br /&gt;
* Correct nesting of tags and preprocessor statements&lt;br /&gt;
* Known macro definitions (1)&lt;br /&gt;
* Availability of elements within the given context&lt;br /&gt;
* Arguments are given to preprocessor statements when required&lt;br /&gt;
* Attributes have a value assigned&lt;br /&gt;
* Corresponding FOREACH..NEXT pairs&lt;br /&gt;
&lt;br /&gt;
WML checking is specific to the version of WML known by Wesnoth Mode. See [[#Wesnoth Update|Wesnoth Update]] for more information.&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) [[#Macro Definitions|Macro Definitions]]&lt;br /&gt;
&lt;br /&gt;
==Customisation==&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
The style of indentation can be customised using&lt;br /&gt;
'wesnoth-indent-savefile'.  The default value is 'non-nil', which&lt;br /&gt;
results in all children being indented a level deeper than their&lt;br /&gt;
parent.  When set to 'nil', children will be indented to the same level&lt;br /&gt;
as their parent element.  This option is provided only for +consistency when editing (very) old WML.  It is recommended that this be non-nil for all new WML.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-indent-preprocessor-bol' controls how preprocessor&lt;br /&gt;
statements should be indented.  If non-nil, all preprocessor statements&lt;br /&gt;
will be indented to the beginning of the line.  Otherwise, preprocessor&lt;br /&gt;
statements will be indented as to the level indicated by its context.&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode will attempt indentation of the current line&lt;br /&gt;
and create a newline and when 'RET' or 'C-j' are used.&lt;br /&gt;
'wesnoth-auto-indent-flag' controls whether Wesnoth Mode will attempt&lt;br /&gt;
to indent the current line automatically.  Setting this to 'nil' will&lt;br /&gt;
prevent automatic indentation.  Note that this does not affect the&lt;br /&gt;
behaviour of 'C-j' performing indentation following the newline; this&lt;br /&gt;
only determines whether indentation will be automatically performed on&lt;br /&gt;
the current line.&lt;br /&gt;
&lt;br /&gt;
The following can be used to change 'RET' to automatically indent the&lt;br /&gt;
newline:&lt;br /&gt;
&lt;br /&gt;
 (add-hook 'wesnoth-mode-hook&lt;br /&gt;
   '(lambda ()&lt;br /&gt;
     (define-key wesnoth-mode-map (kbd ``C-m'')&lt;br /&gt;
     'wesnoth-newline-and-indent)))&lt;br /&gt;
&lt;br /&gt;
'wesnoth-base-indent' controls the depth of indentation for each&lt;br /&gt;
level.  Its value should be an integer.  This is set to '4' by default,&lt;br /&gt;
which is the convention used when indenting WML.&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode will use spaces for indentation.  Tabs can instead be used with the following:&lt;br /&gt;
&lt;br /&gt;
 (add-hook 'wesnoth-mode-hook&lt;br /&gt;
   '(lambda ()&lt;br /&gt;
     (setq indent-tabs-mode t&lt;br /&gt;
           tab-width wesnoth-base-indent)))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'wesnoth-warning-face' is the face used to display the overlay for&lt;br /&gt;
warnings detected when checking WML (See [[#Checking WML|Checking WML]]).  By&lt;br /&gt;
default this is a red underline.  Note: use of this face may not be supported&lt;br /&gt;
under XEmacs.&lt;br /&gt;
&lt;br /&gt;
===Wesnoth Update===&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode uses WML as in Wesnoth 1.5.6, but the version of WML used can be changed using Wesnoth Update.  Wesnoth Update controls the known WML data for Wesnoth Mode.  To update this information, two variables need to be set appropriately:&lt;br /&gt;
'wesnoth-root-directory' and 'wesnoth-update-output-directory'.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-root-directory' should be the path to the root directory of&lt;br /&gt;
a Wesnoth installation or Wesnoth source code.  Wesnoth Update will&lt;br /&gt;
search recursively in this directory for WML, using the information&lt;br /&gt;
found to provide context-sensitive completion and WML checking.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-update-output-directory' specifies the path to store the&lt;br /&gt;
WML data found.  This path should be within the 'load-path', and&lt;br /&gt;
preferably, in the same directory as Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 (setq wesnoth-root-directory &amp;quot;/usr/local/share/wesnoth/&amp;quot;&lt;br /&gt;
       wesnoth-update-output-directory &amp;quot;~/.emacs.d/wesnoth-mode/&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Once set, 'M-x wesnoth-update' will generate and load a new cache of&lt;br /&gt;
WML data ready for use for the current and future sessions.  Note:&lt;br /&gt;
'wesnoth-update' may take some time to run.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-addition-file' specifies the `addition file' to use.  An&lt;br /&gt;
addition file is an outline of a valid WML file which is processed for&lt;br /&gt;
additional element data which may not have been detected when running&lt;br /&gt;
'wesnoth-update'.  This should be set as the path to a suitable&lt;br /&gt;
addition file.  A sample addition file is included with Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
The addition data is read from the file and updated any time tag&lt;br /&gt;
information is required, therefore no action needs to be taken to adjust&lt;br /&gt;
tag data other than saving the addition file when modified.&lt;br /&gt;
&lt;br /&gt;
For example, the following could be used to specify an addition file:&lt;br /&gt;
&lt;br /&gt;
 (setq wesnoth-addition-file&lt;br /&gt;
      &amp;quot;~/.emacs.d/wesnoth-mode/wesnoth-wml-additions.cfg&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Macro Definitions===&lt;br /&gt;
&lt;br /&gt;
While built-in macros are always available, local macro definitions are&lt;br /&gt;
automatically scanned and made known to Wesnoth Mode for each WML file&lt;br /&gt;
which is loaded in the session. 'C-c C-u' can be used to update the&lt;br /&gt;
known macro definitions for any buffer which has since been modified.&lt;br /&gt;
(Note that this is not required when the macro is defined in the WML&lt;br /&gt;
file currently being edited as such definitions will be automatically&lt;br /&gt;
updated when needed.)  'C-u C-c C-u' can be used to clear known local&lt;br /&gt;
macro definitions.&lt;/div&gt;</summary>
		<author><name>Wildpenguin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27687</id>
		<title>Wesnoth Mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27687"/>
		<updated>2008-12-22T07:21:52Z</updated>

		<summary type="html">&lt;p&gt;Wildpenguin: Update minor error in example code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is a major mode for Emacs which assists in the editing of&lt;br /&gt;
the markup language extensively used in Wesnoth, a turn-based fantasy&lt;br /&gt;
strategy game.  From the Wesnoth Wiki: &amp;quot;The Wesnoth Markup Language&lt;br /&gt;
(WML) is used to code almost everything in Wesnoth, including&lt;br /&gt;
scenarios, units, savefiles, and the user interface layout.&amp;quot; (1)&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is supported under GNU Emacs 21 onwards and (with some&lt;br /&gt;
minor limitations) XEmacs 21.  Wesnoth Mode adds support for syntax&lt;br /&gt;
highlighting, automatic indentation, context-sensitive completion,&lt;br /&gt;
checking and much more when editing WML.&lt;br /&gt;
&lt;br /&gt;
This documentation attempts to provide a comprehensive guide to&lt;br /&gt;
functionality available within Wesnoth Mode 1.3.3, and assumes you are&lt;br /&gt;
familiar with basic usage, terminology and customisation of Emacs.  For&lt;br /&gt;
more information, please refer to the Emacs manual. (2)&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) http://www.wesnoth.org/wiki/ReferenceWML&lt;br /&gt;
 (2) http://www.gnu.org/software/emacs/manual/html_node/emacs/&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
&lt;br /&gt;
To use Wesnoth Mode, add the following to your '.emacs':&lt;br /&gt;
     (add-to-list 'load-path &amp;quot;path/to/wesnoth-mode&amp;quot;)&lt;br /&gt;
     (autoload 'wesnoth-mode &amp;quot;wesnoth-mode&amp;quot; &amp;quot;Major mode for editing WML.&amp;quot; t)&lt;br /&gt;
Optionally adding:&lt;br /&gt;
     (add-to-list 'auto-mode-alist '(&amp;quot;\\.cfg\\'&amp;quot; . wesnoth-mode))&lt;br /&gt;
to automatically load Wesnoth Mode for all files with a .cfg&lt;br /&gt;
extension.&lt;br /&gt;
&lt;br /&gt;
If Wesnoth Mode is not the currently active major-mode for the&lt;br /&gt;
current buffer, it can be started via 'M-x wesnoth-mode'.&lt;br /&gt;
&lt;br /&gt;
The latest version of Wesnoth Mode along with release notes can be&lt;br /&gt;
found at http://www.wesnoth.org/forum/viewtopic.php?t=13798.&lt;br /&gt;
&lt;br /&gt;
==Navigation==&lt;br /&gt;
&lt;br /&gt;
===Navigation Introduction===&lt;br /&gt;
&lt;br /&gt;
Emacs provides many powerful built-in navigation commands which are&lt;br /&gt;
ideal for editing WML.  Common navigation commands, such as 'C-n',&lt;br /&gt;
'C-s', and (in recent Emacsen) 'M-g g', will behave as usual within&lt;br /&gt;
Wesnoth Mode.  However, some navigation commands have been adjusted or&lt;br /&gt;
added for increased productivity.  These will be explained in the&lt;br /&gt;
following sections.&lt;br /&gt;
&lt;br /&gt;
===Moving Across Elements===&lt;br /&gt;
&lt;br /&gt;
Next and previous opening elements can be navigated using 'C-M-e' and&lt;br /&gt;
'C-M-a', respectively.  In each case, point will be positioned&lt;br /&gt;
immediately before the element.  When there are no more elements are&lt;br /&gt;
available in that direction, point will not move.&lt;br /&gt;
&lt;br /&gt;
===Matching Elements===&lt;br /&gt;
&lt;br /&gt;
Moving to the matching element in a pair or locating the parent element&lt;br /&gt;
(depending on the position of point) can be performed via 'C-c C-o'.&lt;br /&gt;
When point is on the same line as an opening element, such as an opening&lt;br /&gt;
tag or opening preprocessor statement it will be moved to the start of&lt;br /&gt;
the matching closing element.  Otherwise, the jump will position point&lt;br /&gt;
at the beginning of the corresponding opening element.&lt;br /&gt;
&lt;br /&gt;
==Inserting Elements==&lt;br /&gt;
&lt;br /&gt;
===Standard Completion===&lt;br /&gt;
&lt;br /&gt;
Tags can be inserted via 'C-c C-t' and alternatively 'M-TAB' (when&lt;br /&gt;
this is not shadowed by the Window Manager, etc.).  This will prompt&lt;br /&gt;
for the tag to add.  The tag entered into the mini-buffer prompt and&lt;br /&gt;
its matching closing tag will be inserted and point positioned between.&lt;br /&gt;
&lt;br /&gt;
Attributes can be inserted via 'C-c C-a'.  The attribute entered at&lt;br /&gt;
the prompt will be inserted along with the '=', with point immediately&lt;br /&gt;
after.&lt;br /&gt;
&lt;br /&gt;
Both tag and attribute completion is context-sensitive.  If an&lt;br /&gt;
element is available in WML and not listed for completion, you may want&lt;br /&gt;
to add it to your 'addition file'.  See [[#Wesnoth Update|Wesnoth Update]] for more&lt;br /&gt;
information.&lt;br /&gt;
&lt;br /&gt;
Macro insertion can be performed via 'C-c C-m'.  Any arguments known&lt;br /&gt;
to be required for the macro will be prompted and inserted in order.&lt;br /&gt;
Insertion will be aborted if no value for an argument is provided.  When&lt;br /&gt;
within a macro definition, macro arguments are also available to be&lt;br /&gt;
inserted.  Project-local macros will not be available until Wesnoth Mode&lt;br /&gt;
has scanned the buffer in which they are defined.  For information on&lt;br /&gt;
completing project-local macros, see [[#Macro Definitions|Macro Definitions]].&lt;br /&gt;
&lt;br /&gt;
Preprocessor statements are available for insertion via 'C-c C-p'.&lt;br /&gt;
Closing elements for preprocessor statements will be automatically&lt;br /&gt;
inserted where possible, with point positioned between.  Otherwise,&lt;br /&gt;
point will be placed immediately after the inserted text.&lt;br /&gt;
&lt;br /&gt;
===Tab-Completion===&lt;br /&gt;
&lt;br /&gt;
Completion can also be performed immediately within the buffer via&lt;br /&gt;
'TAB' on a partial element.  For example:&lt;br /&gt;
     [scenario]&lt;br /&gt;
         vil-!-&lt;br /&gt;
Where '-!-' is the position of point.  Using 'TAB' in the example&lt;br /&gt;
will complete to 'vil' to 'village_gold='.  Tags, macros and&lt;br /&gt;
preprocessor statements can be completed similarly.  When the&lt;br /&gt;
current line does not contain a partially completed element, 'TAB'&lt;br /&gt;
will perform indentation on the current line.&lt;br /&gt;
&lt;br /&gt;
When there is more than one possible completion, a minibuffer prompt&lt;br /&gt;
will be provided, with the partial element entered.  'TAB' can be used&lt;br /&gt;
here to perform completion.  If multiple matches are available,&lt;br /&gt;
completion will be performed up to the smallest common substring with&lt;br /&gt;
further completion available via the minubuffer prompt.  When no matches&lt;br /&gt;
are found, completion will not be prompted.&lt;br /&gt;
&lt;br /&gt;
When completing opening preprocessor statements and tags, Wesnoth&lt;br /&gt;
Mode will also attempt to insert a matching closing element if one is&lt;br /&gt;
not already available, acting in much the same way as if the element was&lt;br /&gt;
added via the minibuffer prompt.  However, if an matching closing&lt;br /&gt;
element is available, only the element at point will be completed.&lt;br /&gt;
&lt;br /&gt;
A numeric argument can be provided when performing tab-completion of&lt;br /&gt;
opening elements to wrap around the following n blocks.  For example,&lt;br /&gt;
to wrap the completed opening and closing pair around the next three&lt;br /&gt;
blocks, 'C-u 3 TAB' can be used.  Refer to [[#Wrapping Elements|Wrapping Elements]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Wrapping Elements===&lt;br /&gt;
&lt;br /&gt;
When inserting tags and some preprocessor statements, either via their&lt;br /&gt;
respective insertion command or via 'TAB', an optional numeric argument&lt;br /&gt;
can be provided to specify the number of 'blocks' to wrap the element&lt;br /&gt;
around.  For example:&lt;br /&gt;
&lt;br /&gt;
     [multiplayer]&lt;br /&gt;
      -!-[part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [event]&lt;br /&gt;
             ...&lt;br /&gt;
&lt;br /&gt;
Where point is at the position indicated by '-!-'.  A pair of&lt;br /&gt;
'story' tags can be inserted around both existing 'part' tags using&lt;br /&gt;
'C-u 2 C-c C-t story'.  When the number of blocks specified to wrap&lt;br /&gt;
around exceeds the number of blocks available, Wesnoth Mode will only&lt;br /&gt;
wrap around the number of available so that the nesting of elements is&lt;br /&gt;
correct.&lt;br /&gt;
&lt;br /&gt;
===Missing Elements===&lt;br /&gt;
&lt;br /&gt;
Missing closing elements can be inserted using 'C-c C-/'.  By default,&lt;br /&gt;
this will insert the first missing closing element found in the current&lt;br /&gt;
buffer at point.  If all elements appear to be matched or if there is&lt;br /&gt;
an excess of closing tags, an appropriate message will be displayed in&lt;br /&gt;
the echo area.&lt;br /&gt;
&lt;br /&gt;
==Checking WML==&lt;br /&gt;
&lt;br /&gt;
===Usage and Capabilities===&lt;br /&gt;
&lt;br /&gt;
Checking of the current buffer can be performed using 'C-c C-c'.  A&lt;br /&gt;
summary of all warnings located will be provided in a separate buffer.&lt;br /&gt;
Point can be jumped to the next and previous warning using 'C-c C-f'&lt;br /&gt;
(or 'C-x `') and 'C-c C-b', respectively.  For visibility,&lt;br /&gt;
warnings in the checked WML buffer will be underlined in red by default.&lt;br /&gt;
Note: Warning underlines may not be available in XEmacs.&lt;br /&gt;
&lt;br /&gt;
The WML checking built-in to Wesnoth Mode is not intended to&lt;br /&gt;
be an alternative to tools such as `wmllint', but may often be a&lt;br /&gt;
convenient substitute while editing WML.&lt;br /&gt;
&lt;br /&gt;
The following conditions can be detected by WML checking in Wesnoth&lt;br /&gt;
Mode:&lt;br /&gt;
* Correct nesting of tags and preprocessor statements&lt;br /&gt;
* Known macro definitions (1)&lt;br /&gt;
* Availability of elements within the given context&lt;br /&gt;
* Arguments are given to preprocessor statements when required&lt;br /&gt;
* Attributes have a value assigned&lt;br /&gt;
* Corresponding FOREACH..NEXT pairs&lt;br /&gt;
&lt;br /&gt;
WML checking is specific to the version of WML known by Wesnoth Mode. See [[#Wesnoth Update|Wesnoth Update]] for more information.&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) [[#Macro Definitions|Macro Definitions]]&lt;br /&gt;
&lt;br /&gt;
==Customisation==&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
The style of indentation can be customised using&lt;br /&gt;
'wesnoth-indent-savefile'.  The default value is 'non-nil', which&lt;br /&gt;
results in all children being indented a level deeper than their&lt;br /&gt;
parent.  When set to 'nil', children will be indented to the same level&lt;br /&gt;
as their parent element.  This option is provided only for consistency&lt;br /&gt;
when editing (very) old WML.  It is recommended that all new code be&lt;br /&gt;
written using the new convention.&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode will attempt indentation of the current line&lt;br /&gt;
and create a newline and when 'RET' or 'C-j' are used.&lt;br /&gt;
'wesnoth-auto-indent-flag' controls whether Wesnoth Mode will attempt&lt;br /&gt;
to indent the current line automatically.  Setting this to 'nil' will&lt;br /&gt;
prevent automatic indentation.  Note that this does not affect the&lt;br /&gt;
behaviour of 'C-j' performing indentation following the newline; this&lt;br /&gt;
only determines whether indentation will be automatically performed on&lt;br /&gt;
the current line.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-base-indent' controls the depth of indentation for each&lt;br /&gt;
level.  Its value should be an integer.  This is set to '4' by default,&lt;br /&gt;
which is the convention used when indenting WML.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-warning-face' is the face used to display the overlay for&lt;br /&gt;
warnings detected when checking WML (See [[#Checking WML|Checking WML]]).  By&lt;br /&gt;
default this is a red underline.  Use of this face may not be supported&lt;br /&gt;
under XEmacs.&lt;br /&gt;
&lt;br /&gt;
===Wesnoth Update===&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode uses WML as in Wesnoth 1.5.6, but the version of WML used can be changed using Wesnoth Update.  Wesnoth Update controls the known WML data for Wesnoth Mode.  To update this information, three variables need to be set appropriately:&lt;br /&gt;
'wesnoth-root-directory', 'wesnoth-update-output-directory' and&lt;br /&gt;
'wesnoth-addition-file'.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-root-directory' should be the path to the root directory of&lt;br /&gt;
a Wesnoth installation or Wesnoth source code.  Wesnoth Update will&lt;br /&gt;
search recursively in this directory for WML, using the information&lt;br /&gt;
found to provide context-sensitive completion and WML checking.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-update-output-directory' specifies the path to store the&lt;br /&gt;
WML data found.  This path should be within the 'load-path', and&lt;br /&gt;
preferably, in the same directory as Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-addition-file' specifies the 'addition file' to use.  An&lt;br /&gt;
addition file is an outline of a valid WML file which is processed for&lt;br /&gt;
additional element data.  This should be set as the path a suitable&lt;br /&gt;
addition file.  A sample addition file is included with Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 (setq wesnoth-root-directory &amp;quot;/usr/local/share/wesnoth/&amp;quot;&lt;br /&gt;
       wesnoth-addition-file&lt;br /&gt;
       &amp;quot;~/.emacs.d/wesnoth-mode/wesnoth-wml-additions.cfg&amp;quot;&lt;br /&gt;
       wesnoth-update-output-directory &amp;quot;~/.emacs.d/wesnoth-mode/&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Once set, 'M-x wesnoth-update' will generate and load a new cache of&lt;br /&gt;
WML data ready for use for the current and future sessions.  (Please&lt;br /&gt;
note, 'wesnoth-update' may take some time to run.)&lt;br /&gt;
&lt;br /&gt;
===Macro Definitions===&lt;br /&gt;
&lt;br /&gt;
While built-in macros are always available, local macro definitions are&lt;br /&gt;
automatically scanned and made known to Wesnoth Mode for each WML file&lt;br /&gt;
which is loaded in the session. 'C-c C-u' can be used to update the&lt;br /&gt;
known macro definitions for any buffer which has since been modified.&lt;br /&gt;
(Note that this is not required when the macro is defined in the WML&lt;br /&gt;
file currently being edited as such definitions will be automatically&lt;br /&gt;
updated when needed.)  'C-u C-c C-u' can be used to clear known local&lt;br /&gt;
macro definitions.&lt;/div&gt;</summary>
		<author><name>Wildpenguin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27622</id>
		<title>Wesnoth Mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27622"/>
		<updated>2008-12-17T10:29:58Z</updated>

		<summary type="html">&lt;p&gt;Wildpenguin: Fix section reference&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is a major mode for Emacs which assists in the editing of&lt;br /&gt;
the markup language extensively used in Wesnoth, a turn-based fantasy&lt;br /&gt;
strategy game.  From the Wesnoth Wiki: &amp;quot;The Wesnoth Markup Language&lt;br /&gt;
(WML) is used to code almost everything in Wesnoth, including&lt;br /&gt;
scenarios, units, savefiles, and the user interface layout.&amp;quot; (1)&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is supported under GNU Emacs 21 onwards and (with some&lt;br /&gt;
minor limitations) XEmacs 21.  Wesnoth Mode adds support for syntax&lt;br /&gt;
highlighting, automatic indentation, context-sensitive completion,&lt;br /&gt;
checking and much more when editing WML.&lt;br /&gt;
&lt;br /&gt;
This documentation attempts to provide a comprehensive guide to&lt;br /&gt;
functionality available within Wesnoth Mode 1.3.3, and assumes you are&lt;br /&gt;
familiar with basic usage, terminology and customisation of Emacs.  For&lt;br /&gt;
more information, please refer to the Emacs manual. (2)&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) http://www.wesnoth.org/wiki/ReferenceWML&lt;br /&gt;
 (2) http://www.gnu.org/software/emacs/manual/html_node/emacs/&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
&lt;br /&gt;
To use Wesnoth Mode, add the following to your '.emacs':&lt;br /&gt;
     (add-to-list 'load-path &amp;quot;path/to/wesnoth-mode&amp;quot;)&lt;br /&gt;
     (autoload 'wesnoth-mode &amp;quot;wesnoth-mode&amp;quot; &amp;quot;Major mode for editing WML.&amp;quot; t)&lt;br /&gt;
Optionally adding:&lt;br /&gt;
     (add-to-list 'auto-mode-alist '(&amp;quot;\\.cfg\\'&amp;quot; . wesnoth-mode))&lt;br /&gt;
to automatically load Wesnoth Mode for all files with a .cfg&lt;br /&gt;
extension.&lt;br /&gt;
&lt;br /&gt;
If Wesnoth Mode is not the currently active major-mode for the&lt;br /&gt;
current buffer, it can be started via 'M-x wesnoth-mode'.&lt;br /&gt;
&lt;br /&gt;
The latest version of Wesnoth Mode along with release notes can be&lt;br /&gt;
found at http://www.wesnoth.org/forum/viewtopic.php?t=13798.&lt;br /&gt;
&lt;br /&gt;
==Navigation==&lt;br /&gt;
&lt;br /&gt;
===Navigation Introduction===&lt;br /&gt;
&lt;br /&gt;
Emacs provides many powerful built-in navigation commands which are&lt;br /&gt;
ideal for editing WML.  Common navigation commands, such as 'C-n',&lt;br /&gt;
'C-s', and (in recent Emacsen) 'M-g g', will behave as usual within&lt;br /&gt;
Wesnoth Mode.  However, some navigation commands have been adjusted or&lt;br /&gt;
added for increased productivity.  These will be explained in the&lt;br /&gt;
following sections.&lt;br /&gt;
&lt;br /&gt;
===Moving Across Elements===&lt;br /&gt;
&lt;br /&gt;
Next and previous opening elements can be navigated using 'C-M-e' and&lt;br /&gt;
'C-M-a', respectively.  In each case, point will be positioned&lt;br /&gt;
immediately before the element.  When there are no more elements are&lt;br /&gt;
available in that direction, point will not move.&lt;br /&gt;
&lt;br /&gt;
===Matching Elements===&lt;br /&gt;
&lt;br /&gt;
Moving to the matching element in a pair or locating the parent element&lt;br /&gt;
(depending on the position of point) can be performed via 'C-c C-o'.&lt;br /&gt;
When point is on the same line as an opening element, such as an opening&lt;br /&gt;
tag or opening preprocessor statement it will be moved to the start of&lt;br /&gt;
the matching closing element.  Otherwise, the jump will position point&lt;br /&gt;
at the beginning of the corresponding opening element.&lt;br /&gt;
&lt;br /&gt;
==Inserting Elements==&lt;br /&gt;
&lt;br /&gt;
===Standard Completion===&lt;br /&gt;
&lt;br /&gt;
Tags can be inserted via 'C-c C-t' and alternatively 'M-TAB' (when&lt;br /&gt;
this is not shadowed by the Window Manager, etc.).  This will prompt&lt;br /&gt;
for the tag to add.  The tag entered into the mini-buffer prompt and&lt;br /&gt;
its matching closing tag will be inserted and point positioned between.&lt;br /&gt;
&lt;br /&gt;
Attributes can be inserted via 'C-c C-a'.  The attribute entered at&lt;br /&gt;
the prompt will be inserted along with the '=', with point immediately&lt;br /&gt;
after.&lt;br /&gt;
&lt;br /&gt;
Both tag and attribute completion is context-sensitive.  If an&lt;br /&gt;
element is available in WML and not listed for completion, you may want&lt;br /&gt;
to add it to your 'addition file'.  See [[#Wesnoth Update|Wesnoth Update]] for more&lt;br /&gt;
information.&lt;br /&gt;
&lt;br /&gt;
Macro insertion can be performed via 'C-c C-m'.  Any arguments known&lt;br /&gt;
to be required for the macro will be prompted and inserted in order.&lt;br /&gt;
Insertion will be aborted if no value for an argument is provided.  When&lt;br /&gt;
within a macro definition, macro arguments are also available to be&lt;br /&gt;
inserted.  Project-local macros will not be available until Wesnoth Mode&lt;br /&gt;
has scanned the buffer in which they are defined.  For information on&lt;br /&gt;
completing project-local macros, see [[#Macro Definitions|Macro Definitions]].&lt;br /&gt;
&lt;br /&gt;
Preprocessor statements are available for insertion via 'C-c C-p'.&lt;br /&gt;
Closing elements for preprocessor statements will be automatically&lt;br /&gt;
inserted where possible, with point positioned between.  Otherwise,&lt;br /&gt;
point will be placed immediately after the inserted text.&lt;br /&gt;
&lt;br /&gt;
===Tab-Completion===&lt;br /&gt;
&lt;br /&gt;
Completion can also be performed immediately within the buffer via&lt;br /&gt;
'TAB' on a partial element.  For example:&lt;br /&gt;
     [scenario]&lt;br /&gt;
         vil-!-&lt;br /&gt;
Where '-!-' is the position of point.  Using 'TAB' in the example&lt;br /&gt;
will complete to 'vil' to 'village_gold='.  Tags, macros and&lt;br /&gt;
preprocessor statements can be completed similarly.  When the&lt;br /&gt;
current line does not contain a partially completed element, 'TAB'&lt;br /&gt;
will perform indentation on the current line.&lt;br /&gt;
&lt;br /&gt;
When there is more than one possible completion, a minibuffer prompt&lt;br /&gt;
will be provided, with the partial element entered.  'TAB' can be used&lt;br /&gt;
here to perform completion.  If multiple matches are available,&lt;br /&gt;
completion will be performed up to the smallest common substring with&lt;br /&gt;
further completion available via the minubuffer prompt.  When no matches&lt;br /&gt;
are found, completion will not be prompted.&lt;br /&gt;
&lt;br /&gt;
When completing opening preprocessor statements and tags, Wesnoth&lt;br /&gt;
Mode will also attempt to insert a matching closing element if one is&lt;br /&gt;
not already available, acting in much the same way as if the element was&lt;br /&gt;
added via the minibuffer prompt.  However, if an matching closing&lt;br /&gt;
element is available, only the element at point will be completed.&lt;br /&gt;
&lt;br /&gt;
A numeric argument can be provided when performing tab-completion of&lt;br /&gt;
opening elements to wrap around the following n blocks.  For example,&lt;br /&gt;
to wrap the completed opening and closing pair around the next three&lt;br /&gt;
blocks, 'C-u 3 TAB' can be used.  Refer to [[#Wrapping Elements|Wrapping Elements]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Wrapping Elements===&lt;br /&gt;
&lt;br /&gt;
When inserting tags and some preprocessor statements, either via their&lt;br /&gt;
respective insertion command or via 'TAB', an optional numeric argument&lt;br /&gt;
can be provided to specify the number of 'blocks' to wrap the element&lt;br /&gt;
around.  For example:&lt;br /&gt;
&lt;br /&gt;
     [multiplayer]&lt;br /&gt;
      -!-[part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [event]&lt;br /&gt;
             ...&lt;br /&gt;
&lt;br /&gt;
Where point is at the position indicated by '-!-'.  A pair of&lt;br /&gt;
'story' tags can be inserted around both existing 'part' tags using&lt;br /&gt;
'C-u 2 C-c C-t story'.  When the number of blocks specified to wrap&lt;br /&gt;
around exceeds the number of blocks available, Wesnoth Mode will only&lt;br /&gt;
wrap around the number of available so that the nesting of elements is&lt;br /&gt;
correct.&lt;br /&gt;
&lt;br /&gt;
===Missing Elements===&lt;br /&gt;
&lt;br /&gt;
Missing closing elements can be inserted using 'C-c C-/'.  By default,&lt;br /&gt;
this will insert the first missing closing element found in the current&lt;br /&gt;
buffer at point.  If all elements appear to be matched or if there is&lt;br /&gt;
an excess of closing tags, an appropriate message will be displayed in&lt;br /&gt;
the echo area.&lt;br /&gt;
&lt;br /&gt;
==Checking WML==&lt;br /&gt;
&lt;br /&gt;
===Usage and Capabilities===&lt;br /&gt;
&lt;br /&gt;
Checking of the current buffer can be performed using 'C-c C-c'.  A&lt;br /&gt;
summary of all warnings located will be provided in a separate buffer.&lt;br /&gt;
Point can be jumped to the next and previous warning using 'C-c C-f'&lt;br /&gt;
(or 'C-x `') and 'C-c C-b', respectively.  For visibility,&lt;br /&gt;
warnings in the checked WML buffer will be underlined in red by default.&lt;br /&gt;
Note: Warning underlines may not be available in XEmacs.&lt;br /&gt;
&lt;br /&gt;
The WML checking built-in to Wesnoth Mode is not intended to&lt;br /&gt;
be an alternative to tools such as `wmllint', but may often be a&lt;br /&gt;
convenient substitute while editing WML.&lt;br /&gt;
&lt;br /&gt;
The following conditions can be detected by WML checking in Wesnoth&lt;br /&gt;
Mode:&lt;br /&gt;
* Correct nesting of tags and preprocessor statements&lt;br /&gt;
* Known macro definitions (1)&lt;br /&gt;
* Availability of elements within the given context&lt;br /&gt;
* Arguments are given to preprocessor statements when required&lt;br /&gt;
* Attributes have a value assigned&lt;br /&gt;
* Corresponding FOREACH..NEXT pairs&lt;br /&gt;
&lt;br /&gt;
WML checking is specific to the version of WML known by Wesnoth Mode. See [[#Wesnoth Update|Wesnoth Update]] for more information.&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) [[#Macro Definitions|Macro Definitions]]&lt;br /&gt;
&lt;br /&gt;
==Customisation==&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
The style of indentation can be customised using&lt;br /&gt;
'wesnoth-indent-savefile'.  The default value is 'non-nil', which&lt;br /&gt;
results in all children being indented a level deeper than their&lt;br /&gt;
parent.  When set to 'nil', children will be indented to the same level&lt;br /&gt;
as their parent element.  This option is provided only for consistency&lt;br /&gt;
when editing (very) old WML.  It is recommended that all new code be&lt;br /&gt;
written using the new convention.&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode will attempt indentation of the current line&lt;br /&gt;
and create a newline and when 'RET' or 'C-j' are used.&lt;br /&gt;
'wesnoth-auto-indent-flag' controls whether Wesnoth Mode will attempt&lt;br /&gt;
to indent the current line automatically.  Setting this to 'nil' will&lt;br /&gt;
prevent automatic indentation.  Note that this does not affect the&lt;br /&gt;
behaviour of 'C-j' performing indentation following the newline; this&lt;br /&gt;
only determines whether indentation will be automatically performed on&lt;br /&gt;
the current line.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-base-indent' controls the depth of indentation for each&lt;br /&gt;
level.  Its value should be an integer.  This is set to '4' by default,&lt;br /&gt;
which is the convention used when indenting WML.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-warning-face' is the face used to display the overlay for&lt;br /&gt;
warnings detected when checking WML (See [[#Checking WML|Checking WML]]).  By&lt;br /&gt;
default this is a red underline.  Use of this face may not be supported&lt;br /&gt;
under XEmacs.&lt;br /&gt;
&lt;br /&gt;
===Wesnoth Update===&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode uses WML as in Wesnoth 1.5.6, but the version of WML used can be changed using Wesnoth Update.  Wesnoth Update controls the known WML data for Wesnoth Mode.  To update this information, three variables need to be set appropriately:&lt;br /&gt;
'wesnoth-root-directory', 'wesnoth-update-output-directory' and&lt;br /&gt;
'wesnoth-addition-file'.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-root-directory' should be the path to the root directory of&lt;br /&gt;
a Wesnoth installation or Wesnoth source code.  Wesnoth Update will&lt;br /&gt;
search recursively in this directory for WML, using the information&lt;br /&gt;
found to provide context-sensitive completion and WML checking.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-update-output-directory' specifies the path to store the&lt;br /&gt;
WML data found.  This path should be within the 'load-path', and&lt;br /&gt;
preferably, in the same directory as Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-addition-file' specifies the 'addition file' to use.  An&lt;br /&gt;
addition file is an outline of a valid WML file which is processed for&lt;br /&gt;
additional element data.  This should be set as the path a suitable&lt;br /&gt;
addition file.  A sample addition file is included with Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 (setq wesnoth-root-directory &amp;quot;/usr/local/share/wesnoth/&amp;quot;&lt;br /&gt;
       wesnoth-addition-file&lt;br /&gt;
       &amp;quot;~/.emacs.d/wesnoth-mode/wesnoth-wml-additions.cfg&amp;quot;&lt;br /&gt;
       wesnoth-update-output-directory &amp;quot;~/.emacs.d/wesnoth-mode/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Once set, 'M-x wesnoth-update' will generate and load a new cache of&lt;br /&gt;
WML data ready for use for the current and future sessions.  (Please&lt;br /&gt;
note, 'wesnoth-update' may take some time to run.)&lt;br /&gt;
&lt;br /&gt;
===Macro Definitions===&lt;br /&gt;
&lt;br /&gt;
While built-in macros are always available, local macro definitions are&lt;br /&gt;
automatically scanned and made known to Wesnoth Mode for each WML file&lt;br /&gt;
which is loaded in the session. 'C-c C-u' can be used to update the&lt;br /&gt;
known macro definitions for any buffer which has since been modified.&lt;br /&gt;
(Note that this is not required when the macro is defined in the WML&lt;br /&gt;
file currently being edited as such definitions will be automatically&lt;br /&gt;
updated when needed.)  'C-u C-c C-u' can be used to clear known local&lt;br /&gt;
macro definitions.&lt;/div&gt;</summary>
		<author><name>Wildpenguin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27621</id>
		<title>Wesnoth Mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27621"/>
		<updated>2008-12-17T10:27:22Z</updated>

		<summary type="html">&lt;p&gt;Wildpenguin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is a major mode for Emacs which assists in the editing of&lt;br /&gt;
the markup language extensively used in Wesnoth, a turn-based fantasy&lt;br /&gt;
strategy game.  From the Wesnoth Wiki: &amp;quot;The Wesnoth Markup Language&lt;br /&gt;
(WML) is used to code almost everything in Wesnoth, including&lt;br /&gt;
scenarios, units, savefiles, and the user interface layout.&amp;quot; (1)&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is supported under GNU Emacs 21 onwards and (with some&lt;br /&gt;
minor limitations) XEmacs 21.  Wesnoth Mode adds support for syntax&lt;br /&gt;
highlighting, automatic indentation, context-sensitive completion,&lt;br /&gt;
checking and much more when editing WML.&lt;br /&gt;
&lt;br /&gt;
This documentation attempts to provide a comprehensive guide to&lt;br /&gt;
functionality available within Wesnoth Mode 1.3.3, and assumes you are&lt;br /&gt;
familiar with basic usage, terminology and customisation of Emacs.  For&lt;br /&gt;
more information, please refer to the Emacs manual. (2)&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) http://www.wesnoth.org/wiki/ReferenceWML&lt;br /&gt;
 (2) http://www.gnu.org/software/emacs/manual/html_node/emacs/&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
&lt;br /&gt;
To use Wesnoth Mode, add the following to your '.emacs':&lt;br /&gt;
     (add-to-list 'load-path &amp;quot;path/to/wesnoth-mode&amp;quot;)&lt;br /&gt;
     (autoload 'wesnoth-mode &amp;quot;wesnoth-mode&amp;quot; &amp;quot;Major mode for editing WML.&amp;quot; t)&lt;br /&gt;
Optionally adding:&lt;br /&gt;
     (add-to-list 'auto-mode-alist '(&amp;quot;\\.cfg\\'&amp;quot; . wesnoth-mode))&lt;br /&gt;
to automatically load Wesnoth Mode for all files with a .cfg&lt;br /&gt;
extension.&lt;br /&gt;
&lt;br /&gt;
If Wesnoth Mode is not the currently active major-mode for the&lt;br /&gt;
current buffer, it can be started via 'M-x wesnoth-mode'.&lt;br /&gt;
&lt;br /&gt;
The latest version of Wesnoth Mode along with release notes can be&lt;br /&gt;
found at http://www.wesnoth.org/forum/viewtopic.php?t=13798.&lt;br /&gt;
&lt;br /&gt;
==Navigation==&lt;br /&gt;
&lt;br /&gt;
===Navigation Introduction===&lt;br /&gt;
&lt;br /&gt;
Emacs provides many powerful built-in navigation commands which are&lt;br /&gt;
ideal for editing WML.  Common navigation commands, such as 'C-n',&lt;br /&gt;
'C-s', and (in recent Emacsen) 'M-g g', will behave as usual within&lt;br /&gt;
Wesnoth Mode.  However, some navigation commands have been adjusted or&lt;br /&gt;
added for increased productivity.  These will be explained in the&lt;br /&gt;
following sections.&lt;br /&gt;
&lt;br /&gt;
===Moving Across Elements===&lt;br /&gt;
&lt;br /&gt;
Next and previous opening elements can be navigated using 'C-M-e' and&lt;br /&gt;
'C-M-a', respectively.  In each case, point will be positioned&lt;br /&gt;
immediately before the element.  When there are no more elements are&lt;br /&gt;
available in that direction, point will not move.&lt;br /&gt;
&lt;br /&gt;
===Matching Elements===&lt;br /&gt;
&lt;br /&gt;
Moving to the matching element in a pair or locating the parent element&lt;br /&gt;
(depending on the position of point) can be performed via 'C-c C-o'.&lt;br /&gt;
When point is on the same line as an opening element, such as an opening&lt;br /&gt;
tag or opening preprocessor statement it will be moved to the start of&lt;br /&gt;
the matching closing element.  Otherwise, the jump will position point&lt;br /&gt;
at the beginning of the corresponding opening element.&lt;br /&gt;
&lt;br /&gt;
==Inserting Elements==&lt;br /&gt;
&lt;br /&gt;
===Standard Completion===&lt;br /&gt;
&lt;br /&gt;
Tags can be inserted via 'C-c C-t' and alternatively 'M-TAB' (when&lt;br /&gt;
this is not shadowed by the Window Manager, etc.).  This will prompt&lt;br /&gt;
for the tag to add.  The tag entered into the mini-buffer prompt and&lt;br /&gt;
its matching closing tag will be inserted and point positioned between.&lt;br /&gt;
&lt;br /&gt;
Attributes can be inserted via 'C-c C-a'.  The attribute entered at&lt;br /&gt;
the prompt will be inserted along with the '=', with point immediately&lt;br /&gt;
after.&lt;br /&gt;
&lt;br /&gt;
Both tag and attribute completion is context-sensitive.  If an&lt;br /&gt;
element is available in WML and not listed for completion, you may want&lt;br /&gt;
to add it to your 'addition file'.  See [[#Wesnoth Update|Wesnoth Update]] for more&lt;br /&gt;
information.&lt;br /&gt;
&lt;br /&gt;
Macro insertion can be performed via 'C-c C-m'.  Any arguments known&lt;br /&gt;
to be required for the macro will be prompted and inserted in order.&lt;br /&gt;
Insertion will be aborted if no value for an argument is provided.  When&lt;br /&gt;
within a macro definition, macro arguments are also available to be&lt;br /&gt;
inserted.  Project-local macros will not be available until Wesnoth Mode&lt;br /&gt;
has scanned the buffer in which they are defined.  For information on&lt;br /&gt;
completing project-local macros, see [[#Macro Definitions|Macro Definitions]].&lt;br /&gt;
&lt;br /&gt;
Preprocessor statements are available for insertion via 'C-c C-p'.&lt;br /&gt;
Closing elements for preprocessor statements will be automatically&lt;br /&gt;
inserted where possible, with point positioned between.  Otherwise,&lt;br /&gt;
point will be placed immediately after the inserted text.&lt;br /&gt;
&lt;br /&gt;
===Tab-Completion===&lt;br /&gt;
&lt;br /&gt;
Completion can also be performed immediately within the buffer via&lt;br /&gt;
'TAB' on a partial element.  For example:&lt;br /&gt;
     [scenario]&lt;br /&gt;
         vil-!-&lt;br /&gt;
Where '-!-' is the position of point.  Using 'TAB' in the example&lt;br /&gt;
will complete to 'vil' to 'village_gold='.  Tags, macros and&lt;br /&gt;
preprocessor statements can be completed similarly.  When the&lt;br /&gt;
current line does not contain a partially completed element, 'TAB'&lt;br /&gt;
will perform indentation on the current line.&lt;br /&gt;
&lt;br /&gt;
When there is more than one possible completion, a minibuffer prompt&lt;br /&gt;
will be provided, with the partial element entered.  'TAB' can be used&lt;br /&gt;
here to perform completion.  If multiple matches are available,&lt;br /&gt;
completion will be performed up to the smallest common substring with&lt;br /&gt;
further completion available via the minubuffer prompt.  When no matches&lt;br /&gt;
are found, completion will not be prompted.&lt;br /&gt;
&lt;br /&gt;
When completing opening preprocessor statements and tags, Wesnoth&lt;br /&gt;
Mode will also attempt to insert a matching closing element if one is&lt;br /&gt;
not already available, acting in much the same way as if the element was&lt;br /&gt;
added via the minibuffer prompt.  However, if an matching closing&lt;br /&gt;
element is available, only the element at point will be completed.&lt;br /&gt;
&lt;br /&gt;
A numeric argument can be provided when performing tab-completion of&lt;br /&gt;
opening elements to wrap around the following n blocks.  For example,&lt;br /&gt;
to wrap the completed opening and closing pair around the next three&lt;br /&gt;
blocks, 'C-u 3 TAB' can be used.  Refer to [[#Wrapping Elements|Wrapping Elements]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Wrapping Elements===&lt;br /&gt;
&lt;br /&gt;
When inserting tags and some preprocessor statements, either via their&lt;br /&gt;
respective insertion command or via 'TAB', an optional numeric argument&lt;br /&gt;
can be provided to specify the number of 'blocks' to wrap the element&lt;br /&gt;
around.  For example:&lt;br /&gt;
&lt;br /&gt;
     [multiplayer]&lt;br /&gt;
      -!-[part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [event]&lt;br /&gt;
             ...&lt;br /&gt;
&lt;br /&gt;
Where point is at the position indicated by '-!-'.  A pair of&lt;br /&gt;
'story' tags can be inserted around both existing 'part' tags using&lt;br /&gt;
'C-u 2 C-c C-t story'.  When the number of blocks specified to wrap&lt;br /&gt;
around exceeds the number of blocks available, Wesnoth Mode will only&lt;br /&gt;
wrap around the number of available so that the nesting of elements is&lt;br /&gt;
correct.&lt;br /&gt;
&lt;br /&gt;
===Missing Elements===&lt;br /&gt;
&lt;br /&gt;
Missing closing elements can be inserted using 'C-c C-/'.  By default,&lt;br /&gt;
this will insert the first missing closing element found in the current&lt;br /&gt;
buffer at point.  If all elements appear to be matched or if there is&lt;br /&gt;
an excess of closing tags, an appropriate message will be displayed in&lt;br /&gt;
the echo area.&lt;br /&gt;
&lt;br /&gt;
==Checking WML==&lt;br /&gt;
&lt;br /&gt;
===Usage and Capabilities===&lt;br /&gt;
&lt;br /&gt;
Checking of the current buffer can be performed using 'C-c C-c'.  A&lt;br /&gt;
summary of all warnings located will be provided in a separate buffer.&lt;br /&gt;
Point can be jumped to the next and previous warning using 'C-c C-f'&lt;br /&gt;
(or 'C-x `') and 'C-c C-b', respectively.  For visibility,&lt;br /&gt;
warnings in the checked WML buffer will be underlined in red by default.&lt;br /&gt;
Note: Warning underlines may not be available in XEmacs.&lt;br /&gt;
&lt;br /&gt;
The WML checking built-in to Wesnoth Mode is not intended to&lt;br /&gt;
be an alternative to tools such as `wmllint', but may often be a&lt;br /&gt;
convenient substitute while editing WML.&lt;br /&gt;
&lt;br /&gt;
The following conditions can be detected by WML checking in Wesnoth&lt;br /&gt;
Mode:&lt;br /&gt;
* Correct nesting of tags and preprocessor statements&lt;br /&gt;
* Known macro definitions (1)&lt;br /&gt;
* Availability of elements within the given context&lt;br /&gt;
* Arguments are given to preprocessor statements when required&lt;br /&gt;
* Attributes have a value assigned&lt;br /&gt;
* Corresponding FOREACH..NEXT pairs&lt;br /&gt;
&lt;br /&gt;
WML checking is specific to the version of WML known by Wesnoth Mode. See [[#Wesnoth Update|Wesnoth Update]] for more information.&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) [[#Macro Definitions|Macro Definitions]]&lt;br /&gt;
&lt;br /&gt;
==Customisation==&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
The style of indentation can be customised using&lt;br /&gt;
'wesnoth-indent-savefile'.  The default value is 'non-nil', which&lt;br /&gt;
results in all children being indented a level deeper than their&lt;br /&gt;
parent.  When set to 'nil', children will be indented to the same level&lt;br /&gt;
as their parent element.  This option is provided only for consistency&lt;br /&gt;
when editing (very) old WML.  It is recommended that all new code be&lt;br /&gt;
written using the new convention.&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode will attempt indentation of the current line&lt;br /&gt;
and create a newline and when 'RET' or 'C-j' are used.&lt;br /&gt;
'wesnoth-auto-indent-flag' controls whether Wesnoth Mode will attempt&lt;br /&gt;
to indent the current line automatically.  Setting this to 'nil' will&lt;br /&gt;
prevent automatic indentation.  Note that this does not affect the&lt;br /&gt;
behaviour of 'C-j' performing indentation following the newline; this&lt;br /&gt;
only determines whether indentation will be automatically performed on&lt;br /&gt;
the current line.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-base-indent' controls the depth of indentation for each&lt;br /&gt;
level.  Its value should be an integer.  This is set to '4' by default,&lt;br /&gt;
which is the convention used when indenting WML.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-warning-face' is the face used to display the overlay for&lt;br /&gt;
warnings detected when checking WML (See @ref{Checking WML}).  By&lt;br /&gt;
default this is a red underline.  Use of this face may not be supported&lt;br /&gt;
under XEmacs.&lt;br /&gt;
&lt;br /&gt;
===Wesnoth Update===&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode uses WML as in Wesnoth 1.5.6, but the version of WML used can be changed using Wesnoth Update.  Wesnoth Update controls the known WML data for Wesnoth Mode.  To update this information, three variables need to be set appropriately:&lt;br /&gt;
'wesnoth-root-directory', 'wesnoth-update-output-directory' and&lt;br /&gt;
'wesnoth-addition-file'.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-root-directory' should be the path to the root directory of&lt;br /&gt;
a Wesnoth installation or Wesnoth source code.  Wesnoth Update will&lt;br /&gt;
search recursively in this directory for WML, using the information&lt;br /&gt;
found to provide context-sensitive completion and WML checking.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-update-output-directory' specifies the path to store the&lt;br /&gt;
WML data found.  This path should be within the 'load-path', and&lt;br /&gt;
preferably, in the same directory as Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-addition-file' specifies the 'addition file' to use.  An&lt;br /&gt;
addition file is an outline of a valid WML file which is processed for&lt;br /&gt;
additional element data.  This should be set as the path a suitable&lt;br /&gt;
addition file.  A sample addition file is included with Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 (setq wesnoth-root-directory &amp;quot;/usr/local/share/wesnoth/&amp;quot;&lt;br /&gt;
       wesnoth-addition-file&lt;br /&gt;
       &amp;quot;~/.emacs.d/wesnoth-mode/wesnoth-wml-additions.cfg&amp;quot;&lt;br /&gt;
       wesnoth-update-output-directory &amp;quot;~/.emacs.d/wesnoth-mode/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Once set, 'M-x wesnoth-update' will generate and load a new cache of&lt;br /&gt;
WML data ready for use for the current and future sessions.  (Please&lt;br /&gt;
note, 'wesnoth-update' may take some time to run.)&lt;br /&gt;
&lt;br /&gt;
===Macro Definitions===&lt;br /&gt;
&lt;br /&gt;
While built-in macros are always available, local macro definitions are&lt;br /&gt;
automatically scanned and made known to Wesnoth Mode for each WML file&lt;br /&gt;
which is loaded in the session. 'C-c C-u' can be used to update the&lt;br /&gt;
known macro definitions for any buffer which has since been modified.&lt;br /&gt;
(Note that this is not required when the macro is defined in the WML&lt;br /&gt;
file currently being edited as such definitions will be automatically&lt;br /&gt;
updated when needed.)  'C-u C-c C-u' can be used to clear known local&lt;br /&gt;
macro definitions.&lt;/div&gt;</summary>
		<author><name>Wildpenguin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27620</id>
		<title>Wesnoth Mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27620"/>
		<updated>2008-12-17T10:26:46Z</updated>

		<summary type="html">&lt;p&gt;Wildpenguin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is a major mode for Emacs which assists in the editing of&lt;br /&gt;
the markup language extensively used in Wesnoth, a turn-based fantasy&lt;br /&gt;
strategy game.  From the Wesnoth Wiki: &amp;quot;The Wesnoth Markup Language&lt;br /&gt;
(WML) is used to code almost everything in Wesnoth, including&lt;br /&gt;
scenarios, units, savefiles, and the user interface layout.&amp;quot; (1)&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is supported under GNU Emacs 21 onwards and (with some&lt;br /&gt;
minor limitations) XEmacs 21.  Wesnoth Mode adds support for syntax&lt;br /&gt;
highlighting, automatic indentation, context-sensitive completion,&lt;br /&gt;
checking and much more when editing WML.&lt;br /&gt;
&lt;br /&gt;
This documentation attempts to provide a comprehensive guide to&lt;br /&gt;
functionality available within Wesnoth Mode 1.3.3, and assumes you are&lt;br /&gt;
familiar with basic usage, terminology and customisation of Emacs.  For&lt;br /&gt;
more information, please refer to the Emacs manual. (2)&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) http://www.wesnoth.org/wiki/ReferenceWML&lt;br /&gt;
 (2) http://www.gnu.org/software/emacs/manual/html_node/emacs/&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
&lt;br /&gt;
To use Wesnoth Mode, add the following to your '.emacs':&lt;br /&gt;
     (add-to-list 'load-path &amp;quot;path/to/wesnoth-mode&amp;quot;)&lt;br /&gt;
     (autoload 'wesnoth-mode &amp;quot;wesnoth-mode&amp;quot; &amp;quot;Major mode for editing WML.&amp;quot; t)&lt;br /&gt;
Optionally adding:&lt;br /&gt;
     (add-to-list 'auto-mode-alist '(&amp;quot;\\.cfg\\'&amp;quot; . wesnoth-mode))&lt;br /&gt;
to automatically load Wesnoth Mode for all files with a .cfg&lt;br /&gt;
extension.&lt;br /&gt;
&lt;br /&gt;
If Wesnoth Mode is not the currently active major-mode for the&lt;br /&gt;
current buffer, it can be started via 'M-x wesnoth-mode'.&lt;br /&gt;
&lt;br /&gt;
The latest version of Wesnoth Mode along with release notes can be&lt;br /&gt;
found at http://www.wesnoth.org/forum/viewtopic.php?t=13798.&lt;br /&gt;
&lt;br /&gt;
==Navigation==&lt;br /&gt;
&lt;br /&gt;
===Navigation Introduction===&lt;br /&gt;
&lt;br /&gt;
Emacs provides many powerful built-in navigation commands which are&lt;br /&gt;
ideal for editing WML.  Common navigation commands, such as 'C-n',&lt;br /&gt;
'C-s', and (in recent Emacsen) 'M-g g', will behave as usual within&lt;br /&gt;
Wesnoth Mode.  However, some navigation commands have been adjusted or&lt;br /&gt;
added for increased productivity.  These will be explained in the&lt;br /&gt;
following sections.&lt;br /&gt;
&lt;br /&gt;
===Moving Across Elements===&lt;br /&gt;
&lt;br /&gt;
Next and previous opening elements can be navigated using 'C-M-e' and&lt;br /&gt;
'C-M-a', respectively.  In each case, point will be positioned&lt;br /&gt;
immediately before the element.  When there are no more elements are&lt;br /&gt;
available in that direction, point will not move.&lt;br /&gt;
&lt;br /&gt;
===Matching Elements===&lt;br /&gt;
&lt;br /&gt;
Moving to the matching element in a pair or locating the parent element&lt;br /&gt;
(depending on the position of point) can be performed via 'C-c C-o'.&lt;br /&gt;
When point is on the same line as an opening element, such as an opening&lt;br /&gt;
tag or opening preprocessor statement it will be moved to the start of&lt;br /&gt;
the matching closing element.  Otherwise, the jump will position point&lt;br /&gt;
at the beginning of the corresponding opening element.&lt;br /&gt;
&lt;br /&gt;
==Inserting Elements==&lt;br /&gt;
&lt;br /&gt;
===Standard Completion===&lt;br /&gt;
&lt;br /&gt;
Tags can be inserted via 'C-c C-t' and alternatively 'M-TAB' (when&lt;br /&gt;
this is not shadowed by the Window Manager, etc.).  This will prompt&lt;br /&gt;
for the tag to add.  The tag entered into the mini-buffer prompt and&lt;br /&gt;
its matching closing tag will be inserted and point positioned between.&lt;br /&gt;
&lt;br /&gt;
Attributes can be inserted via 'C-c C-a'.  The attribute entered at&lt;br /&gt;
the prompt will be inserted along with the '=', with point immediately&lt;br /&gt;
after.&lt;br /&gt;
&lt;br /&gt;
Both tag and attribute completion is context-sensitive.  If an&lt;br /&gt;
element is available in WML and not listed for completion, you may want&lt;br /&gt;
to add it to your 'addition file'.  See [[#Wesnoth Update|Wesnoth Update]] for more&lt;br /&gt;
information.&lt;br /&gt;
&lt;br /&gt;
Macro insertion can be performed via 'C-c C-m'.  Any arguments known&lt;br /&gt;
to be required for the macro will be prompted and inserted in order.&lt;br /&gt;
Insertion will be aborted if no value for an argument is provided.  When&lt;br /&gt;
within a macro definition, macro arguments are also available to be&lt;br /&gt;
inserted.  Project-local macros will not be available until Wesnoth Mode&lt;br /&gt;
has scanned the buffer in which they are defined.  For information on&lt;br /&gt;
completing project-local macros, see [[#Macro Definitions|Macro Definitions]].&lt;br /&gt;
&lt;br /&gt;
Preprocessor statements are available for insertion via 'C-c C-p'.&lt;br /&gt;
Closing elements for preprocessor statements will be automatically&lt;br /&gt;
inserted where possible, with point positioned between.  Otherwise,&lt;br /&gt;
point will be placed immediately after the inserted text.&lt;br /&gt;
&lt;br /&gt;
===Tab-Completion===&lt;br /&gt;
&lt;br /&gt;
Completion can also be performed immediately within the buffer via&lt;br /&gt;
'TAB' on a partial element.  For example:&lt;br /&gt;
     [scenario]&lt;br /&gt;
         vil-!-&lt;br /&gt;
Where '-!-' is the position of point.  Using 'TAB' in the example&lt;br /&gt;
will complete to 'vil' to 'village_gold='.  Tags, macros and&lt;br /&gt;
preprocessor statements can be completed similarly.  When the&lt;br /&gt;
current line does not contain a partially completed element, 'TAB'&lt;br /&gt;
will perform indentation on the current line.&lt;br /&gt;
&lt;br /&gt;
When there is more than one possible completion, a minibuffer prompt&lt;br /&gt;
will be provided, with the partial element entered.  'TAB' can be used&lt;br /&gt;
here to perform completion.  If multiple matches are available,&lt;br /&gt;
completion will be performed up to the smallest common substring with&lt;br /&gt;
further completion available via the minubuffer prompt.  When no matches&lt;br /&gt;
are found, completion will not be prompted.&lt;br /&gt;
&lt;br /&gt;
When completing opening preprocessor statements and tags, Wesnoth&lt;br /&gt;
Mode will also attempt to insert a matching closing element if one is&lt;br /&gt;
not already available, acting in much the same way as if the element was&lt;br /&gt;
added via the minibuffer prompt.  However, if an matching closing&lt;br /&gt;
element is available, only the element at point will be completed.&lt;br /&gt;
&lt;br /&gt;
A numeric argument can be provided when performing tab-completion of&lt;br /&gt;
opening elements to wrap around the following n blocks.  For example,&lt;br /&gt;
to wrap the completed opening and closing pair around the next three&lt;br /&gt;
blocks, 'C-u 3 TAB' can be used.  Refer to [[#Wrapping Elements|Wrapping Elements]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Wrapping Elements===&lt;br /&gt;
&lt;br /&gt;
When inserting tags and some preprocessor statements, either via their&lt;br /&gt;
respective insertion command or via 'TAB', an optional numeric argument&lt;br /&gt;
can be provided to specify the number of 'blocks' to wrap the element&lt;br /&gt;
around.  For example:&lt;br /&gt;
&lt;br /&gt;
     [multiplayer]&lt;br /&gt;
      -!-[part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [event]&lt;br /&gt;
             ...&lt;br /&gt;
&lt;br /&gt;
Where point is at the position indicated by '-!-'.  A pair of&lt;br /&gt;
'story' tags can be inserted around both existing 'part' tags using&lt;br /&gt;
'C-u 2 C-c C-t story'.  When the number of blocks specified to wrap&lt;br /&gt;
around exceeds the number of blocks available, Wesnoth Mode will only&lt;br /&gt;
wrap around the number of available so that the nesting of elements is&lt;br /&gt;
correct.&lt;br /&gt;
&lt;br /&gt;
===Missing Elements===&lt;br /&gt;
&lt;br /&gt;
Missing closing elements can be inserted using 'C-c C-/'.  By default,&lt;br /&gt;
this will insert the first missing closing element found in the current&lt;br /&gt;
buffer at point.  If all elements appear to be matched or if there is&lt;br /&gt;
an excess of closing tags, an appropriate message will be displayed in&lt;br /&gt;
the echo area.&lt;br /&gt;
&lt;br /&gt;
==Checking WML==&lt;br /&gt;
&lt;br /&gt;
===Usage and Capabilities===&lt;br /&gt;
&lt;br /&gt;
Checking of the current buffer can be performed using @kbd{C-c C-c}.  A&lt;br /&gt;
summary of all warnings located will be provided in a separate buffer.&lt;br /&gt;
Point can be jumped to the next and previous warning using 'C-c C-f'&lt;br /&gt;
(or 'C-x `') and 'C-c C-b', respectively.  For visibility,&lt;br /&gt;
warnings in the checked WML buffer will be underlined in red by default.&lt;br /&gt;
Note: Warning underlines may not be available in XEmacs.&lt;br /&gt;
&lt;br /&gt;
The WML checking built-in to Wesnoth Mode is not intended to&lt;br /&gt;
be an alternative to tools such as `wmllint', but may often be a&lt;br /&gt;
convenient substitute while editing WML.&lt;br /&gt;
&lt;br /&gt;
The following conditions can be detected by WML checking in Wesnoth&lt;br /&gt;
Mode:&lt;br /&gt;
* Correct nesting of tags and preprocessor statements&lt;br /&gt;
* Known macro definitions (1)&lt;br /&gt;
* Availability of elements within the given context&lt;br /&gt;
* Arguments are given to preprocessor statements when required&lt;br /&gt;
* Attributes have a value assigned&lt;br /&gt;
* Corresponding FOREACH..NEXT pairs&lt;br /&gt;
&lt;br /&gt;
WML checking is specific to the version of WML known by Wesnoth Mode. See [[#Wesnoth Update|Wesnoth Update]] for more information.&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) [[#Macro Definitions|Macro Definitions]]&lt;br /&gt;
&lt;br /&gt;
==Customisation==&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
The style of indentation can be customised using&lt;br /&gt;
'wesnoth-indent-savefile'.  The default value is 'non-nil', which&lt;br /&gt;
results in all children being indented a level deeper than their&lt;br /&gt;
parent.  When set to 'nil', children will be indented to the same level&lt;br /&gt;
as their parent element.  This option is provided only for consistency&lt;br /&gt;
when editing (very) old WML.  It is recommended that all new code be&lt;br /&gt;
written using the new convention.&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode will attempt indentation of the current line&lt;br /&gt;
and create a newline and when 'RET' or 'C-j' are used.&lt;br /&gt;
'wesnoth-auto-indent-flag' controls whether Wesnoth Mode will attempt&lt;br /&gt;
to indent the current line automatically.  Setting this to 'nil' will&lt;br /&gt;
prevent automatic indentation.  Note that this does not affect the&lt;br /&gt;
behaviour of 'C-j' performing indentation following the newline; this&lt;br /&gt;
only determines whether indentation will be automatically performed on&lt;br /&gt;
the current line.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-base-indent' controls the depth of indentation for each&lt;br /&gt;
level.  Its value should be an integer.  This is set to '4' by default,&lt;br /&gt;
which is the convention used when indenting WML.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-warning-face' is the face used to display the overlay for&lt;br /&gt;
warnings detected when checking WML (See @ref{Checking WML}).  By&lt;br /&gt;
default this is a red underline.  Use of this face may not be supported&lt;br /&gt;
under XEmacs.&lt;br /&gt;
&lt;br /&gt;
===Wesnoth Update===&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode uses WML as in Wesnoth 1.5.6, but the version of WML used can be changed using Wesnoth Update.  Wesnoth Update controls the known WML data for Wesnoth Mode.  To update this information, three variables need to be set appropriately:&lt;br /&gt;
'wesnoth-root-directory', 'wesnoth-update-output-directory' and&lt;br /&gt;
'wesnoth-addition-file'.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-root-directory' should be the path to the root directory of&lt;br /&gt;
a Wesnoth installation or Wesnoth source code.  Wesnoth Update will&lt;br /&gt;
search recursively in this directory for WML, using the information&lt;br /&gt;
found to provide context-sensitive completion and WML checking.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-update-output-directory' specifies the path to store the&lt;br /&gt;
WML data found.  This path should be within the 'load-path', and&lt;br /&gt;
preferably, in the same directory as Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-addition-file' specifies the 'addition file' to use.  An&lt;br /&gt;
addition file is an outline of a valid WML file which is processed for&lt;br /&gt;
additional element data.  This should be set as the path a suitable&lt;br /&gt;
addition file.  A sample addition file is included with Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 (setq wesnoth-root-directory &amp;quot;/usr/local/share/wesnoth/&amp;quot;&lt;br /&gt;
       wesnoth-addition-file&lt;br /&gt;
       &amp;quot;~/.emacs.d/wesnoth-mode/wesnoth-wml-additions.cfg&amp;quot;&lt;br /&gt;
       wesnoth-update-output-directory &amp;quot;~/.emacs.d/wesnoth-mode/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Once set, 'M-x wesnoth-update' will generate and load a new cache of&lt;br /&gt;
WML data ready for use for the current and future sessions.  (Please&lt;br /&gt;
note, 'wesnoth-update' may take some time to run.)&lt;br /&gt;
&lt;br /&gt;
===Macro Definitions===&lt;br /&gt;
&lt;br /&gt;
While built-in macros are always available, local macro definitions are&lt;br /&gt;
automatically scanned and made known to Wesnoth Mode for each WML file&lt;br /&gt;
which is loaded in the session. 'C-c C-u' can be used to update the&lt;br /&gt;
known macro definitions for any buffer which has since been modified.&lt;br /&gt;
(Note that this is not required when the macro is defined in the WML&lt;br /&gt;
file currently being edited as such definitions will be automatically&lt;br /&gt;
updated when needed.)  'C-u C-c C-u' can be used to clear known local&lt;br /&gt;
macro definitions.&lt;/div&gt;</summary>
		<author><name>Wildpenguin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27603</id>
		<title>Wesnoth Mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27603"/>
		<updated>2008-12-15T10:14:03Z</updated>

		<summary type="html">&lt;p&gt;Wildpenguin: Documentation updated for upcoming release&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is a major mode for Emacs which assists in the editing of&lt;br /&gt;
the markup language extensively used in Wesnoth, a turn-based fantasy&lt;br /&gt;
strategy game.  From the Wesnoth Wiki: &amp;quot;The Wesnoth Markup Language&lt;br /&gt;
(WML) is used to code almost everything in Wesnoth, including&lt;br /&gt;
scenarios, units, savefiles, and the user interface layout.&amp;quot; (1)&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is supported under GNU Emacs 21 onwards and (with some&lt;br /&gt;
minor limitations) XEmacs 21.  Wesnoth Mode adds support for syntax&lt;br /&gt;
highlighting, automatic indentation, context-sensitive completion,&lt;br /&gt;
checking and much more when editing WML.&lt;br /&gt;
&lt;br /&gt;
This documentation attempts to provide a comprehensive guide to&lt;br /&gt;
functionality available within Wesnoth Mode 1.3.3, and assumes you are&lt;br /&gt;
familiar with basic usage, terminology and customisation of Emacs.  For&lt;br /&gt;
more information, please refer to the Emacs manual. (2)&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) http://www.wesnoth.org/wiki/ReferenceWML&lt;br /&gt;
 (2) http://www.gnu.org/software/emacs/manual/html_node/emacs/&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
&lt;br /&gt;
To use Wesnoth Mode, add the following to your '.emacs':&lt;br /&gt;
     (add-to-list 'load-path &amp;quot;path/to/wesnoth-mode&amp;quot;)&lt;br /&gt;
     (autoload 'wesnoth-mode &amp;quot;wesnoth-mode&amp;quot; &amp;quot;Major mode for editing WML.&amp;quot; t)&lt;br /&gt;
Optionally adding:&lt;br /&gt;
     (add-to-list 'auto-mode-alist '(&amp;quot;\\.cfg\\'&amp;quot; . wesnoth-mode))&lt;br /&gt;
to automatically load Wesnoth Mode for all files with a .cfg&lt;br /&gt;
extension.&lt;br /&gt;
&lt;br /&gt;
If Wesnoth Mode is not the currently active major-mode for the&lt;br /&gt;
current buffer, it can be started via 'M-x wesnoth-mode'.&lt;br /&gt;
&lt;br /&gt;
The latest version of Wesnoth Mode along with release notes can be&lt;br /&gt;
found at http://www.wesnoth.org/forum/viewtopic.php?t=13798.&lt;br /&gt;
&lt;br /&gt;
==Navigation==&lt;br /&gt;
&lt;br /&gt;
===Navigation Introduction===&lt;br /&gt;
&lt;br /&gt;
Emacs provides many powerful built-in navigation commands which are&lt;br /&gt;
ideal for editing WML.  Common navigation commands, such as 'C-n',&lt;br /&gt;
'C-s', and (in recent Emacsen) 'M-g g', will behave as usual within&lt;br /&gt;
Wesnoth Mode.  However, some navigation commands have been adjusted or&lt;br /&gt;
added for increased productivity.  These will be explained in the&lt;br /&gt;
following sections.&lt;br /&gt;
&lt;br /&gt;
===Moving Across Elements===&lt;br /&gt;
&lt;br /&gt;
Next and previous opening elements can be navigated using 'C-M-e' and&lt;br /&gt;
'C-M-a', respectively.  In each case, point will be positioned&lt;br /&gt;
immediately before the element.  When there are no more elements are&lt;br /&gt;
available in that direction, point will not move.&lt;br /&gt;
&lt;br /&gt;
===Matching Elements===&lt;br /&gt;
&lt;br /&gt;
Moving to the matching element in a pair or locating the parent element&lt;br /&gt;
(depending on the position of point) can be performed via 'C-c C-o'.&lt;br /&gt;
When point is on the same line as an opening element, such as an opening&lt;br /&gt;
tag or opening preprocessor statement it will be moved to the start of&lt;br /&gt;
the matching closing element.  Otherwise, the jump will position point&lt;br /&gt;
at the beginning of the corresponding opening element.&lt;br /&gt;
&lt;br /&gt;
==Inserting Elements==&lt;br /&gt;
&lt;br /&gt;
===Standard Completion===&lt;br /&gt;
&lt;br /&gt;
Tags can be inserted via 'C-c C-t' and alternatively 'M-TAB' (when&lt;br /&gt;
this is not shadowed by the Window Manager, etc.).  This will prompt&lt;br /&gt;
for the tag to add.  The tag entered into the mini-buffer prompt and&lt;br /&gt;
its matching closing tag will be inserted and point positioned between.&lt;br /&gt;
&lt;br /&gt;
Attributes can be inserted via 'C-c C-a'.  The attribute entered at&lt;br /&gt;
the prompt will be inserted along with the '=', with point immediately&lt;br /&gt;
after.&lt;br /&gt;
&lt;br /&gt;
Both tag and attribute completion is context-sensitive.  If an&lt;br /&gt;
element is available in WML and not listed for completion, you may want&lt;br /&gt;
to add it to your 'addition file'.  See [[#Wesnoth Update|Wesnoth Update]] for more&lt;br /&gt;
information.&lt;br /&gt;
&lt;br /&gt;
Macro insertion can be performed via 'C-c C-m'.  Any arguments known&lt;br /&gt;
to be required for the macro will be prompted and inserted in order.&lt;br /&gt;
Insertion will be aborted if no value for an argument is provided.  When&lt;br /&gt;
within a macro definition, macro arguments are also available to be&lt;br /&gt;
inserted.  Project-local macros will not be available until Wesnoth Mode&lt;br /&gt;
has scanned the buffer in which they are defined.  For information on&lt;br /&gt;
completing project-local macros, see [[#Macro Definitions|Macro Definitions]].&lt;br /&gt;
&lt;br /&gt;
Preprocessor statements are available for insertion via 'C-c C-p'.&lt;br /&gt;
Closing elements for preprocessor statements will be automatically&lt;br /&gt;
inserted where possible, with point positioned between.  Otherwise,&lt;br /&gt;
point will be placed immediately after the inserted text.&lt;br /&gt;
&lt;br /&gt;
===Tab-Completion===&lt;br /&gt;
&lt;br /&gt;
Completion can also be performed immediately within the buffer via&lt;br /&gt;
'TAB' on a partial element.  For example:&lt;br /&gt;
     [scenario]&lt;br /&gt;
         vil-!-&lt;br /&gt;
Where '-!-' is the position of point.  Using 'TAB' in the example&lt;br /&gt;
will complete to 'vil' to 'village_gold='.  Tags, macros and&lt;br /&gt;
preprocessor statements can be completed similarly.  When the&lt;br /&gt;
current line does not contain a partially completed element, 'TAB'&lt;br /&gt;
will perform indentation on the current line.&lt;br /&gt;
&lt;br /&gt;
When there is more than one possible completion, a minibuffer prompt&lt;br /&gt;
will be provided, with the partial element entered.  'TAB' can be used&lt;br /&gt;
here to perform completion.  If multiple matches are available,&lt;br /&gt;
completion will be performed up to the smallest common substring with&lt;br /&gt;
further completion available via the minubuffer prompt.  When no matches&lt;br /&gt;
are found, completion will not be prompted.&lt;br /&gt;
&lt;br /&gt;
When completing opening preprocessor statements and tags, Wesnoth&lt;br /&gt;
Mode will also attempt to insert a matching closing element if one is&lt;br /&gt;
not already available, acting in much the same way as if the element was&lt;br /&gt;
added via the minibuffer prompt.  However, if an matching closing&lt;br /&gt;
element is available, only the element at point will be completed.&lt;br /&gt;
&lt;br /&gt;
A numeric argument can be provided when performing tab-completion of&lt;br /&gt;
opening elements to wrap around the following n blocks.  For example,&lt;br /&gt;
to wrap the completed opening and closing pair around the next three&lt;br /&gt;
blocks, 'C-u 3 TAB' can be used.  Refer to [[#Wrapping Elements|Wrapping Elements]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Wrapping Elements===&lt;br /&gt;
&lt;br /&gt;
When inserting tags and some preprocessor statements, either via their&lt;br /&gt;
respective insertion command or via 'TAB', an optional numeric argument&lt;br /&gt;
can be provided to specify the number of 'blocks' to wrap the element&lt;br /&gt;
around.  For example:&lt;br /&gt;
&lt;br /&gt;
     [multiplayer]&lt;br /&gt;
      -!-[part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [event]&lt;br /&gt;
             ...&lt;br /&gt;
&lt;br /&gt;
Where point is at the position indicated by '-!-'.  A pair of&lt;br /&gt;
'story' tags can be inserted around both existing 'part' tags using&lt;br /&gt;
'C-u 2 C-c C-t story'.  When the number of blocks specified to wrap&lt;br /&gt;
around exceeds the number of blocks available, Wesnoth Mode will only&lt;br /&gt;
wrap around the number of available so that the nesting of elements is&lt;br /&gt;
correct.&lt;br /&gt;
&lt;br /&gt;
===Missing Elements===&lt;br /&gt;
&lt;br /&gt;
Missing closing elements can be inserted using 'C-c C-/'.  By default,&lt;br /&gt;
this will insert the first missing closing element found in the current&lt;br /&gt;
buffer at point.  If all elements appear to be matched or if there is&lt;br /&gt;
an excess of closing tags, an appropriate message will be displayed in&lt;br /&gt;
the echo area.&lt;br /&gt;
&lt;br /&gt;
==Checking WML==&lt;br /&gt;
&lt;br /&gt;
===Usage and Capabilities===&lt;br /&gt;
&lt;br /&gt;
Checking of the current buffer can be performed using @kbd{C-c C-c}.  A&lt;br /&gt;
summary of all warnings located will be provided in a separate buffer.&lt;br /&gt;
Point can be jumped to the next and previous warning using @kbd{C-c C-f}&lt;br /&gt;
(or @kbd{C-x `}) and @kbd{C-c C-b}, respectively.  For visibility,&lt;br /&gt;
warnings in the checked WML buffer will be underlined in red by default.&lt;br /&gt;
Note: Warning underlines may not be available in XEmacs.&lt;br /&gt;
&lt;br /&gt;
The WML checking built-in to Wesnoth Mode is not intended to&lt;br /&gt;
be an alternative to tools such as `wmllint', but may often be a&lt;br /&gt;
convenient substitute while editing WML.&lt;br /&gt;
&lt;br /&gt;
The following conditions can be detected by WML checking in Wesnoth&lt;br /&gt;
Mode:&lt;br /&gt;
* Correct nesting of tags and preprocessor statements&lt;br /&gt;
* Known macro definitions (1)&lt;br /&gt;
* Availability of elements within the given context&lt;br /&gt;
* Arguments are given to preprocessor statements when required&lt;br /&gt;
* Attributes have a value assigned&lt;br /&gt;
* Corresponding FOREACH..NEXT pairs&lt;br /&gt;
&lt;br /&gt;
WML checking is specific to the version of WML known by Wesnoth Mode. See [[#Wesnoth Update|Wesnoth Update]] for more information.&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) [[#Macro Definitions|Macro Definitions]]&lt;br /&gt;
&lt;br /&gt;
==Customisation==&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
The style of indentation can be customised using&lt;br /&gt;
'wesnoth-indent-savefile'.  The default value is 'non-nil', which&lt;br /&gt;
results in all children being indented a level deeper than their&lt;br /&gt;
parent.  When set to 'nil', children will be indented to the same level&lt;br /&gt;
as their parent element.  This option is provided only for consistency&lt;br /&gt;
when editing (very) old WML.  It is recommended that all new code be&lt;br /&gt;
written using the new convention.&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode will attempt indentation of the current line&lt;br /&gt;
and create a newline and when 'RET' or 'C-j' are used.&lt;br /&gt;
'wesnoth-auto-indent-flag' controls whether Wesnoth Mode will attempt&lt;br /&gt;
to indent the current line automatically.  Setting this to 'nil' will&lt;br /&gt;
prevent automatic indentation.  Note that this does not affect the&lt;br /&gt;
behaviour of 'C-j' performing indentation following the newline; this&lt;br /&gt;
only determines whether indentation will be automatically performed on&lt;br /&gt;
the current line.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-base-indent' controls the depth of indentation for each&lt;br /&gt;
level.  Its value should be an integer.  This is set to '4' by default,&lt;br /&gt;
which is the convention used when indenting WML.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-warning-face' is the face used to display the overlay for&lt;br /&gt;
warnings detected when checking WML (See @ref{Checking WML}).  By&lt;br /&gt;
default this is a red underline.  Use of this face may not be supported&lt;br /&gt;
under XEmacs.&lt;br /&gt;
&lt;br /&gt;
===Wesnoth Update===&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode uses WML as in Wesnoth 1.5.6, but the version of WML used can be changed using Wesnoth Update.  Wesnoth Update controls the known WML data for Wesnoth Mode.  To update this information, three variables need to be set appropriately:&lt;br /&gt;
'wesnoth-root-directory', 'wesnoth-update-output-directory' and&lt;br /&gt;
'wesnoth-addition-file'.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-root-directory' should be the path to the root directory of&lt;br /&gt;
a Wesnoth installation or Wesnoth source code.  Wesnoth Update will&lt;br /&gt;
search recursively in this directory for WML, using the information&lt;br /&gt;
found to provide context-sensitive completion and WML checking.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-update-output-directory' specifies the path to store the&lt;br /&gt;
WML data found.  This path should be within the 'load-path', and&lt;br /&gt;
preferably, in the same directory as Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-addition-file' specifies the 'addition file' to use.  An&lt;br /&gt;
addition file is an outline of a valid WML file which is processed for&lt;br /&gt;
additional element data.  This should be set as the path a suitable&lt;br /&gt;
addition file.  A sample addition file is included with Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 (setq wesnoth-root-directory &amp;quot;/usr/local/share/wesnoth/&amp;quot;&lt;br /&gt;
       wesnoth-addition-file&lt;br /&gt;
       &amp;quot;~/.emacs.d/wesnoth-mode/wesnoth-wml-additions.cfg&amp;quot;&lt;br /&gt;
       wesnoth-update-output-directory &amp;quot;~/.emacs.d/wesnoth-mode/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Once set, 'M-x wesnoth-update' will generate and load a new cache of&lt;br /&gt;
WML data ready for use for the current and future sessions.  (Please&lt;br /&gt;
note, 'wesnoth-update' may take some time to run.)&lt;br /&gt;
&lt;br /&gt;
===Macro Definitions===&lt;br /&gt;
&lt;br /&gt;
While built-in macros are always available, local macro definitions are&lt;br /&gt;
automatically scanned and made known to Wesnoth Mode for each WML file&lt;br /&gt;
which is loaded in the session. 'C-c C-u' can be used to update the&lt;br /&gt;
known macro definitions for any buffer which has since been modified.&lt;br /&gt;
(Note that this is not required when the macro is defined in the WML&lt;br /&gt;
file currently being edited as such definitions will be automatically&lt;br /&gt;
updated when needed.)  'C-u C-c C-u' can be used to clear known local&lt;br /&gt;
macro definitions.&lt;/div&gt;</summary>
		<author><name>Wildpenguin</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27277</id>
		<title>Wesnoth Mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Wesnoth_Mode&amp;diff=27277"/>
		<updated>2008-11-02T02:11:50Z</updated>

		<summary type="html">&lt;p&gt;Wildpenguin: New page: Wesnoth Mode documentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
===Summary===&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is a major mode for Emacs which assists in the editing of&lt;br /&gt;
the markup language extensively used in Wesnoth, a turn-based fantasy&lt;br /&gt;
strategy game.  From the Wesnoth Wiki: &amp;quot;The Wesnoth Markup Language&lt;br /&gt;
(WML) is used to code almost everything in Wesnoth, including&lt;br /&gt;
scenarios, units, savefiles, and the user interface layout.&amp;quot; (1)&lt;br /&gt;
&lt;br /&gt;
Wesnoth Mode is supported under GNU Emacs 22 and 21 and (with some&lt;br /&gt;
minor limitations) XEmacs 21.  Wesnoth Mode adds support for syntax&lt;br /&gt;
highlighting, automatic indentation, context-sensitive completion,&lt;br /&gt;
checking and much more when editing WML.&lt;br /&gt;
&lt;br /&gt;
This documentation attempts to provide a comprehensive guide to&lt;br /&gt;
functionality available within Wesnoth Mode, and assumes you are&lt;br /&gt;
familiar with basic usage, terminology and customisation of Emacs.  For&lt;br /&gt;
more information, please refer to the Emacs manual. (2)&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) http://www.wesnoth.org/wiki/ReferenceWML&lt;br /&gt;
 (2) http://www.gnu.org/software/emacs/manual/html_node/emacs/&lt;br /&gt;
&lt;br /&gt;
===Getting Started===&lt;br /&gt;
&lt;br /&gt;
To use Wesnoth Mode, add the following to your '.emacs':&lt;br /&gt;
     (add-to-list 'load-path &amp;quot;path/to/wesnoth-mode&amp;quot;)&lt;br /&gt;
     (autoload 'wesnoth-mode &amp;quot;wesnoth-mode&amp;quot; &amp;quot;Major mode for editing WML.&amp;quot; t)&lt;br /&gt;
Optionally adding:&lt;br /&gt;
     (add-to-list 'auto-mode-alist '(&amp;quot;\\.cfg\\'&amp;quot; . wesnoth-mode))&lt;br /&gt;
to automatically load Wesnoth Mode for all files with a .cfg&lt;br /&gt;
extension.&lt;br /&gt;
&lt;br /&gt;
If Wesnoth Mode is not the currently active major-mode for the&lt;br /&gt;
current buffer, it can be started via 'M-x wesnoth-mode'.&lt;br /&gt;
&lt;br /&gt;
The latest version of Wesnoth Mode along with release notes can be&lt;br /&gt;
found at http://www.wesnoth.org/forum/viewtopic.php?t=13798.&lt;br /&gt;
&lt;br /&gt;
==Navigation==&lt;br /&gt;
&lt;br /&gt;
===Navigation Introduction===&lt;br /&gt;
&lt;br /&gt;
Emacs provides many powerful built-in navigation commands which are&lt;br /&gt;
ideal for editing WML.  Common navigation commands, such as 'C-n',&lt;br /&gt;
'C-s', and (in recent Emacsen) 'M-g g', will behave as usual within&lt;br /&gt;
Wesnoth Mode.  However, some navigation commands have been adjusted or&lt;br /&gt;
added for increased productivity.  These will be explained in the&lt;br /&gt;
following sections.&lt;br /&gt;
&lt;br /&gt;
===Moving Across Elements===&lt;br /&gt;
&lt;br /&gt;
Next and previous opening elements can be navigated using 'C-M-e' and&lt;br /&gt;
'C-M-a', respectively.  In each case, point will be positioned&lt;br /&gt;
immediately before the element.  When there are no more elements are&lt;br /&gt;
available in that direction, point will not move.&lt;br /&gt;
&lt;br /&gt;
===Matching Elements===&lt;br /&gt;
&lt;br /&gt;
Moving to the matching element in a pair or locating the parent element&lt;br /&gt;
(depending on the position of point) can be performed via 'C-c C-o'.&lt;br /&gt;
When point is on the same line as an opening element, such as an opening&lt;br /&gt;
tag or opening preprocessor statement it will be moved to the start of&lt;br /&gt;
the matching closing element.  Otherwise, the jump will position point&lt;br /&gt;
at the beginning of the corresponding opening element.&lt;br /&gt;
&lt;br /&gt;
==Inserting Elements==&lt;br /&gt;
&lt;br /&gt;
===Standard Completion===&lt;br /&gt;
&lt;br /&gt;
Tags can be inserted via 'C-c C-t' and alternatively 'M-TAB' (assuming&lt;br /&gt;
this is not shadowed by the Window Manager, etc.).  This will prompt&lt;br /&gt;
for the tag to add.  The tag entered into the mini-buffer prompt and&lt;br /&gt;
its matching closing tag will be inserted and point positioned between.&lt;br /&gt;
&lt;br /&gt;
Attributes can be inserted via 'C-c C-a'.  The attribute entered at&lt;br /&gt;
the prompt will be inserted along with the '=', with point immediately&lt;br /&gt;
after.&lt;br /&gt;
&lt;br /&gt;
Both tag and attribute completion is context-sensitive.  If an&lt;br /&gt;
element is available in WML and not listed for completion, you may want&lt;br /&gt;
to add it to your 'addition file'.  See [[#Wesnoth Update|Wesnoth Update]] for more&lt;br /&gt;
information.&lt;br /&gt;
&lt;br /&gt;
Macro insertion can be performed via C-c C-m.  If the macro&lt;br /&gt;
entered is known to require arguments, point will be positioned before&lt;br /&gt;
the closing curly bracket ready to input any arguments, otherwise it&lt;br /&gt;
will be positioned immediately after.  When within a macro definition,&lt;br /&gt;
macro arguments are also available to be inserted.  Project-local macros&lt;br /&gt;
will not be available until Wesnoth Mode has scanned the buffer in which&lt;br /&gt;
they are defined.  For information on completing project-local macros,&lt;br /&gt;
see [[#Macro Definitions|Macro Definitions]].&lt;br /&gt;
&lt;br /&gt;
Preprocessor statements are available for insertion via 'C-c C-p'.&lt;br /&gt;
Closing elements for preprocessor statements will be automatically&lt;br /&gt;
inserted where possible, with point positioned between.  Otherwise,&lt;br /&gt;
point will be placed immediately after the inserted text.&lt;br /&gt;
&lt;br /&gt;
===Tab-Completion===&lt;br /&gt;
&lt;br /&gt;
Completion can also be performed immediately within the buffer via&lt;br /&gt;
'TAB' on a partial element.  For example:&lt;br /&gt;
     [scenario]&lt;br /&gt;
         vil-!-&lt;br /&gt;
Where '-!-' is the position of point.  Using 'TAB' in the example&lt;br /&gt;
will complete to 'vil' to 'village_gold='.  Tags, macros and&lt;br /&gt;
preprocessor statements can be completed similarly.&lt;br /&gt;
&lt;br /&gt;
When there is more than one possible completion, a mini-buffer prompt&lt;br /&gt;
will be provided, with the partial element entered.  'TAB' can be used&lt;br /&gt;
here to perform completion, and if no unique match is available,&lt;br /&gt;
provide a list of possible completions.&lt;br /&gt;
&lt;br /&gt;
When completing opening preprocessor statements and tags, Wesnoth&lt;br /&gt;
Mode will also attempt to insert a matching closing element if one is&lt;br /&gt;
not already available, acting in much the same way as if the element was&lt;br /&gt;
added via the mini-buffer prompt.  However, if an matching closing&lt;br /&gt;
element is available, only the element at point will be completed.&lt;br /&gt;
&lt;br /&gt;
A numeric argument can be provided when performing tab-completion of&lt;br /&gt;
opening elements to wrap around the following n blocks.  For example,&lt;br /&gt;
to wrap the completed opening and closing pair around the next three&lt;br /&gt;
blocks, 'C-u 3 TAB' can be used.  Refer to [[#Wrapping Elements|Wrapping Elements]] for more information.&lt;br /&gt;
&lt;br /&gt;
===Wrapping Elements===&lt;br /&gt;
&lt;br /&gt;
When inserting tags and some preprocessor statements, either via their&lt;br /&gt;
respective insertion command or via 'TAB', an optional numeric argument&lt;br /&gt;
can be provided to specify the number of 'blocks' to wrap the element&lt;br /&gt;
around.  For example, this was an outline of the buffer:&lt;br /&gt;
&lt;br /&gt;
     [multiplayer]&lt;br /&gt;
      -!-[part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [part]&lt;br /&gt;
             ...&lt;br /&gt;
         [/part]&lt;br /&gt;
         [event]&lt;br /&gt;
             ...&lt;br /&gt;
&lt;br /&gt;
Where point is at the position indicated by '-!-'.  A pair of&lt;br /&gt;
'story' tags can be inserted around both existing 'part' tags using&lt;br /&gt;
'C-u 2 C-c C-t story'.  When the number of blocks specified to wrap&lt;br /&gt;
around exceeds the number of blocks available, Wesnoth Mode will only&lt;br /&gt;
wrap around the number of available so that the nesting of elements is&lt;br /&gt;
correct.&lt;br /&gt;
&lt;br /&gt;
===Missing Elements===&lt;br /&gt;
&lt;br /&gt;
Missing closing elements can be inserted using 'C-c C-/'.  By default,&lt;br /&gt;
this will insert the first missing closing element found in the current&lt;br /&gt;
buffer at point.  If all elements appear to be matched or if there is&lt;br /&gt;
an excess of closing tags, an appropriate message will be displayed in&lt;br /&gt;
the echo area.&lt;br /&gt;
&lt;br /&gt;
 Note: The following paragraph does not apply to XEmacs.&lt;br /&gt;
&lt;br /&gt;
The region Wesnoth Mode checks for missing elements can be adjusted&lt;br /&gt;
enabling transient-mark-mode prior to inserting the missing element.  To&lt;br /&gt;
narrow the region checked, move to the start of the region and enable&lt;br /&gt;
transient-mark-mode (this is bound to 'C-Space C-Space' by default) ato&lt;br /&gt;
point temporarily by default.  Then move point to the location to insert&lt;br /&gt;
the missing element and use 'C-c C-/'.  The first missing tag located&lt;br /&gt;
in the region will be inserted at point.&lt;br /&gt;
&lt;br /&gt;
==Checking WML==&lt;br /&gt;
&lt;br /&gt;
===Usage and Capabilities===&lt;br /&gt;
&lt;br /&gt;
Checking of the current buffer can be performed using 'C-c C-c'.  Any&lt;br /&gt;
potential problems found will be reported in a separate buffer named&lt;br /&gt;
&amp;quot;*WML*&amp;quot;.  The WML checking built-in to Wesnoth Mode is not intended to&lt;br /&gt;
act as an alternative to tools such as 'wmllint', but may often be a&lt;br /&gt;
convenient substitute while editing WML.&lt;br /&gt;
&lt;br /&gt;
The following conditions can be detected by WML checking in Wesnoth&lt;br /&gt;
Mode:&lt;br /&gt;
* Correct tag / preprocessor nesting&lt;br /&gt;
* Known macro definitions (1)&lt;br /&gt;
* Availability of elements within the given context&lt;br /&gt;
* Arguments are given to preprocessor statements when required&lt;br /&gt;
* Whether attributes have been given a value&lt;br /&gt;
&lt;br /&gt;
When a problem has been found, Wesnoth Mode will provide the line&lt;br /&gt;
number and a description of the problem in the report.  WML checking is&lt;br /&gt;
specific to the version of WML known by Wesnoth Mode.  See [[#Wesnoth Update|Wesnoth Update]] for more information.&lt;br /&gt;
&lt;br /&gt;
 Footnotes&lt;br /&gt;
 (1) [[#Macro Definitions|Macro Definitions]]&lt;br /&gt;
&lt;br /&gt;
==Customisation==&lt;br /&gt;
&lt;br /&gt;
===Indentation===&lt;br /&gt;
&lt;br /&gt;
The style of indentation can be customised using&lt;br /&gt;
'wesnoth-indent-savefile'.  The default value is 'non-nil', which&lt;br /&gt;
results in all children being indented a level deeper than their&lt;br /&gt;
parent.  When set to 'nil', children will be indented to the same level&lt;br /&gt;
as their parent element.  This option is provided only for consistency&lt;br /&gt;
when editing (very) old WML.  It is recommended that all new code be&lt;br /&gt;
written using the 'savefile style'.&lt;br /&gt;
&lt;br /&gt;
By default, Wesnoth Mode will attempt indentation of the current line&lt;br /&gt;
and create a newline and when 'RET' or 'C-j' are used.&lt;br /&gt;
'wesnoth-auto-indent-flag' controls whether Wesnoth Mode will attempt&lt;br /&gt;
to indent the current line automatically.  Setting this to 'nil' will&lt;br /&gt;
prevent automatic indentation.  Note that this does not affect the&lt;br /&gt;
behaviour of 'C-j' performing indentation following the newline; this&lt;br /&gt;
only determines whether indentation will be automatically performed on&lt;br /&gt;
the current line.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-base-indent' controls the depth of indentation for each&lt;br /&gt;
level.  Its value should be an integer.  This is set to '4' by default,&lt;br /&gt;
which is the convention used when indenting WML.&lt;br /&gt;
&lt;br /&gt;
===Wesnoth Update===&lt;br /&gt;
&lt;br /&gt;
Wesnoth Update controls the known WML data for Wesnoth Mode.  To update&lt;br /&gt;
this information, three variables need to be set appropriately:&lt;br /&gt;
'wesnoth-root-directory', 'wesnoth-update-output-directory' and&lt;br /&gt;
'wesnoth-addition-file'.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-root-directory' should be the path to the root directory of&lt;br /&gt;
a Wesnoth installation or Wesnoth source code.  Wesnoth Update will&lt;br /&gt;
search recursively in this directory for WML, using the information&lt;br /&gt;
found to provide context-sensitive completion and WML checking.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-update-output-directory' specifies the path to store the&lt;br /&gt;
WML data found.  This path should be within the 'load-path', and&lt;br /&gt;
preferably, in the same directory as Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
'wesnoth-addition-file' specifies the 'addition file' to use.  An&lt;br /&gt;
addition file is an outline of a valid WML file which is processed for&lt;br /&gt;
additional element data.  This should be set as the path a suitable&lt;br /&gt;
addition file.  A sample addition file is included with Wesnoth Mode.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
 (setq wesnoth-root-directory &amp;quot;/usr/local/share/wesnoth/&amp;quot;&lt;br /&gt;
       wesnoth-addition-file&lt;br /&gt;
       &amp;quot;~/.emacs.d/wesnoth-mode/wesnoth-wml-additions.cfg&amp;quot;&lt;br /&gt;
       wesnoth-update-output-directory &amp;quot;~/.emacs.d/wesnoth-mode/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Once set, 'M-x wesnoth-update' will generate and load a new cache of&lt;br /&gt;
WML data ready for use for the current and future sessions.  (Please&lt;br /&gt;
note, 'wesnoth-update' may take some time to run.)&lt;br /&gt;
&lt;br /&gt;
===Macro Definitions===&lt;br /&gt;
&lt;br /&gt;
While built-in macros are always available, local macro definitions are&lt;br /&gt;
automatically scanned and made known to Wesnoth Mode for each WML file&lt;br /&gt;
which is loaded in the session. 'C-c C-u' can be used to update the&lt;br /&gt;
known macro definitions for any buffer which has since been modified.&lt;br /&gt;
(Note that this is not required when the macro is defined in the WML&lt;br /&gt;
file currently being edited as such definitions will be automatically&lt;br /&gt;
updated when needed.)  'C-u C-c C-u' can be used to clear known local&lt;br /&gt;
macro definitions.&lt;/div&gt;</summary>
		<author><name>Wildpenguin</name></author>
		
	</entry>
</feed>