From b448d84076909dd03970e4fbc3977ef530d34a83 Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Mon, 16 Mar 2009 23:45:30 +1030 Subject: [PATCH] * wesnoth-mode.el (wesnoth-font-lock-keywords, wesnoth-down-list, wesnoth-check-wml): Add support for attributes where keys are separated from `=' by whitespace. --- wesnoth-mode.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/wesnoth-mode.el b/wesnoth-mode.el index 0154eaf..b8f0f5f 100644 --- a/wesnoth-mode.el +++ b/wesnoth-mode.el @@ -34,8 +34,9 @@ ;;; History: ;; 1.3.5+git -;; * Add support for prefix arg to and improved `wesnoth-kill-block' to kill +;; * Improve and add support for prefix arg to `wesnoth-kill-block' to kill ;; multiple blocks. +;; * Add support for attributes where whitespace is between the key and `='. ;; 1.3.5 ;; * Added navigation commands: C-M-n and C-M-p can be used to move to the ;; next and previous children of the current parent element, respectively. @@ -327,7 +328,7 @@ level as their parent.") '("}" . font-lock-function-name-face) '("[\t ]*\\(\\[/?[^$]\\(\\w\\|_\\)+\\]\\)" 1 font-lock-type-face) '("\\$\\(\\w\\|_\\)+" . font-lock-variable-name-face) - '("\\(\\(\\w\\|_\\)+\\(\\,[\t ]*\\(\\w\\|_\\)+\\)*\\)=" + '("\\(\\(\\w\\|_\\)+\\(\\,[\t ]*\\(\\w\\|_\\)+\\)*\\)[\t ]*=" 1 font-lock-variable-name-face)) "Syntax highlighting for `wesnoth-mode'.") @@ -1430,11 +1431,11 @@ If ARG is not specified, move forward down one level." (unless arg (setq arg 1)) (when (looking-at "\\(\\[\\+?\\(\\w\\|_\\)+\\]\\|#define\\|\ -#ifn?def\\|\\(\\w\\|_\\)+=\\)") +#ifn?def\\|\\(\\w\\|_\\)+[\t ]*=\\)") (forward-char 1)) (let ((target nil)) (save-excursion - (when (looking-at "\\(\\w\\|_\\)+=") + (when (looking-at "\\(\\w\\|_\\)+[\t ]*=") (if (and (search-forward-regexp (wesnoth-element) (point-max) t) (progn (beginning-of-line) (looking-at (wesnoth-element-opening t)))) @@ -1444,7 +1445,7 @@ If ARG is not specified, move forward down one level." (while (> arg 0) (when (> (save-excursion (wesnoth-jump-to-matching) (point)) (point)) (search-forward-regexp - "\\(\\[\\+?\\(\\w\\|_\\)+\\]\\|#define\\|#ifn?def\\|\\(\\w\\|_\\)+=\\)" + "\\(\\[\\+?\\(\\w\\|_\\)+\\]\\|#define\\|#ifn?def\\|\\(\\w\\|_\\)+[\t ]*=\\)" (save-excursion (wesnoth-jump-to-matching) (point)) @@ -1616,7 +1617,7 @@ If ARG is not specifed, move backward one element." (wesnoth-check-process "Preprocessor statement does not nest correctly")) (setq unmatched (cdr unmatched))) - ((looking-at "[\t ]*\\(\\(\\w\\|_\\)+\\)=\\(.+\\)?") + ((looking-at "[\t ]*\\(\\(\\w\\|_\\)+\\)[\t ]*=\\(.+\\)?") (unless (wesnoth-check-element-type 1) (wesnoth-check-process "Attribute not available in this context: '%s'" -- 2.11.4.GIT