]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/autoconf.el
Merge from cygw32 branch
[gnu-emacs] / lisp / progmodes / autoconf.el
index 3225fef2dfa6dc8d9843f90d7a0a16a806b7de29..ac3a7282952c440e9a8adac92d9b402637139c1c 100644 (file)
 
 ;;; Code:
 
-(defvar font-lock-syntactic-keywords)
-
 (defvar autoconf-mode-map (make-sparse-keymap))
 
 (defvar autoconf-mode-hook nil
   "Hook run by `autoconf-mode'.")
 
 (defconst autoconf-definition-regexp
-  "AC_\\(SUBST\\|DEFINE\\(_UNQUOTED\\)?\\)(\\[*\\(\\sw+\\)\\]*")
+  "A\\(?:H_TEMPLATE\\|C_\\(?:SUBST\\|DEFINE\\(?:_UNQUOTED\\)?\\)\\)(\\[*\\(\\sw+\\)\\]*")
 
 (defvar autoconf-font-lock-keywords
   `(("\\_<A[CHMS]_\\sw+" . font-lock-keyword-face)
     (,autoconf-definition-regexp
-     3 font-lock-function-name-face)
+     1 font-lock-function-name-face)
     ;; Are any other M4 keywords really appropriate for configure.ac,
     ;; given that we do `dnl'?
     ("changequote" . font-lock-keyword-face)))
@@ -61,7 +59,7 @@
     table))
 
 (defvar autoconf-imenu-generic-expression
-  (list (list nil autoconf-definition-regexp 3)))
+  (list (list nil autoconf-definition-regexp 1)))
 
 ;; It's not clear how best to implement this.
 (defun autoconf-current-defun-function ()
@@ -71,10 +69,11 @@ searching backwards at another AC_... command."
   (save-excursion
     (with-syntax-table (copy-syntax-table autoconf-mode-syntax-table)
       (modify-syntax-entry ?_ "w")
+      (skip-syntax-forward "w" (line-end-position))
       (if (re-search-backward autoconf-definition-regexp
                              (save-excursion (beginning-of-defun) (point))
                              t)
-         (match-string-no-properties 3)))))
+         (match-string-no-properties 1)))))
 
 ;;;###autoload
 (define-derived-mode autoconf-mode prog-mode "Autoconf"