From 7507e13b042cf262befa832481456dc1c8a885da Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Fri, 28 Dec 2007 08:51:48 +1030 Subject: [PATCH] * wesnoth-mode.el (wesnoth-preprocessor-regexp, wesnoth-preprocessor-opening-regexp): Added support for #ifndef. --- wesnoth-mode.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/wesnoth-mode.el b/wesnoth-mode.el index bb2eeaf..e4e7477 100644 --- a/wesnoth-mode.el +++ b/wesnoth-mode.el @@ -63,11 +63,11 @@ indent the line." :group 'wesnoth-mode) (defconst wesnoth-preprocessor-regexp - "#\\(?:define \\|e\\(?:lse\\|nd\\(?:\\(?:de\\|i\\)f\\)\\)\\|\\(?:if\\|un\\)def \\)" + "#\\(?:define \\|e\\(?:lse\\|nd\\(?:\\(?:de\\|i\\)f\\)\\)\\|\\(?:ifn?\\|un\\)def \\)" "Regular expression to match all preprocessor statements.") (defconst wesnoth-preprocessor-opening-regexp - "#\\(?:define \\|else\\|ifdef \\)" + "#\\(?:define \\|else\\|ifdef \\|ifndef \\)" "Regular expression to match \"opening\" preprocessor statements.") (defconst wesnoth-preprocessor-closing-regexp @@ -466,14 +466,15 @@ element will be displayed in the minibuffer." ((string= preprocessor-name "ifdef") (setq unmatched-tag-list (cons preprocessor-name unmatched-tag-list))) - ((string= preprocessor-name "ifdef") + ((string= preprocessor-name "ifndef") (setq unmatched-tag-list - (cons preprocessor-name unmatched-tag-list))) + (cons preprocessor-name unmatched-tag-list)) + (message "added a thing to the list...?")) ((string= preprocessor-name "else") - (unless (string-match "ifn?def" (car unmatched-tag-list)) + (unless (= (string-match "ifn?def" (car unmatched-tag-list)) 0) (setq error-position (point)))) ((string= preprocessor-name "endif") - (if (string-match "ifn?def" (car unmatched-tag-list)) + (if (= (string-match "ifn?def" (car unmatched-tag-list)) 0) (setq unmatched-tag-list (cdr unmatched-tag-list)) (setq error-position (point)))) ((string= preprocessor-name "enddef") -- 2.11.4.GIT