1 ;; wesnoth-mode.el - A major mode for editing WML.
2 ;; Copyright (C) 2006, 2007 Chris Mann
4 ;; This program is free software; you can redistribute it and/or
5 ;; modify it under the terms of the GNU General Public License as
6 ;; published by the Free Software Foundation; either version 2 of the
7 ;; License, or (at your option) any later version.
9 ;; This program is distributed in the hope that it will be useful, but
10 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 ;; General Public License for more details.
14 ;; You should have received a copy of the GNU General Public License
15 ;; along with this program; see the file COPYING. If not, write to the
16 ;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
20 ;; wesnoth-mode is a major mode for Emacs which assists in the editing
21 ;; of Wesnoth Markup Language (WML) files. Currently, this mode
22 ;; features syntax highlighting support, automatic indentation,
23 ;; tag-completion and preliminary support for syntax checking.
26 ;; Add the following to your .emacs:
27 ;; (add-to-list 'load-path "path/to/wesnoth-mode")
28 ;; (autoload 'wesnoth-mode "wesnoth-mode" "Major mode for editing WML." t)
30 ;; (add-to-list 'auto-mode-alist '("\\.cfg\\'" . wesnoth-mode))
31 ;; to automatically load wesnoth-mode for all files ending in '.cfg'.
35 ;; * Font-locking is now correctly performed on #endif.
36 ;; * `wesnoth-jump-to-matching' now attempts to find a target if necessary and
37 ;; will now work on preprocessor statements.
38 ;; * Indentation style is now determined by `wesnoth-indentation-function'.
39 ;; * Both indentation styles now leave point at the first non-whitespace
40 ;; character of the line.
41 ;; * `wesnoth-check-structure' can now be applied over an active region and
42 ;; now checks preprocessor statements for correct nesting.
43 ;; * `wesnoth-insert-missing-closing' new function to insert the next
44 ;; expected closing element. (Bound to C-c C-/.)
45 ;; * Changed `wesnoth-newline' to behave more consistantly.
46 ;; * `wesnoth-newline' and `wesnoth-newline-and-indent' can be forced to
47 ;; perform indentation by providing a prefix argument.
48 ;; * Fixed `wesnoth-newline-and-indent' ignoring the state of
49 ;; `wesnoth-auto-indent-flag'.
50 ;; * Renamed `wesnoth-indent-line-default' and `wesnoth-indent-line-savefile'
51 ;; to `wesnoth-indent-default' and `wesnoth-indent-savefile', respectively.
52 ;; Set default value for `wesnoth-indentation-function' accordingly.
53 ;; * Renamed `wesnoth-jump-backward' and `wesnoth-jump-forward' to
54 ;; `wesnoth-backward-tag' and `wesnoth-forward-tag', respectively.
55 ;; * `wesnoth-forward-tag' now moves point to the end of the next closing tag,
56 ;; which is closer to existing entity movement behaviour in Emacs.
57 ;; * Re-wrote `wesnoth-insert-tag'.
58 ;; * Added function: `wesnoth-insert-and-indent'.
60 ;; * Base indent now defaults to 4.
61 ;; * Added support for #ifndef.
63 (defconst wesnoth-mode-version
"1.2.2"
64 "The current version of wesnoth-mode.")
66 (defgroup wesnoth-mode nil
"Wesnoth-mode access"
70 (defcustom wesnoth-indentation-function
'wesnoth-indent-default
71 "Use the specified function when indenting WML.
72 You can specify either `wesnoth-indent-default' or
73 `wesnoth-indent-savefile' as the indentation style or a
74 customised function for indentation."
78 (defcustom wesnoth-auto-indent-flag t
79 "Whether to attempt tag indentation when a newline is created.
80 If nil, no indentation will be attempted. Otherwise, attempt to
85 (defcustom wesnoth-base-indent
4
86 "The number of columns to indent WML."
90 (defconst wesnoth-preprocessor-regexp
91 "#\\(?:define \\|e\\(?:lse\\|nd\\(?:\\(?:de\\|i\\)f\\)\\)\\|\\(?:ifn?\\|un\\)def \\)"
92 "Regular expression to match all preprocessor statements.")
94 (defconst wesnoth-preprocessor-opening-regexp
95 "#\\(?:define \\|else\\|ifdef \\|ifndef \\)"
96 "Regular expression to match \"opening\" preprocessor statements.")
98 (defconst wesnoth-preprocessor-closing-regexp
99 "#e\\(?:lse\\|nd\\(?:\\(?:de\\|i\\)f\\)\\)"
100 "Regular expression to match \"closing\" preprocessor statements.")
102 (defvar wesnoth-mode-hook nil
)
104 (defvar wesnoth-mode-map
()
105 "Keymap used in wesnoth mode.")
106 (unless wesnoth-mode-map
107 (setq wesnoth-mode-map
(make-sparse-keymap))
108 (define-key wesnoth-mode-map
"\C-\M-a" 'wesnoth-backward-tag
)
109 (define-key wesnoth-mode-map
"\C-\M-e" 'wesnoth-forward-tag
)
110 (define-key wesnoth-mode-map
"\C-c\C-m" 'wesnoth-jump-to-matching
)
111 (define-key wesnoth-mode-map
"\C-cm" 'wesnoth-jump-to-matching
)
112 (define-key wesnoth-mode-map
"\C-m" 'wesnoth-newline
)
113 (define-key wesnoth-mode-map
"\C-j" 'wesnoth-newline-and-indent
)
114 (define-key wesnoth-mode-map
"\C-c\C-c" 'wesnoth-check-structure
)
115 (define-key wesnoth-mode-map
"\C-cc" 'wesnoth-check-structure
)
116 (define-key wesnoth-mode-map
"\C-c\C-n" 'wesnoth-check-tag-names
)
117 (define-key wesnoth-mode-map
"\C-cn" 'wesnoth-check-tag-names
)
118 (define-key wesnoth-mode-map
"\C-c\C-e" 'wesnoth-insert-tag
)
119 (define-key wesnoth-mode-map
"\C-ce" 'wesnoth-insert-tag
)
120 (define-key wesnoth-mode-map
(kbd "C-c C-/") 'wesnoth-insert-missing-closing
)
121 (define-key wesnoth-mode-map
(kbd "C-c /") 'wesnoth-insert-missing-closing
))
123 (defvar wesnoth-syntax-table
124 (let ((wesnoth-syntax-table (make-syntax-table)))
125 (modify-syntax-entry ?
= "." wesnoth-syntax-table
)
126 (modify-syntax-entry ?\_
"w" wesnoth-syntax-table
)
127 (modify-syntax-entry ?-
"_" wesnoth-syntax-table
)
128 (modify-syntax-entry ?.
"_" wesnoth-syntax-table
)
129 (modify-syntax-entry ?
\n ">" wesnoth-syntax-table
)
130 (modify-syntax-entry ?
\r ">" wesnoth-syntax-table
)
131 wesnoth-syntax-table
)
132 "Syntax table for wesnoth-mode.")
134 ;; Prevents automatic syntax-highlighting of elements which might be
135 ;; pre-processor statements.
136 (defvar wesnoth-syntactic-keywords
138 '("^[\t ]*\\(#\\(?:define \\|e\\(?:lse\\|nd\\(?:\\(?:de\\|i\\)f\\)\\)\\|\\(?:ifn?\\|un\\)def \\)\\)" 1 "w")
139 '("\\(#[\t ]*.*$\\)" 1 "<"))
140 "Highlighting syntactic keywords within wesnoth-mode.")
142 (defvar wesnoth-font-lock-keywords
144 '("\\(#\\(?:define\\|\\(?:ifn?\\|un\\)def\\)\\)"
145 1 font-lock-preprocessor-face
)
146 '("\\(#\\(?:define\\|\\(?:ifn?\\|un\\)def\\)\\)[\t ]+\\(\\w+\\)"
147 2 font-lock-function-name-face
)
148 '("\\(#e\\(?:lse\\|nd\\(?:\\(?:de\\|i\\)f\\)\\)\\)" . font-lock-preprocessor-face
)
149 '("[\t ]*\\({[[:word:]/\.]+\\|{[@~][[:word:]/\.]+\\).*\\(}\\)"
150 (1 font-lock-function-name-face
)
151 (2 font-lock-function-name-face
))
152 '("\\[[^]]+\\]" . font-lock-type-face
)
153 '("\\$\\w+" . font-lock-variable-name-face
)
154 '("\\(\\w+\\(\\,[\t ]*\\w+\\)*\\)="
155 1 font-lock-variable-name-face
))
156 "Syntax highlighting for wesnoth-mode.")
158 (defvar wesnoth-tags-list
160 "abilities" "about" "advances" "advancefrom" "ai" "allow_recruit" "and"
161 "animation" "array" "attack" "attacks" "avoid" "binary_path" "bold"
162 "campaign" "capture_village" "choose""clear_variable" "colour_adjust"
163 "command" "deaths" "defend" "defends" "defense" "delay" "destination"
164 "disallow_recruit" "do" "effect" "else" "end_turn" "endlevel" "era" "event"
165 "expenses" "filter" "filter_radius" "filter_second" "format" "frame"
166 "game_config" "generator" "gold" "have_unit" "header" "hide_unit" "if"
167 "illuminated_time" "image" "img" "income" "italic" "item" "jump" "kill"
168 "killed" "label" "language" "leader_goal" "main_map" "menu" "message"
169 "mini_map" "missile_frame" "modifications" "modify_side" "modify_turns"
170 "move" "move_unit_fake" "movement_costs" "movetype" "multiplayer"
171 "multiplayer_side" "music" "not" "num_units" "object" "objectives"
172 "objective" "observers" "option" "or" "panel" "part" "place_shroud"
173 "position" "print" "protect_location" "protect_unit" "race" "random"
174 "recall" "recalls" "recruit" "recruits" "redraw" "ref" "remove_shroud"
175 "remove_unit_overlay" "removeitem" "replay" "replay_start" "resistance"
176 "resolution" "results" "role" "save" "scenario" "scroll" "scroll_to"
177 "scroll_to_unit" "section" "set_recruit" "set_variable" "side"
178 "side_playing" "snapshot" "sound" "source" "specials" "statistics" "status"
179 "stone" "store_gold" "store_locations" "store_starting_location"
180 "store_unit" "story" "target" "team" "teleport" "teleport_anim" "terrain"
181 "terrain_graphics" "test" "textdomain" "theme" "then" "tile" "time"
182 "time_area" "time_of_day" "topic" "toplevel" "trait" "turn" "tutorial"
183 "unhide_unit" "unit" "unit_abilities" "unit_alignment" "unit_description"
184 "unit_hp" "unit_image" "unit_level" "unit_moves" "unit_overlay"
185 "unit_profile" "unit_status" "unit_traits" "unit_type" "unit_weapons"
186 "unit_xp" "units" "unstone" "unstore_unit" "upkeep" "variable" "variables"
187 "village" "villages" "while")
188 "A list containing all tags which are available for use in WML.")
190 (defun wesnoth-insert-tag (&optional tagname
)
191 "Inserts the specified opening tag and it's matching closing tag.
192 Both the opening and closing tags will be placed on their own
193 lines with point positioned between them. Completion of tags at
194 the prompt uses `wesnoth-tags-list'."
196 (list (completing-read "Tag: " wesnoth-tags-list nil nil
)))
198 (unless (looking-back "^[\t ]*$")
200 (wesnoth-insert-and-indent "[" tagname
"]")
201 (wesnoth-insert-and-indent "\n")
203 (wesnoth-insert-and-indent "\n[/" tagname
"]")))
205 (defun wesnoth-insert-and-indent (&rest args
)
206 "Concatentate and insert the given string(s) before indenting."
207 (insert (apply 'concat args
))
208 (wesnoth-indent-line)
211 (defun wesnoth-forward-tag (repeat)
212 "Move point to the end of the next tag.
213 REPEAT is an optional numeric argument. If REPEAT is non-nil,
214 jump forward the specified number of tags."
216 (or repeat
(setq repeat
1))
218 (wesnoth-backward-tag (abs repeat
))
219 (let ((iterations 0))
220 (while (< iterations repeat
)
222 (search-forward-regexp
223 (concat "^[\t ]*\\(\\[/\\w+\\]\\|"
224 wesnoth-preprocessor-opening-regexp
"\\)")
226 (setq iterations
(1+ iterations
))))
229 (defun wesnoth-backward-tag (repeat)
230 "Move point to the beginning of the previous tag.
231 REPEAT is an optional numeric argument. If REPEAT is non-nil,
232 jump backward the specified number of tags."
234 (or repeat
(setq repeat
1))
236 (wesnoth-forward-tag (abs repeat
))
237 (let ((iterations 0))
238 (while (< iterations repeat
)
240 (search-backward-regexp
241 (concat "^[\t ]*\\(\\[\\w+\\]\\|"
242 wesnoth-preprocessor-opening-regexp
"\\)")
245 (search-forward-regexp "[^[:blank:]]")
247 (setq iterations
(1+ iterations
))))))
249 (defun wesnoth-jump-to-matching ()
250 "Jump point to the matching opening/closing tag.
251 A tag must be on the same line as point for jumping to occur. If
252 the tag structure is not correct this may have unexpected
258 (search-backward nil
))
262 (concat "^[\t ]*\\(\\[\\|"
263 wesnoth-preprocessor-regexp
"\\)"))
265 (concat "^[\t ]*\\(\\[/\\|#\\(?:endif\\|enddef\\)\\)"))
266 (setq search-backward t
))
267 (if (wesnoth-wml-start-pos)
268 (if (> (point) (wesnoth-wml-start-pos))
269 (search-backward-regexp
270 (concat "^[\t ]*\\(\\[\\|"
271 wesnoth-preprocessor-regexp
"\\)")
273 (goto-char (point-min))
274 (search-forward-regexp
275 (concat "^[\t ]*\\(\\[\\|"
276 wesnoth-preprocessor-regexp
"\\)"))
278 (error "%s" "Unable to locate tag to jump from")))
283 (or (< open-tags
0) (not search-started
))
284 (search-backward-regexp
285 (concat "^[\t ]*\\(\\[\\|"
286 wesnoth-preprocessor-regexp
"\\)")
288 (setq search-started t
)
290 "^[\t ]*\\(\\[\\+?\\w+\\]\\|#\\(?:define\\|ifn?def\\) \\)")
291 (setq open-tags
(1+ open-tags
))
293 (concat "^[\t ]*\\(\\[/\\w+\\]\\|#\\(?:endif\\|enddef\\)\\)"))
294 (setq open-tags
(1- open-tags
))))))
296 (or (> open-tags
0) (not search-started
))
297 (search-forward-regexp
298 (concat "^[\t ]*\\(\\[\\|"
299 wesnoth-preprocessor-regexp
"\\)")
302 (setq search-started t
)
304 "^[\t ]*\\(\\[\\+?\\w+\\]\\|#\\(?:define\\|ifn?def\\) \\)")
305 (setq open-tags
(1+ open-tags
))
307 (concat "^[\t ]*\\(\\[\\+?/\\w+\\]\\|#\\(?:endif\\|enddef\\)\\)"))
308 (setq open-tags
(1- open-tags
))))
310 (setq tag-position
(point)))
312 (goto-char tag-position
)
315 (search-backward-regexp "\\[\\|#"))
317 (defun wesnoth-wml-start-pos ()
318 "Determine the position of `point' relative to where the actual WML begins.
319 Return the likely starting position of the WML if it is found.
320 Otherwise return nil."
322 (goto-char (point-min))
323 (when (search-forward-regexp
324 (concat "^[\t ]*\\(\\[\\)\\|\\("
325 wesnoth-preprocessor-opening-regexp
331 (defun wesnoth-indent-default ()
332 "Indent the current line as WML using normal-style indentation."
334 (if (or (not (wesnoth-wml-start-pos))
335 (<= (point) (wesnoth-wml-start-pos))
336 (nth 3 (syntax-ppss (point))))
338 (let ((not-indented t
) cur-indent
)
340 (concat "^[ \t]*\\(\\[\\/[^]]*?\\|\\("
341 wesnoth-preprocessor-closing-regexp
"\\)\\)"))
344 (search-backward-regexp
345 (concat "^[\t ]*\\[\\|\\(" wesnoth-preprocessor-regexp
"\\)"))
346 (setq cur-indent
(current-indentation))
349 (concat "^[\t ]*\\(\\[/.+\\]\\|\\("
350 wesnoth-preprocessor-closing-regexp
352 (setq cur-indent
(- (current-indentation) wesnoth-base-indent
))))
354 (setq cur-indent
0)))
356 (concat "^[ \t]*\\(\\[[^/]*?\\]\\|\\("
357 wesnoth-preprocessor-closing-regexp
"\\)\\)")))
359 (search-backward-regexp
360 (concat "^[\t ]*\\(\\[\\|\\("
361 wesnoth-preprocessor-regexp
"\\)\\)"))
363 (concat "^[\t ]*\\(\\[/.+\\]\\|\\("
364 wesnoth-preprocessor-closing-regexp
367 (setq cur-indent
(- (current-indentation) wesnoth-base-indent
))
370 (setq not-indented nil
))
371 (setq cur-indent
(current-indentation))
372 (setq not-indented nil
)))
375 (search-backward-regexp
376 (concat "^[\t ]*\\([[}]\\|\\("
377 wesnoth-preprocessor-regexp
380 (concat "^[ \t]*\\(\\[[^/]*?\\]\\|\\("
381 wesnoth-preprocessor-opening-regexp
"\\)\\)"))
382 (setq cur-indent
(+ (current-indentation) wesnoth-base-indent
))
383 (setq cur-indent
(current-indentation)))))))
384 (unless (and (not cur-indent
) (= (current-indentation) cur-indent
))
385 (indent-line-to cur-indent
))))
387 (search-forward-regexp "[\t ]*"))
389 (defun wesnoth-indent-savefile ()
390 "Indent the current line as WML code using savefile-style indentation."
392 (if (or (not (wesnoth-wml-start-pos))
393 (<= (point) (wesnoth-wml-start-pos))
394 (nth 3 (syntax-ppss (point))))
398 (concat "^[ \t]*\\(\\[\\/[^]]*?\\|\\("
399 wesnoth-preprocessor-closing-regexp
"\\)\\)"))
402 (search-backward-regexp "^[ \t]+.\\|^[{[#]")
403 (setq cur-indent
(- (current-indentation) wesnoth-base-indent
))
405 (concat "^[ \t]*\\(\\[[^/].+\\]\\|\\("
406 wesnoth-preprocessor-opening-regexp
"\\)\\)"))
407 (setq cur-indent
(current-indentation))))
409 (setq cur-indent
0)))
412 (search-backward-regexp "^[\t ]*\\([[#}]\\)")
414 (concat "^[ \t]*\\(\\[[^/]+?\\]\\|\\("
415 wesnoth-preprocessor-opening-regexp
"\\)\\)"))
416 (setq cur-indent
(+ (current-indentation) wesnoth-base-indent
))
417 (setq cur-indent
(current-indentation))))))
418 (unless (and (not cur-indent
)
419 (= (current-indentation) cur-indent
))
420 (indent-line-to cur-indent
))))
422 (search-forward-regexp "[\t ]*"))
424 (defun wesnoth-newline (&optional indent
)
425 "Indent both the current line and the newline created.
426 If `wesnoth-auto-indent-flag' is nil, indentation will not be
430 (when (or wesnoth-auto-indent-flag indent
)
431 (wesnoth-indent-line)))
434 (defun wesnoth-newline-and-indent (&optional indent
)
435 "Indent both the current line and the newline created.
436 If `wesnoth-auto-indent-flag' is nil, indentation will not be
440 (when (or wesnoth-auto-indent-flag indent
)
441 (wesnoth-indent-line)))
443 (defun wesnoth-check-tag-names ()
444 "Check the names of all tags in the buffer for correctness.
445 If a tag is found which is not present in the list an error will
446 be signalled and point will be moved to the corresponding
449 (let ((tag-position nil
)
450 (missing-tag-name nil
))
452 (goto-char (point-min))
454 (search-forward-regexp "^[\t ]*\\[" (point-max) t
)
457 (when (looking-at "^[\t ]*\\[[/]?\\(\\w+\\)\\]")
458 (unless (member (match-string-no-properties 1) wesnoth-tags-list
)
459 (setq tag-position
(point))
460 (setq missing-tag-name
(match-string-no-properties 1))))
463 (goto-char tag-position
)
464 (message "'%s' is not known to exist"
467 (defun wesnoth-check-structure (&optional start end
)
468 "Check the buffer for correct nesting of elements.
469 If a problem is found in the structure, point will be placed at
470 the location which an element was expected and the expected
471 element will be displayed in the minibuffer."
473 (if (and transient-mark-mode mark-active
)
474 (setq start
(region-beginning)
475 end
(copy-marker (region-end)))
476 (setq start
(point-min)
478 (let ((unmatched-tag-list '())
484 (search-forward-regexp
485 (concat "^[\t ]*\\[\\|\\(" wesnoth-preprocessor-regexp
"\\)")
487 (not error-position
))
489 (if (looking-at "^[\t ]*#\\(\\w+\\)")
490 (let ((preprocessor-name (match-string-no-properties 1)))
492 ((string= preprocessor-name
"define")
493 (setq unmatched-tag-list
494 (cons preprocessor-name unmatched-tag-list
)))
495 ((string= preprocessor-name
"ifdef")
496 (setq unmatched-tag-list
497 (cons preprocessor-name unmatched-tag-list
)))
498 ((string= preprocessor-name
"ifndef")
499 (setq unmatched-tag-list
500 (cons preprocessor-name unmatched-tag-list
))
501 (message "added a thing to the list...?"))
502 ((string= preprocessor-name
"else")
503 (unless (= (string-match "ifn?def" (car unmatched-tag-list
)) 0)
504 (setq error-position
(point))))
505 ((string= preprocessor-name
"endif")
506 (if (= (string-match "ifn?def" (car unmatched-tag-list
)) 0)
507 (setq unmatched-tag-list
(cdr unmatched-tag-list
))
508 (setq error-position
(point))))
509 ((string= preprocessor-name
"enddef")
510 (if (string= (car unmatched-tag-list
) "define")
511 (setq unmatched-tag-list
(cdr unmatched-tag-list
))
512 (setq error-position
(point))))))
513 (if (looking-at "^[\t ]*\\[\\+?\\(\\w+\\)\\]")
514 (setq unmatched-tag-list
515 (cons (match-string-no-properties 1)
517 (when (looking-at "^[\t ]*\\[/\\(\\w+\\)\\]")
518 (if (string= (match-string-no-properties 1)
519 (car unmatched-tag-list
))
520 (setq unmatched-tag-list
(cdr unmatched-tag-list
))
521 (setq error-position
(point))))))
523 (when unmatched-tag-list
524 (cond ((string= (car unmatched-tag-list
) "define")
525 (setq expected
"#enddef"))
526 ((string-match "ifn?def" (car unmatched-tag-list
))
527 (setq expected
"#endif"))
528 ((not unmatched-tag-list
)
529 (setq expected
"Unexpected end of file"))))
531 (if (not (or unmatched-tag-list error-position
))
532 (message "%s" "Structure appears consistent.")
534 (goto-char error-position
))
535 (if (string= expected
"Unexpected end of file")
536 (message "Error %s" expected
)
537 (message "Error: Expecting %s"
540 (concat " [/" (car unmatched-tag-list
) "]")))))
541 (when (or expected unmatched-tag-list
)
542 (or expected
(concat "[/" (car unmatched-tag-list
) "]"))))))
544 (defun wesnoth-insert-missing-closing (&optional start end
)
545 "Insert the next exected closing element at point."
547 (if (and transient-mark-mode mark-active
)
548 (setq start
(region-beginning)
549 end
(copy-marker (region-end)))
550 (setq start
(point-min)
552 (let ((element (wesnoth-check-structure start end
)))
554 (if (string= element
"Unexpected end of file")
555 (message "%s" "Error: Expected end of file")
556 (when (not (looking-at "^[\t ]*$"))
560 (wesnoth-indent-line)
562 (error "%s" "Unable to find element to insert"))))
564 (defun wesnoth-indent-line ()
565 "Determine and performs indentation on the current line.
566 The Indentation style can be customised by modifying
567 `wesnoth-indentation-function'."
569 (funcall wesnoth-indentation-function
))
571 (define-derived-mode wesnoth-mode fundamental-mode
"wesnoth-mode"
572 "Major mode for editing WML."
573 (set-syntax-table wesnoth-syntax-table
)
574 (set (make-local-variable 'outline-regexp
) "^[\t ]*\\[\\w+")
575 (set (make-local-variable 'comment-start
) "#")
576 (set (make-local-variable 'indent-line-function
) 'wesnoth-indent-line
)
577 (set (make-local-variable 'font-lock-defaults
)
578 '(wesnoth-font-lock-keywords
580 (font-lock-syntactic-keywords . wesnoth-syntactic-keywords
)))
581 (setq indent-tabs-mode nil
)
582 (setq mode-name
"WML")
583 (run-hooks 'wesnoth-mode-hook
))
585 (provide 'wesnoth-mode
)