[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
29-autotest-mode.patch
From: |
Akim Demaille |
Subject: |
29-autotest-mode.patch |
Date: |
Mon, 20 Aug 2001 16:47:32 +0200 |
I grew tired to having to write ChangeLog entries by hand for
Autotest, so I'm know using an Autotest mode. I'm an XEmacs user, so
below I provide what I will send them. If someone wants to contribute
the same for Emacs, please, do! Maybe the file works as is, I just
dunno. It'd be great if someone could try, and even better, make it
Emacsen compatible.
---------------------------------------- autotest.el
;;; autotest-mode.el --- autotest code editing commands for Emacs
;; Author: Akim Demaille (address@hidden)
;; Keywords: languages, faces, m4, Autotest
;; This file is part of XEmacs
;; XEmacs is free software; you can redistribute it and/or modify it
;; under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; XEmacs is distributed in the hope that it will be useful, but
;; WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with XEmacs; see the file COPYING. If not, write to the Free
;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
;; 02111-1307, USA.
;;; Synched up with: not in FSF.
;;; Commentary:
;; A major mode for editing autotest input (like testsuite.at).
;; Derived from autoconf-mode.el, by Martin Buchholz (address@hidden).
;;; Code:
(defvar autotest-font-lock-keywords
`(("\\bdnl\\b\\(.*\\)" 1 font-lock-comment-face t)
("address@hidden" . font-lock-variable-name-face)
("^\\(m4_define\\|m4_defun\\)(\\[*\\([A-Za-z0-9_]+\\)" 2
font-lock-function-name-face)
("^AT_SETUP(\\[+\\([^]]+\\)" 1 font-lock-function-name-face)
("^AT_DATA(\\[+\\([^]]+\\)" 1 font-lock-variable-name-face)
("\\b\\(_?m4_[_a-z0-9]*\\|_?AT_[_A-Z0-9]*\\)\\b" . font-lock-keyword-face)
"default font-lock-keywords")
)
(defvar autotest-mode-syntax-table nil
"syntax table used in autotest mode")
(setq autotest-mode-syntax-table (make-syntax-table))
(modify-syntax-entry ?\" "\"" autotest-mode-syntax-table)
;;(modify-syntax-entry ?\' "\"" autotest-mode-syntax-table)
(modify-syntax-entry ?# "<\n" autotest-mode-syntax-table)
(modify-syntax-entry ?\n ">#" autotest-mode-syntax-table)
(modify-syntax-entry ?\( "()" autotest-mode-syntax-table)
(modify-syntax-entry ?\) ")(" autotest-mode-syntax-table)
(modify-syntax-entry ?\[ "(]" autotest-mode-syntax-table)
(modify-syntax-entry ?\] ")[" autotest-mode-syntax-table)
(modify-syntax-entry ?* "." autotest-mode-syntax-table)
(modify-syntax-entry ?_ "_" autotest-mode-syntax-table)
(defvar autotest-mode-map
(let ((map (make-sparse-keymap)))
(define-key map '[(control c) (\;)] 'comment-region)
map))
;;;###autoload
(defun autotest-mode ()
"A major-mode to edit Autotest input files like testsuite.at
\\{autotest-mode-map}
"
(interactive)
(kill-all-local-variables)
(use-local-map autotest-mode-map)
(make-local-variable 'comment-start)
(setq comment-start "# ")
(make-local-variable 'parse-sexp-ignore-comments)
(setq parse-sexp-ignore-comments t)
(make-local-variable 'font-lock-defaults)
(setq major-mode 'autotest-mode)
(setq mode-name "Autotest")
(setq font-lock-defaults `(autotest-font-lock-keywords nil))
(set-syntax-table autotest-mode-syntax-table)
(run-hooks 'autotest-mode-hook))
(provide 'autotest-mode)
;;; autotest-mode.el ends here
---------------------------------------- autotest.el
And here is the snippet I have in add-log.el for Autoconf and
Autotest (I left some context).
------------------------------
((eq major-mode 'perl-mode)
(if (re-search-backward "^sub[ \t]+\\([^ \t\n]+\\)" nil t)
(buffer-substring (match-beginning 1)
(match-end 1))))
((eq major-mode 'autoconf-mode)
(if (re-search-backward
"^\\(m4_define\\|m4_defun\\|A._DEFUN\\)(\\[+\\([A-Za-z0-9_]+\\)" nil t)
(buffer-substring (match-beginning 2)
(match-end 2))))
((eq major-mode 'autotest-mode)
(if (re-search-backward
"^\\(m4_define\\|m4_defun\\|AT_SETUP\\)(\\[+\\([^]]+\\)" nil t)
(buffer-substring (match-beginning 2)
(match-end 2))))
((eq major-mode 'fortran-mode)
------------------------------
It is on purpose that neither add-log nor autotest-mode work properly
with non quoted arguments :P (hence the `\\[+', not `\\[*').
Index: ChangeLog
from Akim Demaille <address@hidden>
* tests/base.at, tests/compile.at, tests/foreign.at,
* tests/m4sh.at, tests/m4sugar.at, tests/mktests.sh,
* tests/semantics.at, tests/suite.at, tests/tools.at,
* tests/torture.at: Ask Autotest mode, not Autoconf mode.
Index: tests/base.at
--- tests/base.at Tue, 14 Aug 2001 01:47:02 +0200 akim
+++ tests/base.at Sun, 19 Aug 2001 10:00:37 +0200 akim
@@ -1,4 +1,4 @@
-# -*- autoconf -*-
+# -*- Autotest -*-
AT_BANNER([Autoconf base layer.])
Index: tests/compile.at
--- tests/compile.at Tue, 14 Aug 2001 01:47:02 +0200 akim
+++ tests/compile.at Sun, 19 Aug 2001 10:00:37 +0200 akim
@@ -1,4 +1,4 @@
-# -*- autoconf -*-
+# -*- Autotest -*-
AT_BANNER([Low level compiling/preprocessing macros.])
Index: tests/foreign.at
--- tests/foreign.at Tue, 14 Aug 2001 01:47:02 +0200 akim
+++ tests/foreign.at Sun, 19 Aug 2001 10:00:37 +0200 akim
@@ -1,4 +1,4 @@
-# -*- autoconf -*-
+# -*- Autotest -*-
AT_BANNER([Compatibility with other tools.])
Index: tests/m4sh.at
--- tests/m4sh.at Tue, 14 Aug 2001 01:47:02 +0200 akim
+++ tests/m4sh.at Sun, 19 Aug 2001 10:00:37 +0200 akim
@@ -1,4 +1,4 @@
-# -*- Autoconf -*-
+# -*- Autotest -*-
AT_BANNER([M4sh.])
Index: tests/m4sugar.at
--- tests/m4sugar.at Tue, 14 Aug 2001 12:02:45 +0200 akim
+++ tests/m4sugar.at Sun, 19 Aug 2001 10:00:37 +0200 akim
@@ -1,4 +1,4 @@
-# -*- Autoconf -*-
+# -*- Autotest -*-
AT_BANNER([M4sugar.])
Index: tests/mktests.sh
--- tests/mktests.sh Tue, 14 Aug 2001 01:47:02 +0200 akim
+++ tests/mktests.sh Sun, 19 Aug 2001 10:00:37 +0200 akim
@@ -197,7 +197,8 @@
# Filter out required macros.
{
sed 's/^ *//' <<MK_EOF
- # Generated by $as_me, do not edit by hand. -*- Autoconf -*-
+ # Generated by $as_me, do not edit by hand. -*- Autotest -*-
+ # Copyright 2000, 2001 Free Software Foundation, Inc.
AT_BANNER([Testing autoconf/$base macros.])
Index: tests/semantics.at
--- tests/semantics.at Tue, 14 Aug 2001 01:47:02 +0200 akim
+++ tests/semantics.at Sun, 19 Aug 2001 10:00:37 +0200 akim
@@ -1,4 +1,4 @@
-# -*- autoconf -*-
+# -*- Autotest -*-
AT_BANNER([Semantics.])
Index: tests/suite.at
--- tests/suite.at Tue, 14 Aug 2001 01:47:02 +0200 akim
+++ tests/suite.at Sun, 19 Aug 2001 10:00:37 +0200 akim
@@ -1,4 +1,4 @@
-# Validation suite for Autoconf -*- Autoconf -*-
+# Validation suite for Autoconf -*- Autotest -*-
# Copyright 2000, 2001 Free Software Foundation, Inc.
#
Index: tests/tools.at
--- tests/tools.at Tue, 14 Aug 2001 11:44:55 +0200 akim
+++ tests/tools.at Sun, 19 Aug 2001 10:00:37 +0200 akim
@@ -1,4 +1,4 @@
-# -*- autoconf -*-
+# -*- Autotest -*-
AT_BANNER([Executables (autoheader, autoupdate...).])
Index: tests/torture.at
--- tests/torture.at Tue, 14 Aug 2001 01:47:02 +0200 akim
+++ tests/torture.at Sun, 19 Aug 2001 10:00:37 +0200 akim
@@ -1,4 +1,4 @@
-# -*- autoconf -*-
+# -*- Autotest -*-
AT_BANNER([[Testing config.status.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- 29-autotest-mode.patch,
Akim Demaille <=