[gtksourceview] Update of M4 syntax highlighting



commit f158320de64e119b18c0c7c8a382575f19a2529a
Author: P. F. Chimento <philip chimento gmail com>
Date:   Fri Oct 1 22:37:15 2010 +0200

    Update of M4 syntax highlighting
    
    Brought the M4 language definition up-to-date with all current
    Autoconf-and-friends macros. Added an exhaustive list of macros with
    information on how to highlight their arguments (i.e. whether they
    contain shell code or not.) This functionality was already present in
    the file, but used only for a few macros. Commented the file.

 data/language-specs/m4.lang | 1061 +++++++++++++++++++++++++++++++++----------
 1 files changed, 816 insertions(+), 245 deletions(-)
---
diff --git a/data/language-specs/m4.lang b/data/language-specs/m4.lang
index 316e738..e53eb5f 100644
--- a/data/language-specs/m4.lang
+++ b/data/language-specs/m4.lang
@@ -32,10 +32,299 @@
     <style id="m4-comment" _name="m4-comment" map-to="sh:comment"/>
     <style id="m4-macro" _name="m4 Macro" map-to="def:keyword"/>
     <style id="ac-macro" _name="Autoconf Macro" map-to="def:keyword"/>
-    <style id="ac-macro-obsolete" _name="Obsolete Autoconf Macro" map-to="def:keyword"/>
+    <style id="ac-macro-obsolete" _name="Obsolete Autoconf Macro" map-to="def:error"/>
   </styles>
 
