X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/4dc7c8d5795458e89d19b59f64760e155c2cd70b..5deebc3c914c86e84d11661a7877c00b2d7fddd1:/lisp/progmodes/autoconf.el diff --git a/lisp/progmodes/autoconf.el b/lisp/progmodes/autoconf.el index 3225fef2df..205e663629 100644 --- a/lisp/progmodes/autoconf.el +++ b/lisp/progmodes/autoconf.el @@ -1,6 +1,6 @@ ;;; autoconf.el --- mode for editing Autoconf configure.ac files -;; Copyright (C) 2000-2012 Free Software Foundation, Inc. +;; Copyright (C) 2000-2016 Free Software Foundation, Inc. ;; Author: Dave Love ;; Keywords: languages @@ -35,20 +35,18 @@ ;;; 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\\|\\s_\\)+\\)\\]*") (defvar autoconf-font-lock-keywords - `(("\\_" (0 "<")))) - (set (make-local-variable 'font-lock-defaults) - `(autoconf-font-lock-keywords nil nil (("_" . "w")))) - (set (make-local-variable 'imenu-generic-expression) - autoconf-imenu-generic-expression) - (set (make-local-variable 'imenu-syntax-alist) '(("_" . "w"))) - (set (make-local-variable 'indent-line-function) #'indent-relative) - (set (make-local-variable 'add-log-current-defun-function) - #'autoconf-current-defun-function)) + (setq-local parens-require-spaces nil) ; for M4 arg lists + (setq-local defun-prompt-regexp "^[ \t]*A[CM]_\\(\\sw\\|\\s_\\)+") + (setq-local comment-start "dnl ") + ;; We want to avoid matching "dnl" in other text. + (setq-local comment-start-skip "\\(?:\\(\\W\\|^\\)dnl\\|#\\) +") + (setq-local syntax-propertize-function + (syntax-propertize-rules ("\\" (0 "<")))) + (setq-local font-lock-defaults + `(autoconf-font-lock-keywords nil nil)) + (setq-local imenu-generic-expression autoconf-imenu-generic-expression) + (setq-local indent-line-function #'indent-relative) + (setq-local add-log-current-defun-function + #'autoconf-current-defun-function)) (provide 'autoconf-mode) (provide 'autoconf)