X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/99a33b77e15b9a075024701d060d912b2fd87caf..0877d0dc24ee792b9b14592869ea1aa0934aee58:/lisp/progmodes/autoconf.el diff --git a/lisp/progmodes/autoconf.el b/lisp/progmodes/autoconf.el index 3aa9a6cfb8..8a99ad6e1b 100644 --- a/lisp/progmodes/autoconf.el +++ b/lisp/progmodes/autoconf.el @@ -1,6 +1,6 @@ -;;; autoconf.el --- mode for editing Autoconf configure.in files +;;; autoconf.el --- mode for editing Autoconf configure.ac files -;; Copyright (C) 2000-2011 Free Software Foundation, Inc. +;; Copyright (C) 2000-2013 Free Software Foundation, Inc. ;; Author: Dave Love ;; Keywords: languages @@ -23,33 +23,31 @@ ;;; Commentary: ;; Provides fairly minimal font-lock, imenu and indentation support -;; for editing configure.in files. Only Autoconf syntax is processed. +;; for editing configure.ac files. Only Autoconf syntax is processed. ;; There is no attempt to deal with shell text -- probably that will ;; always lose. -;; This is specialized for configure.in files. It doesn't inherit the +;; This is specialized for configure.ac files. It doesn't inherit the ;; general M4 stuff from M4 mode. ;; There is also an autoconf-mode.el in existence. That appears to be -;; for editing the Autoconf M4 source, rather than configure.in files. +;; for editing the Autoconf M4 source, rather than configure.ac files. ;;; 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 `(("\\_" (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)) + "Major mode for editing Autoconf configure.ac files." + (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 ") + (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 (("_" . "w")))) + (setq-local imenu-generic-expression autoconf-imenu-generic-expression) + (setq-local imenu-syntax-alist '(("_" . "w"))) + (setq-local indent-line-function #'indent-relative) + (setq-local add-log-current-defun-function + #'autoconf-current-defun-function)) (provide 'autoconf-mode) (provide 'autoconf)