+  <!--
+  Refurbished and commented 2010 by P. F. Chimento <philip chimento gmail com>
+
+  How this language definition works.
+
+  This 'm4' language definition actually highlights Autoconf M4 files. Autoconf
+  consists of several parts: Autoconf, M4sugar, M4sh, Autoheader, Autoupdate,
+  and Autotest, all of which define their own M4 macros. In addition, this file
+  also highlights other M4 macros commonly used with Autoconf (those defined by
+  Automake, Libtool, Gettext, and Pkgconfig) and ones used for building GTK
+  packages (Intltool, Glib, and GConf).
+
+  This language definition ironically does _not_ support pure M4 files: M4sugar
+  redefines all the built-in M4 macros so that they start with m4_, and
+  redefines the quote characters from `' to [].
+
+  Autoconf's configure.ac files are processed by M4 into configure shell
+  scripts. Therefore, text that is to appear in the output is actually shell
+  script, and should be highlighted as such. However, some macros have arguments
+  that are not meant to appear in the output, and it depends on the macro.
+  For example, the macro
+      AC_CHECK_FILE(file, [action-if-found], [action-if-not-found])
+  has three arguments, the first one of which should not contain shell script.
+  The remaining two can contain shell code, as well as other macros. Therefore,
+  we divide the macros into categories depending on the number and type of their
+  arguments: a string of 'm' (for M4 only) and 's' (for shell script mixed with
+  M4) characters.
+
+  TODO: In a future version, we might add 'c' to the mix, since some macros'
+  arguments actually contain C code. Right now this is just highlighted as M4.
+
+  Note that keeping track of the number of arguments to a macro also allows us
+  to highlight any extra arguments as errors. Also, note that calling a macro
+  with _fewer_ arguments is allowed, and in fact happens all the time. For
+  example, in AC_CHECK_FILE above, the second and third arguments are optional 
+  and in fact have sensible defaults.
+
+  Below, we define regexes, with names like 'macros-mss' that match every macro
+  with that signature.
+
+  IMPORTANT: if you add any macros, make sure that you make all your parentheses
+  non-capturing by adding ?: to them! Otherwise, the highlighting will break
+  (and in fact was broken in earlier versions of this file.)
+  -->
   <definitions>
+    <define-regex id="macros-m" extended="true">
+      AC_(?:
+        CHECK_(?:DECL|FUNC|HEADER)S_ONCE|
+        CHECKING|
+        CONFIG_(?:(?:(?:AUX|LIBOBJ|MACRO)_|SRC)DIR|SUBDIRS)|
+        COPYRIGHT|
+        ERLANG_NEED_ERLC?|
+        F(?:77|C)_LIBRARY_LDFLAGS|
+        FATAL
+        INCLUDES_DEFAULT
+        LANG(?:_(?:ASSERT|CONFTEST|FUNC_LINK_TRY|POP|PUSH|SOURCE))?|
+        LIB(?:OBJS|SOURCES?)|
+        MSG_(?:CHECKING|NOTICE|RESULT|WARN)|
+        OPENMP|
+        PREFIX_(?:DEFAULT|PROGRAM)|
+        PREREQ|
+        PROG_(?:CC|CXX|F77|OBJC(?:XX)?)|
+        REPLACE_FUNCS|
+        REQUIRE(?:_AUX_FILE)?|
+        REVISION|
+        SUBST_FILE|
+        WARNING)|
+      AH_(?:BOTTOM|TOP)|
+      AS_(?:
+        DIRNAME|
+        EXIT|
+        MKDIR_P|
+        SET_STATUS|
+        TR_(?:CPP|SH)|
+        VAR_(?:POPDEF|TEST_SET))|
+      m4_(?:
+        chomp(?:_all)?|
+        cleardivert|
+        debug(?:file|mode)|
+        decr|
+        defn|
+        divert(?:_(?:pop|push))?|
+        errprintn|
+        (?:re_)?escape|
+        exit|
+        expand|
+        flatten|
+        s?include|
+        incr|
+        len|
+        (?:make|mks)temp|
+        n|
+        newline|
+        normalize|
+        pattern_(?:allow|forbid)|
+        popdef|
+        set_(?:delete|list|listc|size)|
+        sign|
+        strip|
+        to(?:lower|upper)|
+        warning|
+        wrap(?:_lifo)?)|
+      AT_(?:BANNER|CAPTURE_FILE|COPYRIGHT|INIT|KEYWORDS|SETUP|TESTED)|
+      AM_(?:
+        GNU_GETTEXT_(?:VERSION|NEED)|
+        ICONV|
+        INIT_AUTOMAKE|
+        MAINTAINER_MODE|
+        PROG_(?:UPC|VALAC)|
+        SUBST_NOTMAKE|
+        XGETTEXT_OPTION)|
+      LT_(?:INIT|LANG|PREREQ)|
+      PKG_PROG_PKG_CONFIG|
+      IT_PO_SUBDIR|
+      GOBJECT_INTROSPECTION_(?:CHECK|REQUIRE)
+    </define-regex>
+    <define-regex id="macros-s" extended="true">
+      AC_CONFIG_COMMANDS_(?:PRE|POST)|
+      AS_(?:ECHO(?:_N)?|UNSET)|
+      m4_(?:esyscmd(?:_s)?|syscmd)|
+      AT_(?:X?FAIL|SKIP)_IF
+    </define-regex>
+    <define-regex id="macros-mm" extended="true">
+      AC_(?:
+        ARG_VAR|
+        BEFORE|
+        CHECK_ALIGNOF|
+        CONFIG_TESTDIR|
+        DIAGNOSE|
+        ERLANG_(?:PATH_ERLC?|SUBST_INSTALL_LIB_SUBDIR)|
+        F(?:77|C)_FUNC|
+        LANG_(?:CALL|PROGRAM)|
+        MSG_(?:ERROR|FAILURE)|
+        PROG_FC)|
+      AH_(?:TEMPLATE|VERBATIM)|
+      AU_ALIAS|
+      AS_(?:BOX|ESCAPE|TMPDIR|VAR_(?:APPEND|COPY|PUSHDEF))|
+      m4_(?:
+        append_uniq_w|
+        apply|
+        assert|
+        change(?:com|quote)|
+        (?:list)?cmp|
+        (?:copy|rename)(?:_force)?|
+        default(?:_nblank)?(?:_quoted)?|
+        define(?:_default)?|
+        defun|
+        divert_(?:once|text)|
+        fatal|
+        index|
+        map(?:all)?|
+        pushdef|
+        set_(?:contents|difference|dump|intersection|map|union)|
+        split|
+        stack_foreach(?:_lifo)?|
+        text_box|
+        version_compare|
+        warn)|
+      AT_DATA|
+      GTK_DOC_CHECK|
+      IT_PROG_INTLTOOL
+    </define-regex>
+    <define-regex id="macros-ms" extended="true">
+      AC_(?:CACHE_VAL|DEFUN(?:_ONCE)?|SUBST)|
+      AS_(?:INIT_GENERATED|VAR_(?:ARITH|SET))|
+      AM_CONDITIONAL
+    </define-regex>
+    <define-regex id="macros-ss" extended="true">
+      AC_(?:F(?:77|C)_DUMMY_MAIN|FC_(?:FREE|FIXED)FORM)
+    </define-regex>
+    <define-regex id="macros-mmm" extended="true">
+      AC_(?:CHECK_SIZEOF|DEFINE(?:_UNQUOTED)?)|
+      AS_SET_CATFILE|
+      m4_(?:
+        append|
+        bpatsubst|
+        bregexp|
+        eval|
+        ifn?blank|
+        ifn?def|
+        ifset|
+        ifvaln?|
+        map(?:all)?_sep|
+        set_(?:empty|foreach)|
+        substr|
+        translit|
+        version-prereq)|
+      AM_GNU_GETTEXT
+    </define-regex>
+    <define-regex id="macros-mms" extended="true">
+      AC_CACHE_CHECK|
+      m4_foreach(?:_w)?
+    </define-regex>
+    <define-regex id="macros-msm">AU_DEFUN</define-regex>
+    <define-regex id="macros-mss" extended="true">
+      AC_(?:
+        CHECK_(?:FILE|FUNC)(?:S)?|
+        (?:COMPILE|LINK|PREPROC)_IFELSE|
+        CONFIG_(?:COMMANDS|FILES|HEADERS|LINKS)|
+        ERLANG_CHECK_LIB|
+        FC_(?:LINE_LENGTH|SRCEXT))|
+      AS_VAR_SET_IF|
+      AM_(?:COND_IF|PATH_PYTHON)|
+      PKG_CHECK_EXISTS
+    </define-regex>
+    <define-regex id="macros-mmmm" extended="true">
+      AC_(?:
+        CHECK_(?:PROGS|(?:TARGET_)?TOOLS?)|
+        PATH_(?:PROGS?|(?:TARGET_)?TOOL))|
+      AS_HELP_STRING|
+      m4_(?:
+        map_args_w|
+        set_(?:add|contains|map_sep|remove)|
+        stack_foreach_sep(?:_lifo)?|
+        text|wrap)
+    </define-regex>
+    <define-regex id="macros-mmms">AC_COMPUTE_INT</define-regex>
+    <define-regex id="macros-mmss" extended="true">
+      AC_(?:
+        ARG_(?:ENABLE|WITH)|
+        EGREP_(?:CPP|HEADER))|
+      AS_VAR_IF|
+      AT_ARG_OPTION(?:_ARG)?|
+      PKG_CHECK_MODULES
+    </define-regex>
+    <define-regex id="macros-mssm" extended="true">
+      AC_CHECK_(?:DECL|HEADER|MEMBER|TYPE)(?:S)?
+    </define-regex>
+    <define-regex id="macros-msss">AC_RUN_IFELSE</define-regex>
+    <define-regex id="macros-ssss" extended="true">
+      AC_C_BIGENDIAN|
+      AS_LITERAL_(?:WORD_)?IF
+    </define-regex>
+    <define-regex id="macros-mmmmm" extended="true">
+      m4_(?:append_uniq|for)|
+      AC_INIT
+    </define-regex>
+    <define-regex id="macros-mmmss">AT_CHECK_EUNIT</define-regex>
+    <define-regex id="macros-mmssm" extended="true">
+      AC_(?:CHECK_LIB|SEARCH_LIBS|PATH_PROGS_FEATURE_CHECK)
+    </define-regex>
+    <define-regex id="macros-mmsss">AS_VERSION_COMPARE</define-regex>
+    <define-regex id="macros-mmmmmm">AC_CHECK_PROG</define-regex>
+    <define-regex id="macros-smmmss">AT_CHECK(?:_UNQUOTED)?</define-regex>
+
+    <!-- 'mvarargs' and 'svarargs' mean that any number of 'm' or 's' arguments
+    are accepted, respectively. These macros will not highlight extraneous
+    arguments as errors. -->
+    <define-regex id="macros-mvarargs" extended="true">
+      m4_(?:
+        argn|
+        bmatch|
+        bpatsubsts|
+        car|
+        case|
+        cdr|
+        builtin|
+        combine|
+        cond|
+        count|
+        curry|
+        do|
+        dquote(?:_elt)?|
+        dumpdefs?|
+        echo|
+        errprint|
+        format|
+        if|
+        ignore|
+        indir|
+        join(?:all)?|
+        makelist|
+        map_args(?:_(?:pair|sep))?|
+        max|
+        min|
+        (?:un)?quote|
+        reverse|
+        set_add_all|
+        shift(?:2|3|n)?|
+        trace(?:off|on)|
+        undefine|
+        undivert)
+    </define-regex>
+    <define-regex id="macros-svarargs">AS_IF</define-regex>
+
+    <!-- At this point, there is one macro left with even more complicated
+    argument types: AS_CASE. We treat it specially later on. -->
+
+    <!-- 'm4-quoted' matches text between quote brackets and highlights it as
+    pure M4 (no shell code allowed). -->
     <context id="m4-quoted"><!-- style-ref="test:_yellow"-->
       <start>\[</start>
       <end>\]</end>
@@ -44,6 +333,8 @@
       </include>
     </context>
 
+    <!-- 'm4-quoted-shell' matches text between quote brackets and highlights it
+    as a mix of M4 and shell code. -->
     <context id="m4-quoted-shell">
       <start>\[</start>
       <end>\]</end>
@@ -52,6 +343,10 @@
       </include>
     </context>
 
+    <!-- This context matches text between parentheses that comes after a word,
+    and treats it as a variable-length list of 'm' arguments. This is necessary
+    for unknown or user-defined macros - without this context, their arguments
+    would all be highlighted as shell code. -->
     <context id="m4-function-call"><!-- style-ref="test:_violet"-->
       <start>(?&lt;=[\w\d_])\((?!\))</start>
       <end>\)</end>
@@ -67,6 +362,8 @@
       </include>
     </context>
 
+    <!-- M4 'dnl' comments are removed from the output, as opposed to shell '#'
+    comments, which appear in the output. -->
     <context id="m4-comment" style-ref="m4-comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check">
       <start>dnl</start>
       <include>
@@ -74,17 +371,25 @@
       </include>
     </context>
 
+    <!-- In the following section, the contexts form a pretty straightforward
+    state machine that consumes each macro argument and moves on to the next
+    state. -->
+
+    <!-- This state means all the expected arguments have been consumed, and so
+    any remaining arguments are errors. -->
     <context id="NO-ARGS" style-ref="def:error">
       <start>,</start>
       <end>(?=\))</end>
     </context>
 
+    <!-- This is an argument containing only pure M4. -->
     <context id="ARG-M">
       <include>
         <context ref="m4-pure"/>
       </include>
     </context>
 
+    <!-- This is an argument containing a mix of M4 and shell code. -->
     <context id="ARG-S">
       <include>
         <context>
@@ -98,70 +403,126 @@
       </include>
     </context>
 
+    <!-- The TO-ARGS- states match a comma, and then enter the corresponding
+    ARGS- state -->
+    <context id="TO-ARGS-M">
+      <start>,</start>
+      <end>(?=[,\)])</end>
+      <include><context ref="ARGS-M"/></include>
+    </context>
+
     <context id="TO-ARGS-S">
       <start>,</start>
       <end>(?=[,\)])</end>
-      <include>
-        <context ref="ARGS-S"/>
-      </include>
+      <include><context ref="ARGS-S"/></include>
     </context>
 
-    <context id="TO-ARGS-M">
+    <context id="TO-ARGS-MM">
       <start>,</start>
       <end>(?=[,\)])</end>
-      <include>
-        <context ref="ARGS-M"/>
-      </include>
+      <include><context ref="ARGS-MM"/></include>
     </context>
 
     <context id="TO-ARGS-MS">
       <start>,</start>
       <end>(?=[,\)])</end>
-      <include>
-        <context ref="ARGS-MS"/>
-      </include>
+      <include><context ref="ARGS-MS"/></include>
     </context>
 
     <context id="TO-ARGS-SM">
       <start>,</start>
       <end>(?=[,\)])</end>
-      <include>
-        <context ref="ARGS-SM"/>
-      </include>
+      <include><context ref="ARGS-SM"/></include>
     </context>
 
-    <context id="TO-ARGS-MSSM">
+    <context id="TO-ARGS-SS">
       <start>,</start>
       <end>(?=[,\)])</end>
-      <include>
-        <context ref="ARGS-MSSM"/>
-      </include>
+      <include><context ref="ARGS-SS"/></include>
+    </context>
+
+    <context id="TO-ARGS-MMM">
+      <start>,</start>
+      <end>(?=[,\)])</end>
+      <include><context ref="ARGS-MMM"/></include>
+    </context>
+
+    <context id="TO-ARGS-MMS">
+      <start>,</start>
+      <end>(?=[,\)])</end>
+      <include><context ref="ARGS-MMS"/></include>
     </context>
 
     <context id="TO-ARGS-MSS">
       <start>,</start>
       <end>(?=[,\)])</end>
-      <include>
-        <context ref="ARGS-MSS"/>
-      </include>
+      <include><context ref="ARGS-MSS"/></include>
     </context>
 
     <context id="TO-ARGS-SSM">
       <start>,</start>
       <end>(?=[,\)])</end>
-      <include>
-        <context ref="ARGS-SSM"/>
-      </include>
+      <include><context ref="ARGS-SSM"/></include>
     </context>
 
-    <context id="TO-ARGS-SS">
+    <context id="TO-ARGS-SSS">
       <start>,</start>
       <end>(?=[,\)])</end>
-      <include>
-        <context ref="ARGS-SS"/>
-      </include>
+      <include><context ref="ARGS-SSS"/></include>
+    </context>
+
+    <context id="TO-ARGS-MMMM">
+      <start>,</start>
+      <end>(?=[,\)])</end>
+      <include><context ref="ARGS-MMMM"/></include>
+    </context>
+
+    <context id="TO-ARGS-MMSS">
+      <start>,</start>
+      <end>(?=[,\)])</end>
+      <include><context ref="ARGS-MMSS"/></include>
+    </context>
+
+    <context id="TO-ARGS-MSSM">
+      <start>,</start>
+      <end>(?=[,\)])</end>
+      <include><context ref="ARGS-MSSM"/></include>
+    </context>
+
+    <context id="TO-ARGS-MSSS">
+      <start>,</start>
+      <end>(?=[,\)])</end>
+      <include><context ref="ARGS-MSSS"/></include>
+    </context>
+
+    <context id="TO-ARGS-MMMMM">
+      <start>,</start>
+      <end>(?=[,\)])</end>
+      <include><context ref="ARGS-MMMMM"/></include>
+    </context>
+
+    <context id="TO-ARGS-MMMSS">
+      <start>,</start>
+      <end>(?=[,\)])</end>
+      <include><context ref="ARGS-MMMSS"/></include>
+    </context>
+
+    <context id="TO-ARGS-MVARARGS">
+      <start>,</start>
+      <end>(?=[,\)])</end>
+      <include><context ref="ARGS-MVARARGS"/></include>
+    </context>
+
+    <context id="TO-ARGS-SVARARGS">
+      <start>,</start>
+      <end>(?=[,\)])</end>
+      <include><context ref="ARGS-SVARARGS"/></include>
     </context>
 
+    <!-- The ARGS- states match an argument of the type of the head of the
+    argument list, and then enter the TO-ARGS- state corresponding to the
+    tail of the argument list. (Or CAR and CDR, if you prefer.) -->
+
     <context id="ARGS-S"><include>
       <context ref="ARG-S"/>
       <context ref="NO-ARGS"/>
@@ -172,6 +533,11 @@
       <context ref="NO-ARGS"/>
     </include></context>
 
+    <context id="ARGS-MM"><include>
+      <context ref="ARG-M"/>
+      <context ref="TO-ARGS-M"/>
+    </include></context>
+
     <context id="ARGS-MS"><include>
       <context ref="ARG-M"/>
       <context ref="TO-ARGS-S"/>
@@ -187,6 +553,21 @@
       <context ref="TO-ARGS-S"/>
     </include></context>
 
+    <context id="ARGS-MMM"><include>
+      <context ref="ARG-M"/>
+      <context ref="TO-ARGS-MM"/>
+    </include></context>
+
+    <context id="ARGS-MMS"><include>
+      <context ref="ARG-M"/>
+      <context ref="TO-ARGS-MS"/>
+    </include></context>
+
+    <context id="ARGS-MSM"><include>
+      <context ref="ARG-M"/>
+      <context ref="TO-ARGS-SM"/>
+    </include></context>
+
     <context id="ARGS-MSS"><include>
       <context ref="ARG-M"/>
       <context ref="TO-ARGS-SS"/>
@@ -197,9 +578,19 @@
       <context ref="TO-ARGS-SM"/>
     </include></context>
 
-    <context id="ARGS-MMS"><include>
+    <context id="ARGS-SSS"><include>
+      <context ref="ARG-S"/>
+      <context ref="TO-ARGS-SS"/>
+    </include></context>
+
+    <context id="ARGS-MMMM"><include>
       <context ref="ARG-M"/>
-      <context ref="TO-ARGS-MS"/>
+      <context ref="TO-ARGS-MMM"/>
+    </include></context>
+
+    <context id="ARGS-MMMS"><include>
+      <context ref="ARG-M"/>
+      <context ref="TO-ARGS-MMS"/>
     </include></context>
 
     <context id="ARGS-MMSS"><include>
@@ -212,13 +603,74 @@
       <context ref="TO-ARGS-SSM"/>
     </include></context>
 
+    <context id="ARGS-MSSS"><include>
+      <context ref="ARG-M"/>
+      <context ref="TO-ARGS-SSS"/>
+    </include></context>
+
+    <context id="ARGS-SSSS"><include>
+      <context ref="ARG-S"/>
+      <context ref="TO-ARGS-SSS"/>
+    </include></context>
+
+    <context id="ARGS-MMMMM"><include>
+      <context ref="ARG-M"/>
+      <context ref="TO-ARGS-MMMM"/>
+    </include></context>
+
+    <context id="ARGS-MMMSS"><include>
+      <context ref="ARG-M"/>
+      <context ref="TO-ARGS-MMSS"/>
+    </include></context>
+
     <context id="ARGS-MMSSM"><include>
       <context ref="ARG-M"/>
       <context ref="TO-ARGS-MSSM"/>
     </include></context>
 
+    <context id="ARGS-MMSSS"><include>
+      <context ref="ARG-M"/>
+      <context ref="TO-ARGS-MSSS"/>
+    </include></context>
+
+    <context id="ARGS-MMMMMM"><include>
+      <context ref="ARG-M"/>
+      <context ref="TO-ARGS-MMMMM"/>
+    </include></context>
+
+    <context id="ARGS-SMMMSS"><include>
+      <context ref="ARG-S"/>
+      <context ref="TO-ARGS-MMMSS"/>
+    </include></context>
+
+    <!-- The ARGS-?VARARGS states go to their own TO-ARGS- states, of course -->
+    <context id="ARGS-MVARARGS"><include>
+      <context ref="ARG-M"/>
+      <context ref="TO-ARGS-MVARARGS"/>
+    </include></context>
+
+    <context id="ARGS-SVARARGS"><include>
+      <context ref="ARG-S"/>
+      <context ref="TO-ARGS-SVARARGS"/>
+    </include></context>
+
+    <!-- AS_CASE is the odd man out. Its signature should actually be M(MS)+S?,
+    i.e. an M followed by one or more pairs of MS, ending with an optional S,
+    but there's no way to highlight that properly without knowing whether a
+    given argument is the last one. Therefore, we highlight it as M plus
+    SVARARGS. -->
+    <context id="ARGS-AS-CASE"><include>
+      <context ref="ARG-M"/>
+      <context ref="TO-ARGS-SVARARGS"/>
+    </include></context>
+
+    <!-- The func- contexts are the ones actually included in the 'm4-pure'
+    context below. They match the macro names (which we defined in the regexes
+    above), and the opening and closing parentheses, which are all highlighted. 
+    -->
+
     <context id="func-m">
-      <start>\b(AC_LANG)\s*(\()</start>
+      <start>\b(\%{macros-m})\s*(\()</start>
       <end>\)</end>
       <include>
         <context sub-pattern="1" where="start" style-ref="ac-macro"/>
@@ -228,8 +680,30 @@
       </include>
     </context>
 
+    <context id="func-s">
+      <start>\b(\%{macros-s})\s*(\()</start>
+      <end>\)</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="2" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="0" where="end" style-ref="ac-macro"/>
+        <context ref="ARGS-S"/>
+      </include>
+    </context>
+
+    <context id="func-mm">
+      <start>\b(\%{macros-mm})\s*(\()</start>
+      <end>\)</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="2" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="0" where="end" style-ref="ac-macro"/>
+        <context ref="ARGS-MM"/>
+      </include>
+    </context>
+
     <context id="func-ms">
-      <start>\b(AC_DEFUN(_ONCE)?|AM_CONDITIONAL|glib_DEFUN|AC_CACHE_VAL|AC_SUBST)\s*(\()</start>
+      <start>\b(\%{macros-ms})\s*(\()</start>
       <end>\)</end>
       <include>
         <context sub-pattern="1" where="start" style-ref="ac-macro"/>
@@ -240,7 +714,7 @@
     </context>
 
     <context id="func-ss">
-      <start>\b(AC_OUTPUT_COMMANDS)\s*(\()</start>
+      <start>\b(\%{macros-ss})\s*(\()</start>
       <end>\)</end>
       <include>
         <context sub-pattern="1" where="start" style-ref="ac-macro"/>
@@ -250,8 +724,19 @@
       </include>
     </context>
 
+    <context id="func-mmm">
+      <start>\b(\%{macros-mmm})\s*(\()</start>
+      <end>\)</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="m4-macro"/>
+        <context sub-pattern="2" where="start" style-ref="m4-macro"/>
+        <context sub-pattern="0" where="end" style-ref="m4-macro"/>
+        <context ref="ARGS-MMM"/>
+      </include>
+    </context>
+
     <context id="func-mms">
-      <start>\b(m4_foreach|AC_CACHE_CHECK)\s*(\()</start>
+      <start>\b(\%{macros-mms})\s*(\()</start>
       <end>\)</end>
       <include>
         <context sub-pattern="1" where="start" style-ref="m4-macro"/>
@@ -261,8 +746,52 @@
       </include>
     </context>
 
+    <context id="func-msm">
+      <start>\b(\%{macros-msm})\s*(\()</start>
+      <end>\)</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="m4-macro"/>
+        <context sub-pattern="2" where="start" style-ref="m4-macro"/>
+        <context sub-pattern="0" where="end" style-ref="m4-macro"/>
+        <context ref="ARGS-MSM"/>
+      </include>
+    </context>
+
+    <context id="func-mss">
+      <start>\b(\%{macros-mss})\s*(\()</start>
+      <end>\)</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="2" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="0" where="end" style-ref="ac-macro"/>
+        <context ref="ARGS-MSS"/>
+      </include>
+    </context>
+
+    <context id="func-mmmm">
+      <start>\b(\%{macros-mmmm})\s*(\()</start>
+      <end>\)</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="m4-macro"/>
+        <context sub-pattern="2" where="start" style-ref="m4-macro"/>
+        <context sub-pattern="0" where="end" style-ref="m4-macro"/>
+        <context ref="ARGS-MMMM"/>
+      </include>
+    </context>
+
+    <context id="func-mmms">
+      <start>\b(\%{macros-mmms})\s*(\()</start>
+      <end>\)</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="m4-macro"/>
+        <context sub-pattern="2" where="start" style-ref="m4-macro"/>
+        <context sub-pattern="0" where="end" style-ref="m4-macro"/>
+        <context ref="ARGS-MMMS"/>
+      </include>
+    </context>
+
     <context id="func-mmss">
-      <start>\b(AC_ARG_ENABLE|AC_ARG_WITH|AC_TRY_LINK|AC_TRY_COMPILE|PKG_CHECK_MODULES)\s*(\()</start>
+      <start>\b(\%{macros-mmss})\s*(\()</start>
       <end>\)</end>
       <include>
         <context sub-pattern="1" where="start" style-ref="ac-macro"/>
@@ -272,8 +801,63 @@
       </include>
     </context>
 
+    <context id="func-mssm">
+      <start>\b(\%{macros-mssm})\s*(\()</start>
+      <end>\)</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="2" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="0" where="end" style-ref="ac-macro"/>
+        <context ref="ARGS-MSSM"/>
+      </include>
+    </context>
+
+    <context id="func-msss">
+      <start>\b(\%{macros-msss})\s*(\()</start>
+      <end>\)</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="2" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="0" where="end" style-ref="ac-macro"/>
+        <context ref="ARGS-MSSS"/>
+      </include>
+    </context>
+
+    <context id="func-ssss">
+      <start>\b(\%{macros-ssss})\s*(\()</start>
+      <end>\)</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="2" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="0" where="end" style-ref="ac-macro"/>
+        <context ref="ARGS-SSSS"/>
+      </include>
+    </context>
+
+    <context id="func-mmmmm">
+      <start>\b(\%{macros-mmmmm})\s*(\()</start>
+      <end>\)</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="2" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="0" where="end" style-ref="ac-macro"/>
+        <context ref="ARGS-MMMMM"/>
+      </include>
+    </context>
+
+    <context id="func-mmmss">
+      <start>\b(\%{macros-mmmss})\s*(\()</start>
+      <end>\)</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="2" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="0" where="end" style-ref="ac-macro"/>
+        <context ref="ARGS-MMMSS"/>
+      </include>
+    </context>
+
     <context id="func-mmssm">
-      <start>\b(AC_CHECK_LIB|AC_SEARCH_LIBS)\s*(\()</start>
+      <start>\b(\%{macros-mmssm})\s*(\()</start>
       <end>\)</end>
       <include>
         <context sub-pattern="1" where="start" style-ref="ac-macro"/>
@@ -283,46 +867,111 @@
       </include>
     </context>
 
-    <context id="func-mss">
-      <start>\b(AC_(CONFIG_COMMANDS|ENABLE|WITH|TRY_CPP|LINK_IFELSE|CHECK_FUNCS?))\s*(\()</start>
+    <context id="func-mmsss">
+      <start>\b(\%{macros-mmsss})\s*(\()</start>
       <end>\)</end>
       <include>
         <context sub-pattern="1" where="start" style-ref="ac-macro"/>
-        <context sub-pattern="3" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="2" where="start" style-ref="ac-macro"/>
         <context sub-pattern="0" where="end" style-ref="ac-macro"/>
-        <context ref="ARGS-MSS"/>
+        <context ref="ARGS-MMSSS"/>
       </include>
     </context>
 
-    <context id="func-mssm">
-      <start>\b(AC_CHECK_HEADERS?)\s*(\()</start>
+    <context id="func-mmmmmm">
+      <start>\b(\%{macros-mmmmmm})\s*(\()</start>
       <end>\)</end>
       <include>
         <context sub-pattern="1" where="start" style-ref="ac-macro"/>
         <context sub-pattern="2" where="start" style-ref="ac-macro"/>
         <context sub-pattern="0" where="end" style-ref="ac-macro"/>
-        <context ref="ARGS-MSSM"/>
+        <context ref="ARGS-MMMMMM"/>
+      </include>
+    </context>
+
+    <context id="func-smmmss">
+      <start>\b(\%{macros-smmmss})\s*(\()</start>
+      <end>\)</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="2" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="0" where="end" style-ref="ac-macro"/>
+        <context ref="ARGS-SMMMSS"/>
+      </include>
+    </context>
+
+    <context id="func-mvarargs">
+      <start>\b(\%{macros-mvarargs})\s*(\()</start>
+      <end>\)</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="2" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="0" where="end" style-ref="ac-macro"/>
+        <context ref="ARGS-MVARARGS"/>
+      </include>
+    </context>
+
+    <context id="func-svarargs">
+      <start>\b(\%{macros-svarargs})\s*(\()</start>
+      <end>\)</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="2" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="0" where="end" style-ref="ac-macro"/>
+        <context ref="ARGS-SVARARGS"/>
+      </include>
+    </context>
+
+    <context id="func-as-case">
+      <start>\b(AS_CASE)\s*(\()</start>
+      <end>\)</end>
+      <include>
+        <context sub-pattern="1" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="2" where="start" style-ref="ac-macro"/>
+        <context sub-pattern="0" where="end" style-ref="ac-macro"/>
+        <context ref="ARGS-AS-CASE"/>
       </include>
     </context>
 
+    <!-- This context highlights pure M4 code. -->
     <context id="m4-pure">
       <include>
         <context ref="m4-comment"/>
         <context ref="func-m"/>
+        <context ref="func-s"/>
+        <context ref="func-mm"/>
         <context ref="func-ms"/>
         <context ref="func-ss"/>
-        <context ref="func-mss"/>
+        <context ref="func-mmm"/>
         <context ref="func-mms"/>
+        <context ref="func-msm"/>
+        <context ref="func-mss"/>
+        <context ref="func-mmmm"/>
+        <context ref="func-mmms"/>
         <context ref="func-mmss"/>
         <context ref="func-mssm"/>
+        <context ref="func-msss"/>
+        <context ref="func-ssss"/>
+        <context ref="func-mmmmm"/>
+        <context ref="func-mmmss"/>
         <context ref="func-mmssm"/>
-        <context ref="ac-m4-macro"/>
-        <context ref="m4-macro"/>
-        <context ref="ac-macros-1"/>
-        <context ref="ac-macros-2"/>
+        <context ref="func-mmsss"/>
+        <context ref="func-mmmmmm"/>
+        <context ref="func-smmmss"/>
+        <context ref="func-mvarargs"/>
+        <context ref="func-svarargs"/>
+        <context ref="func-as-case"/>
+        <context ref="m4-macros-noargs"/>
+        <context ref="ac-macros-noargs"/>
+        <context ref="ac-macros-noargs-2"/>
+        <context ref="ac-macros-optargs"/>
         <context ref="ac-macros-obsolete"/>
-        <context ref="am-macros-1"/>
-        <context ref="am-macros-2"/>
+        <context ref="am-macros-noargs"/>
+        <context ref="am-macros-optargs"/>
+        <context ref="am-macros-obsolete"/>
+        <context ref="am-macros-private"/>
+        <context ref="misc-macros-noargs"/>
+        <context ref="misc-macros-optargs"/>
         <context ref="m4-function-call"/>
         <context ref="m4-quoted"/>
         <context extend-parent="false" style-ref="def:error">
@@ -341,6 +990,8 @@
     <replace id="sh:sh" ref="m4"/>
     <replace id="sh:line-comment" ref="shell-line-comment"/>
 
+    <!-- This is the main 'm4' context. It highlights a mixture of M4 and shell
+    code. -->
     <context id="m4" class="no-spell-check">
       <include>
         <context ref="m4-quoted-shell"/>
@@ -352,120 +1003,55 @@
       </include>
     </context>
 
-    <context id="ac-m4-macro" style-ref="m4-macro">
+    <!-- Now come the macros that don't take any arguments. They are not called
+    with empty parentheses, just with the macro name: e.g. AC_OUTPUT. We can
+    simply use keyword contexts for them. -->
+
+    <context id="m4-macros-noargs" style-ref="m4-macro">
       <prefix>\bm4_</prefix>
-      <keyword>append(_uniq)?</keyword>
-      <keyword>bpatsubst</keyword>
-      <keyword>bregexp</keyword>
-      <keyword>builtin</keyword>
-      <keyword>decr</keyword>
-      <keyword>define</keyword>
-      <keyword>defn</keyword>
-      <keyword>dnl</keyword>
-      <keyword>dquote</keyword>
-      <keyword>dumpdef</keyword>
-      <keyword>errprint</keyword>
-      <keyword>esyscmd</keyword>
-      <keyword>eval</keyword>
-      <keyword>exit</keyword>
-      <keyword>for(each(_w)?)?</keyword>
-      <keyword>format</keyword>
-      <keyword>if(def)?</keyword>
-      <keyword>include</keyword>
-      <keyword>incr</keyword>
-      <keyword>index</keyword>
-      <keyword>indir</keyword>
-      <keyword>len</keyword>
-      <keyword>maketemp</keyword>
-      <keyword>mkstemp</keyword>
-      <keyword>normalize</keyword>
-      <keyword>pattern_(allow|forbid)</keyword>
-      <keyword>popdef</keyword>
-      <keyword>pushdef</keyword>
-      <keyword>quote</keyword>
-      <keyword>re_escape</keyword>
-      <keyword>shift</keyword>
-      <keyword>sinclude</keyword>
-      <keyword>split</keyword>
-      <keyword>substr</keyword>
-      <keyword>syscmd</keyword>
+      <keyword>divnum</keyword>
+      <keyword>init</keyword>
+      <keyword>location</keyword>
       <keyword>sysval</keyword>
-      <keyword>to(lower|upper)</keyword>
-      <keyword>translit</keyword>
-      <keyword>undefine</keyword>
-      <keyword>wrap</keyword>
     </context>
 
-    <context id="m4-macro" style-ref="m4-macro">
-      <keyword>define</keyword>
+    <!-- We also have keyword contexts for macros that do take arguments, but
+    can also be called without any; for example, AC_PROG_CC takes a list of
+    compiler names to search for, but is mostly just called without it. Since
+    the 'func-m' context would only match AC_PROG_CC(), we repeat this kind of
+    macros in '-optargs' contexts. -->
+
+    <context id="m4-macros-optargs" style-ref="m4-macro">
+      <prefix>\bm4_</prefix>
+      <keyword>change(com|quote)</keyword>
+      <keyword>debug(file|mode)</keyword>
+      <keyword>divert_pop</keyword>
+      <keyword>newline</keyword>
+      <keyword>trace(on|off)</keyword>
     </context>
 
-    <context id="ac-macros-1" style-ref="ac-macro">
+    <context id="ac-macros-noargs" style-ref="ac-macro">
       <prefix>\bAC_</prefix>
-      <keyword>AC_PROG_MKDIR_P</keyword>
-      <keyword>AIX</keyword>
-      <keyword>ARG_(ENABLE|PROGRAM|VAR|WITH)</keyword>
-      <keyword>BEFORE</keyword>
-      <keyword>CACHE_(CHECK|LOAD|SAVE|VAL)</keyword>
+      <keyword>ARG_PROGRAM</keyword>
+      <keyword>AUTOCONF_VERSION</keyword>
+      <keyword>C_BACKSLASH_A</keyword>
+      <keyword>CACHE_(LOAD|SAVE)</keyword>
       <keyword>CANONICAL_(BUILD|HOST|TARGET)</keyword>
-      <keyword>C_BIGENDIAN</keyword>
       <keyword>C_CHAR_UNSIGNED</keyword>
       <keyword>C_CONST</keyword>
       <keyword>C_FLEXIBLE_ARRAY_MEMBER</keyword>
-      <keyword>CHECK_ALIGNOF</keyword>
-      <keyword>CHECK_DECL(S(_ONCE)?)?</keyword>
-      <keyword>CHECK_FILES?</keyword>
-      <keyword>CHECK_FUNCS_ONCE</keyword>
-      <keyword>CHECK_HEADERS_ONCE</keyword>
-      <keyword>CHECK_LIB</keyword>
-      <keyword>CHECK_MEMBERS?</keyword>
-      <keyword>CHECK_PROGS?</keyword>
-      <keyword>CHECK_SIZEOF</keyword>
-      <keyword>CHECK_TARGET_TOOLS?</keyword>
-      <keyword>CHECK_TOOLS?</keyword>
-      <keyword>CHECK_TYPES?</keyword>
       <keyword>C_INLINE</keyword>
-      <keyword>COMPILE_IFELSE</keyword>
-      <keyword>COMPUTE_INT</keyword>
-      <keyword>CONFIG_AUX_DIR</keyword>
-      <keyword>CONFIG_COMMANDS(_POST|_PRE)?</keyword>
-      <keyword>CONFIG_FILES</keyword>
-      <keyword>CONFIG_HEADERS</keyword>
-      <keyword>CONFIG_LIBOBJ_DIR</keyword>
-      <keyword>CONFIG_LINKS</keyword>
-      <keyword>CONFIG_MACRO_DIR</keyword>
-      <keyword>CONFIG_SRCDIR</keyword>
-      <keyword>CONFIG_SUBDIRS</keyword>
-      <keyword>CONFIG_TESTDIR</keyword>
-      <keyword>COPYRIGHT</keyword>
       <keyword>C_PROTOTYPES</keyword>
       <keyword>C_RESTRICT</keyword>
       <keyword>C_STRINGIZE</keyword>
       <keyword>C_TYPEOF</keyword>
       <keyword>C_VARARRAYS</keyword>
       <keyword>C_VOLATILE</keyword>
-      <keyword>DATAROOTDIR_CHECKED</keyword>
-      <keyword>DEFINE(_UNQUOTED)?</keyword>
-      <keyword>DEFUN(_ONCE)?</keyword>
-      <keyword>DIAGNOSE</keyword>
-      <keyword>EGREP_CPP</keyword>
-      <keyword>EGREP_HEADER</keyword>
-      <keyword>ENABLE</keyword>
-      <keyword>ERLANG_CHECK_LIB</keyword>
-      <keyword>ERLANG_NEED_ERLC?</keyword>
-      <keyword>ERLANG_PATH_ERLC?</keyword>
-      <keyword>ERLANG_SUBST_(LIB_DIR|ROOT_DIR|(INSTALL_LIB_(DIR|SUBDIR)))</keyword>
-      <keyword>F77_DUMMY_MAIN</keyword>
-      <keyword>F77_FUNC</keyword>
-      <keyword>F77_LIBRARY_LDFLAGS</keyword>
+      <keyword>DISABLE_OPTION_CHECKING</keyword>
+      <keyword>ERLANG_SUBST_(((INSTALL_)?LIB|ROOT)_DIR|ERTS_VER)</keyword>
       <keyword>F77_MAIN</keyword>
       <keyword>F77_WRAPPERS</keyword>
-      <keyword>FATAL</keyword>
-      <keyword>FC_FREEFORM</keyword>
-      <keyword>FC_FUNC</keyword>
-      <keyword>FC_LIBRARY_LDFLAGS</keyword>
       <keyword>FC_MAIN</keyword>
-      <keyword>FC_SRCEXT</keyword>
       <keyword>FC_WRAPPERS</keyword>
       <keyword>FUNC_ALLOCA</keyword>
       <keyword>FUNC_CHOWN</keyword>
@@ -489,7 +1075,6 @@
       <keyword>FUNC_REALLOC</keyword>
       <keyword>FUNC_SELECT_ARGTYPES</keyword>
       <keyword>FUNC_SETPGRP</keyword>
-      <keyword>FUNC_SETVBUF_REVERSED</keyword>
       <keyword>FUNC_STAT</keyword>
       <keyword>FUNC_STRCOLL</keyword>
       <keyword>FUNC_STRERROR_R</keyword>
@@ -499,8 +1084,6 @@
       <keyword>FUNC_STRTOLD</keyword>
       <keyword>FUNC_UTIME_NULL</keyword>
       <keyword>FUNC_VPRINTF</keyword>
-      <keyword>GNU_SOURCE</keyword>
-      <keyword>HAVE_C_BACKSLASH_A</keyword>
       <keyword>HEADER_ASSERT</keyword>
       <keyword>HEADER_DIRENT</keyword>
       <keyword>HEADER_MAJOR</keyword>
@@ -511,81 +1094,44 @@
       <keyword>HEADER_SYS_WAIT</keyword>
       <keyword>HEADER_TIME</keyword>
       <keyword>HEADER_TIOCGWINSZ</keyword>
-      <keyword>HELP_STRING</keyword>
-      <keyword>INCLUDES_DEFAULT</keyword>
-      <keyword>INIT</keyword>
-      <keyword>ISC_POSIX</keyword>
-      <keyword>LANG_ASSERT</keyword>
-      <keyword>LANG_CALL</keyword>
-      <keyword>LANG_CONFTEST</keyword>
-      <keyword>LANG_FUNC_LINK_TRY</keyword>
-      <keyword>LANG_POP</keyword>
-      <keyword>LANG_PROGRAM</keyword>
-      <keyword>LANG_PUSH</keyword>
-      <keyword>LANG_SOURCE</keyword>
+      <keyword>LANG_DEFINES_PROVIDED</keyword>
       <keyword>LANG_WERROR</keyword>
-      <keyword>LIBOBJ</keyword>
-      <keyword>LIBSOURCES?</keyword>
-      <keyword>LINK_IFELSE</keyword>
-      <keyword>MINIX</keyword>
-      <keyword>MSG_CHECKING</keyword>
-      <keyword>MSG_ERROR</keyword>
-      <keyword>MSG_FAILURE</keyword>
-      <keyword>MSG_NOTICE</keyword>
-      <keyword>MSG_RESULT</keyword>
-      <keyword>MSG_WARN</keyword>
       <keyword>OUTPUT</keyword>
       <keyword>PACKAGE_BUGREPORT</keyword>
       <keyword>PACKAGE_NAME</keyword>
       <keyword>PACKAGE_STRING</keyword>
       <keyword>PACKAGE_TARNAME</keyword>
+      <keyword>PACKAGE_URL</keyword>
       <keyword>PACKAGE_VERSION</keyword>
-      <keyword>PATH_PROGS?</keyword>
-      <keyword>PATH_TARGET_TOOL</keyword>
-      <keyword>PATH_TOOL</keyword>
       <keyword>PATH_X</keyword>
       <keyword>PATH_XTRA</keyword>
-      <keyword>PREFIX_DEFAULT</keyword>
-      <keyword>PREFIX_PROGRAM</keyword>
-      <keyword>PREPROC_IFELSE</keyword>
-      <keyword>PREREQ</keyword>
       <keyword>PRESERVE_HELP_ORDER</keyword>
       <keyword>PROG_AWK</keyword>
-      <keyword>PROG_CC(_C(89|99|_O))?</keyword>
+      <keyword>PROG_CC(_C(89|99|_O))</keyword>
       <keyword>PROG_CC_STDC</keyword>
       <keyword>PROG_CPP(_WERROR)?</keyword>
       <keyword>PROG_CXX(CPP|_C_O)?</keyword>
       <keyword>PROG_EGREP</keyword>
-      <keyword>PROG_F77(_C_O)?</keyword>
-      <keyword>PROG_FC(_C_O)?</keyword>
+      <keyword>PROG_F77_C_O</keyword>
+      <keyword>PROG_FC_C_O</keyword>
       <keyword>PROG_FGREP</keyword>
       <keyword>PROG_GCC_TRADITIONAL</keyword>
       <keyword>PROG_GREP</keyword>
       <keyword>PROG_INSTALL</keyword>
       <keyword>PROG_LEX</keyword>
-      <keyword>PROG_LIBTOOL</keyword>
       <keyword>PROG_LN_S</keyword>
       <keyword>PROG_MAKE_SET</keyword>
-      <keyword>PROG_OBJCCPP</keyword>
-      <keyword>PROG_OBJC</keyword>
+      <keyword>PROG_MKDIR_P</keyword>
+      <keyword>PROG_OBJ(CXX)?CPP</keyword>
       <keyword>PROG_RANLIB</keyword>
       <keyword>PROG_SED</keyword>
       <keyword>PROG_YACC</keyword>
       <keyword>REPLACE_FNMATCH</keyword>
-      <keyword>REPLACE_FUNCS</keyword>
-      <keyword>REQUIRE_AUX_FILE</keyword>
       <keyword>REQUIRE_CPP</keyword>
-      <keyword>REQUIRE</keyword>
-      <keyword>REVISION</keyword>
-      <keyword>RUN_IFELSE</keyword>
-      <keyword>SEARCH_LIBS</keyword>
       <keyword>STRUCT_DIRENT_D_(INO|TYPE)</keyword>
-      <keyword>STRUCT_ST_BLKSIZE</keyword>
       <keyword>STRUCT_ST_BLOCKS</keyword>
-      <keyword>STRUCT_ST_RDEV</keyword>
       <keyword>STRUCT_TIMEZONE</keyword>
       <keyword>STRUCT_TM</keyword>
-      <keyword>SUBST_FILE</keyword>
       <keyword>SYS_INTERPRETER</keyword>
       <keyword>SYS_LARGEFILE</keyword>
       <keyword>SYS_LONG_FILE_NAMES</keyword>
@@ -609,43 +1155,51 @@
       <keyword>TYPE_UINTPTR_T</keyword>
       <keyword>TYPE_UNSIGNED_LONG_LONG_INT</keyword>
       <keyword>USE_SYSTEM_EXTENSIONS</keyword>
-      <keyword>WARNING</keyword>
-      <keyword>WITH</keyword>
     </context>
 
-    <context id="ac-macros-2" style-ref="ac-macro">
-      <keyword>AH_BOTTOM</keyword>
+    <context id="ac-macros-noargs-2" style-ref="ac-macro">
+      <prefix>\b</prefix>
       <keyword>AH_HEADER</keyword>
-      <keyword>AH_TEMPLATE</keyword>
-      <keyword>AH_TOP</keyword>
-      <keyword>AH_VERBATIM</keyword>
       <keyword>AS_BOURNE_COMPATIBLE</keyword>
-      <keyword>AS_CASE</keyword>
-      <keyword>AS_DIRNAME</keyword>
-      <keyword>AS_IF</keyword>
+      <keyword>AS_INIT</keyword>
+      <keyword>AS_LINENO_PREPARE</keyword>
+      <keyword>AS_ME_PREPARE</keyword>
       <keyword>AS_MESSAGE_FD</keyword>
       <keyword>AS_MESSAGE_LOG_FD</keyword>
-      <keyword>AS_MKDIR_P</keyword>
       <keyword>AS_ORIGINAL_STDIN_FD</keyword>
-      <keyword>AS_SET_CATFILE</keyword>
       <keyword>AS_SHELL_SANITIZE</keyword>
-      <keyword>AS_TR_CPP</keyword>
-      <keyword>AS_TR_SH</keyword>
-      <keyword>AU_ALIAS</keyword>
-      <keyword>AU_DEFUN</keyword>
+      <keyword>AT_CLEANUP</keyword>
+      <keyword>AT_COLOR_TESTS</keyword>
+    </context>
+
+    <context id="ac-macros-optargs" style-ref="ac-macro">
+      <prefix>\b</prefix>
+      <keyword>AC_C_BIGENDIAN</keyword>
+      <keyword>AC_ERLANG_(PATH|NEED)_ERLC?</keyword>
+      <keyword>AC_F(77|C)_DUMMY_MAIN</keyword>
+      <keyword>AC_FC_((FIXED|FREE)FORM|LINE_LENGTH)</keyword>
+      <keyword>AC_INCLUDES_DEFAULT</keyword>
+      <keyword>AC_LANG_POP</keyword>
+      <keyword>AC_PROG_(CC|CXX|OBJC(XX)?|F(77|C))</keyword>
+      <keyword>AS_EXIT</keyword>
+      <keyword>AT_INIT</keyword>
     </context>
 
+    <!-- Deprecated macros are highlighted as errors. We don't bother
+    highlighting their arguments properly, because they're deprecated anyway!-->
+
     <context id="ac-macros-obsolete" style-ref="ac-macro-obsolete">
       <prefix>\bAC_</prefix>
+      <keyword>AIX</keyword>
       <keyword>ALLOCA</keyword>
       <keyword>ARG_ARRAY</keyword>
       <keyword>CANONICAL_SYSTEM</keyword>
       <keyword>C_CROSS</keyword>
       <keyword>CHAR_UNSIGNED</keyword>
       <keyword>CHECKING</keyword>
-      <keyword>CHECK_TYPE</keyword>
       <keyword>C_LONG_DOUBLE</keyword>
       <keyword>COMPILE_CHECK</keyword>
+      <keyword>CONFIG_HEADER</keyword>
       <keyword>CONST</keyword>
       <keyword>CROSS_CHECK</keyword>
       <keyword>CYGWIN</keyword>
@@ -656,6 +1210,7 @@
       <keyword>DISABLE_SHARED</keyword>
       <keyword>DISABLE_STATIC</keyword>
       <keyword>DYNIX_SEQ</keyword>
+      <keyword>ENABLE(_(SHARED|STATIC))?</keyword>
       <keyword>EMXOS2</keyword>
       <keyword>ERROR</keyword>
       <keyword>EXEEXT</keyword>
@@ -663,10 +1218,12 @@
       <keyword>FIND_XTRA</keyword>
       <keyword>FOREACH</keyword>
       <keyword>FUNC_CHECK</keyword>
+      <keyword>FUNC_SETVBUF_REVERSED</keyword>
       <keyword>FUNC_WAIT3</keyword>
       <keyword>GCC_TRADITIONAL</keyword>
       <keyword>GETGROUPS_T</keyword>
       <keyword>GETLOADAVG</keyword>
+      <keyword>GNU_SOURCE</keyword>
       <keyword>HAVE_FUNCS</keyword>
       <keyword>HAVE_HEADERS</keyword>
       <keyword>HAVE_LIBRARY</keyword>
@@ -674,14 +1231,12 @@
       <keyword>HEADER_CHECK</keyword>
       <keyword>HEADER_EGREP</keyword>
       <keyword>HELP_STRING</keyword>
-      <keyword>INIT</keyword>
       <keyword>INLINE</keyword>
       <keyword>INT_16_BITS</keyword>
       <keyword>IRIX_SUN</keyword>
       <keyword>LANG_C</keyword>
       <keyword>LANG_CPLUSPLUS</keyword>
       <keyword>LANG_FORTRAN77</keyword>
-      <keyword>LANG_OBJC</keyword>
       <keyword>LANG_RESTORE</keyword>
       <keyword>LANG_SAVE</keyword>
       <keyword>LIBTOOL_DLOPEN</keyword>
@@ -694,6 +1249,7 @@
       <keyword>MAJOR_HEADER</keyword>
       <keyword>MEMORY_H</keyword>
       <keyword>MINGW32</keyword>
+      <keyword>MINIX</keyword>
       <keyword>MINUS_C_MINUS_O</keyword>
       <keyword>MMAP</keyword>
       <keyword>MODE_T</keyword>
@@ -701,9 +1257,9 @@
       <keyword>OBSOLETE</keyword>
       <keyword>OFF_T</keyword>
       <keyword>OUTPUT_COMMANDS</keyword>
-      <keyword>OUTPUT</keyword>
       <keyword>PID_T</keyword>
       <keyword>PREFIX</keyword>
+      <keyword>PROG_(INTL|LIB)TOOL</keyword>
       <keyword>PROGRAM_CHECK</keyword>
       <keyword>PROGRAM_EGREP</keyword>
       <keyword>PROGRAM_PATH</keyword>
@@ -745,60 +1301,75 @@
       <keyword>VPRINTF</keyword>
       <keyword>WAIT3</keyword>
       <keyword>WARN</keyword>
+      <keyword>WITH</keyword>
       <keyword>WORDS_BIGENDIAN</keyword>
       <keyword>XENIX_DIR</keyword>
       <keyword>YYTEXT_POINTER</keyword>
     </context>
 
-    <context id="am-macros-1" style-ref="ac-macro">
-      <keyword>_AM_DEPENDENCIES</keyword>
+    <context id="am-macros-noargs" style-ref="ac-macro">
+      <prefix>\bAM_</prefix>
+      <keyword>ENABLE_MULTILIB</keyword>
+      <keyword>GCONF_SOURCE_2</keyword>
+      <keyword>GLIB_GNU_GETTEXT</keyword>
+      <keyword>GNU_GETTEXT_INTL_SUBDIR</keyword>
+      <keyword>PATH_LISPDIR</keyword>
+      <keyword>PO_SUBDIRS</keyword>
+      <keyword>PROG_AS</keyword>
+      <keyword>PROG_CC_C_O</keyword>
+      <keyword>PROG_GCJ</keyword>
+      <keyword>PROG_LEX</keyword>
+      <keyword>SILENT_RULES</keyword>
+      <keyword>WITH_DMALLOC</keyword>
+      <keyword>WITH_REGEX</keyword>
     </context>
 
-    <context id="am-macros-2" style-ref="ac-macro">
+    <context id="am-macros-optargs" style-ref="ac-macro">
       <prefix>\bAM_</prefix>
-      <keyword>CONDITIONAL</keyword>
-      <keyword>CONFIG_HEADER</keyword>
-      <keyword>C_PROTOTYPES</keyword>
-      <keyword>DEP_TRACK</keyword>
-      <keyword>DISABLE_SHARED</keyword>
-      <keyword>DISABLE_STATIC</keyword>
-      <keyword>ENABLE_MULTILIB</keyword>
-      <keyword>GNU_GETTEXT</keyword>
-      <keyword>HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL</keyword>
       <keyword>INIT_AUTOMAKE</keyword>
-      <keyword>INSTALLCHECK_STD_OPTIONS_EXEMPT</keyword>
-      <keyword>JAVACFLAGS</keyword>
       <keyword>MAINTAINER_MODE</keyword>
+      <keyword>PATH_PYTHON</keyword>
+      <keyword>PROG_(UPC|VALAC)</keyword>
+    </context>
+
+    <context id="am-macros-private" style-ref="ac-macro-obsolete">
+      <prefix>\bAM_</prefix>
+      <keyword>DEP_TRACK</keyword>
       <keyword>MAKE_INCLUDE</keyword>
-      <keyword>MAKEINFOFLAGS</keyword>
       <keyword>OUTPUT_DEPENDENCY_COMMANDS</keyword>
-      <keyword>PATH_LISPDIR</keyword>
-      <keyword>PROG_AS</keyword>
-      <keyword>PROG_CC_C_O</keyword>
-      <keyword>PROG_CC_STDC</keyword>
-      <keyword>PROG_GCJ</keyword>
       <keyword>PROG_INSTALL_STRIP</keyword>
-      <keyword>PROG_LEX</keyword>
-      <keyword>PROG_LIBTOOL</keyword>
-      <keyword>RFLAGS</keyword>
-      <keyword>RUNTESTFLAGS</keyword>
       <keyword>SANITY_CHECK</keyword>
       <keyword>SET_DEPDIR</keyword>
+    </context>
+
+    <context id="am-macros-obsolete" style-ref="ac-macro-obsolete">
+      <prefix>\bAM_</prefix>
+      <keyword>C_PROTOTYPES</keyword>
+      <keyword>CONFIG_HEADER</keyword>
+      <keyword>HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL</keyword>
+      <keyword>PATH_CHECK</keyword>
+      <keyword>PROG_(LIBTOOL|MKDIR_P)</keyword>
       <keyword>SYS_POSIX_TERMIOS</keyword>
-      <keyword>WITH_DMALLOC</keyword>
-      <keyword>WITH_REGEX</keyword>
+      <keyword>(DIS|EN)ABLE_(STATIC|SHARED)</keyword>
+    </context>
+
+    <context id="misc-macros-noargs" style-ref="ac-macro">
+      <prefix>\b</prefix>
+      <keyword>__(file|o?line)__</keyword>
+      <keyword>LT_CMD_MAX_LEN</keyword>
+      <keyword>LT_FUNC_DLSYM_USCORE</keyword>
+      <keyword>LT_LIB_(M|DLLOAD)</keyword>
+      <keyword>LT_OUTPUT</keyword>
+      <keyword>LT_PATH_(LD|NM)</keyword>
+      <keyword>LT_SYS_DLOPEN_(SELF|DEPLIBS)</keyword>
+      <keyword>LT_SYS_MODULE_(EXT|PATH)</keyword>
+      <keyword>LT_SYS_(DLSEARCH_PATH|SYMBOL_USCORE)</keyword>
     </context>
 
-    <context id="misc-macros" style-ref="ac-macro">
-      <keyword>AM_GLIB_GNU_GETTEXT</keyword>
-      <keyword>AM_GLIB_DEFINE_LOCALEDIR</keyword>
-      <keyword>AM_GNU_GETTEXT(_VERSION|_NEED)?</keyword>
-      <keyword>AC_PROG_INTLTOOL</keyword>
-      <keyword>IT_PROG_INTLTOOL</keyword>
-      <keyword>AM_PATH_PROG_WITH_TEST</keyword>
+    <context id="misc-macros-optargs" style-ref="ac-macro">
+      <prefix>\b</prefix>
+      <keyword>LT_INIT</keyword>
       <keyword>PKG_PROG_PKG_CONFIG</keyword>
-      <keyword>PKG_CHECK_EXISTS</keyword>
-      <keyword>PKG_CHECK_MODULES</keyword>
     </context>
   </definitions>
 </language>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]