[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: Emacs modes
From: |
Akim Demaille |
Subject: |
FYI: Emacs modes |
Date: |
28 Sep 2001 14:14:04 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence) |
I would really appreciate if some Emacs guru could have a look at the
files themselves. Also, I don't know what should be done to trigger
the mode automatically, and what can be done for the ChangeLog
entries. Personally, I modified my own
add-log.el::add-log-current-defun to include this:
((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))))
but that's intrusive. Any means to register something like
autotest-mode-add-log or so?
Index: ChangeLog
from Akim Demaille <address@hidden>
* lib/emacs/autoconf-mode.el, lib/emacs/autotest-mode.el: New.
* configure.ac: Adjust.
Index: NEWS
===================================================================
RCS file: /cvs/autoconf/NEWS,v
retrieving revision 1.197
diff -u -u -r1.197 NEWS
--- NEWS 2001/09/27 13:28:15 1.197
+++ NEWS 2001/09/28 11:56:17
@@ -23,6 +23,9 @@
@builddir@, @top_builddir@, @srcpath@, @top_srcpath@, @buildpath@,
@address@hidden
+** Emacs
+ Autoconf and Autotest modes are provided.
+
** autom4te
New executable, used by the Autoconf suite to cache and speed up
most processing.
Index: aclocal.m4
===================================================================
RCS file: /cvs/autoconf/aclocal.m4,v
retrieving revision 1.11
diff -u -u -r1.11 aclocal.m4
--- aclocal.m4 2001/08/27 07:18:39 1.11
+++ aclocal.m4 2001/09/28 11:56:17
@@ -4,6 +4,7 @@
m4_include([m4/init.m4])
m4_include([m4/install-sh.m4])
m4_include([m4/m4.m4])
+m4_include([m4/lispdir.m4])
m4_include([m4/missing.m4])
m4_include([m4/sanity.m4])
m4_include([m4/strip.m4])
Index: configure.ac
===================================================================
RCS file: /cvs/autoconf/configure.ac,v
retrieving revision 1.22
diff -u -u -r1.22 configure.ac
--- configure.ac 2001/09/23 17:17:46 1.22
+++ configure.ac 2001/09/28 11:56:17
@@ -20,15 +20,19 @@
# 02111-1307, USA.
# We need AC_CONFIG_TESTDIR.
-AC_PREREQ(2.52d)
+AC_PREREQ(2.52e)
AC_INIT(GNU Autoconf, 2.52e, address@hidden)
AC_CONFIG_SRCDIR(ChangeLog)
+
AC_CONFIG_AUX_DIR(config)
+AC_CONFIG_FILES(config/Makefile)
+
AM_INIT_AUTOMAKE(autoconf, 2.52e)
# Initialize the test suite and build position independent wrappers.
AC_CONFIG_TESTDIR(tests)
+AC_CONFIG_FILES(tests/Makefile)
AC_CONFIG_FILES([tests/autoconf:tests/wrapsh.in],
[chmod +x tests/autoconf])
AC_CONFIG_FILES([tests/autoheader:tests/wrappl.in],
@@ -45,6 +49,7 @@
[chmod +x tests/ifnames])
AC_PATH_PROG(EXPR, expr)
+
# We use a path for GNU m4 so even if users have another m4 first in
# their path, the installer can configure with a path that has GNU m4
# first and get that path embedded in the installed autoconf and
@@ -57,7 +62,8 @@
# a AC-SUBST inside AC-PROG-GNU-M4. Grmph!
AC_SUBST(M4)
-# Generating man pages.
+# Man pages.
+AC_CONFIG_FILES(man/Makefile)
AM_MISSING_PROG(HELP2MAN, help2man)
# We use a path for perl so the #! line in autoscan will work.
@@ -70,18 +76,21 @@
AC_MSG_ERROR([Perl 5.005 or better is required])
}
+# Emacs modes.
+AC_CONFIG_FILES(lib/emacs/Makefile)
+AM_PATH_LISPDIR
+
# Automake can't see inner AC_SUBSTS (`aclocal' is bypassed), so we tag the
# AC_SUBSTS here too.
AC_SUBST(PACKAGE_NAME)
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
-AC_CONFIG_FILES(Makefile m4/Makefile man/Makefile doc/Makefile config/Makefile
+AC_CONFIG_FILES(Makefile m4/Makefile doc/Makefile
lib/Makefile lib/Autom4te/Makefile lib/autoscan/Makefile
lib/m4sugar/Makefile
lib/autoconf/Makefile lib/autotest/Makefile
- bin/Makefile
- tests/Makefile)
+ bin/Makefile)
AC_OUTPUT
# Report the state of this version of Autoconf if this is a beta.
Index: lib/Makefile.am
===================================================================
RCS file: /cvs/autoconf/lib/Makefile.am,v
retrieving revision 1.5
diff -u -u -r1.5 Makefile.am
--- lib/Makefile.am 2001/08/31 13:36:31 1.5
+++ lib/Makefile.am 2001/09/28 11:56:17
@@ -1,6 +1,6 @@
## Process this file with automake to create Makefile.in
-SUBDIRS = Autom4te m4sugar autoconf autotest autoscan
+SUBDIRS = Autom4te m4sugar autoconf autotest autoscan emacs
nodist_pkgdata_DATA = autom4te.cfg
EXTRA_DIST = autom4te.in
Index: lib/Makefile.in
===================================================================
RCS file: /cvs/autoconf/lib/Makefile.in,v
retrieving revision 1.7
diff -u -u -r1.7 Makefile.in
--- lib/Makefile.in 2001/09/13 06:54:36 1.7
+++ lib/Makefile.in 2001/09/28 11:56:17
@@ -63,7 +63,7 @@
PERL = @PERL@
VERSION = @VERSION@
-SUBDIRS = Autom4te m4sugar autoconf autotest autoscan
+SUBDIRS = Autom4te m4sugar autoconf autotest autoscan emacs
nodist_pkgdata_DATA = autom4te.cfg
EXTRA_DIST = autom4te.in
Index: lib/emacs/.cvsignore
===================================================================
RCS file: .cvsignore
diff -N .cvsignore
--- /dev/null Sat Apr 14 20:46:23 2001
+++ lib/emacs/.cvsignore Fri Sep 28 07:56:17 2001
@@ -0,0 +1,2 @@
+Makefile
+*.elc
Index: lib/emacs/Makefile.am
===================================================================
RCS file: Makefile.am
diff -N Makefile.am
--- /dev/null Sat Apr 14 20:46:23 2001
+++ lib/emacs/Makefile.am Fri Sep 28 07:56:17 2001
@@ -0,0 +1,20 @@
+## Process this file with automake to create Makefile.in
+
+## Copyright 2001 Free Software Foundation, Inc.
+##
+## This program 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.
+##
+## This program 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 this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+## 02111-1307, USA.
+
+dist_lisp_LISP = autoconf-mode.el autotest-mode.el
Index: lib/emacs/autoconf-mode.el
===================================================================
RCS file: autoconf-mode.el
diff -N autoconf-mode.el
--- /dev/null Sat Apr 14 20:46:23 2001
+++ lib/emacs/autoconf-mode.el Fri Sep 28 07:56:17 2001
@@ -0,0 +1,82 @@
+;;; autoconf-mode.el --- autoconf code editing commands for Emacs
+
+;; Author: Martin Buchholz (address@hidden)
+;; Maintainer: Martin Buchholz
+;; Keywords: languages, faces, m4, configure
+
+;; This file is part of Autoconf
+
+;; Copyright 2001 Free Software Foundation, Inc.
+;;
+;; This program 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.
+;;
+;; This program 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 this program; if not, write to the Free Software
+;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;; A major mode for editing autoconf input (like configure.in).
+;; Derived from m4-mode.el by Andrew Csillag (address@hidden)
+
+;;; Code:
+
+;;thank god for make-regexp.el!
+(defvar autoconf-font-lock-keywords
+ `(("\\bdnl \\(.*\\)" 1 font-lock-comment-face t)
+ ("address@hidden" . font-lock-variable-name-face)
+
("\\b\\(m4_\\)?\\(builtin\\|change\\(com\\|quote\\|word\\)\\|d\\(e\\(bug\\(file\\|mode\\)\\|cr\\|f\\(ine\\|n\\)\\)\\|iv\\(ert\\|num\\)\\|nl\\|umpdef\\)\\|e\\(rrprint\\|syscmd\\|val\\)\\|f\\(ile\\|ormat\\)\\|gnu\\|i\\(f\\(def\\|else\\)\\|n\\(c\\(lude\\|r\\)\\|d\\(ex\\|ir\\)\\)\\)\\|l\\(en\\|ine\\)\\|m\\(4\\(exit\\|wrap\\)\\|aketemp\\)\\|p\\(atsubst\\|opdef\\|ushdef\\)\\|regexp\\|s\\(hift\\|include\\|ubstr\\|ys\\(cmd\\|val\\)\\)\\|tra\\(ceo\\(ff\\|n\\)\\|nslit\\)\\|un\\(d\\(efine\\|ivert\\)\\|ix\\)\\)\\b"
. font-lock-keyword-face)
+ ("^\\(\\(m4_\\)?define\\|A._DEFUN\\)(\\[?\\([A-Za-z0-9_]+\\)" 3
font-lock-function-name-face)
+ "default font-lock-keywords")
+)
+
+(defvar autoconf-mode-syntax-table nil
+ "syntax table used in autoconf mode")
+(setq autoconf-mode-syntax-table (make-syntax-table))
+(modify-syntax-entry ?\" "\"" autoconf-mode-syntax-table)
+;;(modify-syntax-entry ?\' "\"" autoconf-mode-syntax-table)
+(modify-syntax-entry ?# "<\n" autoconf-mode-syntax-table)
+(modify-syntax-entry ?\n ">#" autoconf-mode-syntax-table)
+(modify-syntax-entry ?\( "()" autoconf-mode-syntax-table)
+(modify-syntax-entry ?\) ")(" autoconf-mode-syntax-table)
+(modify-syntax-entry ?\[ "(]" autoconf-mode-syntax-table)
+(modify-syntax-entry ?\] ")[" autoconf-mode-syntax-table)
+(modify-syntax-entry ?* "." autoconf-mode-syntax-table)
+(modify-syntax-entry ?_ "_" autoconf-mode-syntax-table)
+
+(defvar autoconf-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "\C-c\C-c" 'comment-region)
+ map))
+
+;;;###autoload
+(defun autoconf-mode ()
+ "A major-mode to edit autoconf input files like configure.in
+\\{autoconf-mode-map}
+"
+ (interactive)
+ (kill-all-local-variables)
+ (use-local-map autoconf-mode-map)
+
+ (make-local-variable 'comment-start)
+ (setq comment-start "dnl")
+ (make-local-variable 'parse-sexp-ignore-comments)
+ (setq parse-sexp-ignore-comments t)
+
+ (make-local-variable 'font-lock-defaults)
+ (setq major-mode 'autoconf-mode)
+ (setq mode-name "Autoconf")
+ (setq font-lock-defaults `(autoconf-font-lock-keywords nil))
+ (set-syntax-table autoconf-mode-syntax-table)
+ (run-hooks 'autoconf-mode-hook))
+
+(provide 'autoconf-mode)
+
+;;; autoconf-mode.el ends here
Index: lib/emacs/autotest-mode.el
===================================================================
RCS file: autotest-mode.el
diff -N autotest-mode.el
--- /dev/null Sat Apr 14 20:46:23 2001
+++ lib/emacs/autotest-mode.el Fri Sep 28 07:56:17 2001
@@ -0,0 +1,84 @@
+;;; autotest-mode.el --- autotest code editing commands for Emacs
+
+;; Author: Akim Demaille (address@hidden)
+;; Keywords: languages, faces, m4, Autotest
+
+;; This file is part of Autoconf
+
+;; Copyright 2001 Free Software Foundation, Inc.
+;;
+;; This program 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.
+;;
+;; This program 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 this program; if not, write to the Free Software
+;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;; 02111-1307, USA.
+
+;;; 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]*\\|_?A[ST]_[_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
Index: lib/emacs/elisp-comp
===================================================================
RCS file: elisp-comp
diff -N elisp-comp
--- /dev/null Sat Apr 14 20:46:23 2001
+++ lib/emacs/elisp-comp Fri Sep 28 07:56:17 2001
@@ -0,0 +1,54 @@
+#!/bin/sh
+# Copyright 1995 Free Software Foundation, Inc.
+# François Pinard <address@hidden>, 1995.
+#
+# This program 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.
+#
+# This program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This script byte-compiles all `.el' files which are part of its
+# arguments, using GNU Emacs, and put the resulting `.elc' files into
+# the current directory, so disregarding the original directories used
+# in `.el' arguments.
+#
+# This script manages in such a way that all Emacs LISP files to
+# be compiled are made visible between themselves, in the event
+# they require or load-library one another.
+
+if test $# = 0; then
+ echo 1>&2 "No files given to $0"
+ exit 1
+else
+ if test -z "$EMACS" || test "$EMACS" = "t"; then
+ # Value of "t" means we are running in a shell under Emacs.
+ # Just assume Emacs is called "emacs".
+ EMACS=emacs
+ fi
+
+ tempdir=elc.$$
+ mkdir $tempdir
+ cp $* $tempdir
+ cd $tempdir
+
+ echo "(setq load-path (cons nil load-path))" > script
+ $EMACS -batch -q -l script -f batch-byte-compile *.el
+ mv *.elc ..
+
+ cd ..
+ rm -fr $tempdir
+fi
Index: m4/Makefile.am
===================================================================
RCS file: /cvs/autoconf/m4/Makefile.am,v
retrieving revision 1.5
diff -u -u -r1.5 Makefile.am
--- m4/Makefile.am 2001/08/27 07:18:40 1.5
+++ m4/Makefile.am 2001/09/28 11:56:17
@@ -25,6 +25,7 @@
init.m4 \
install-sh.m4 \
m4.m4 \
+lispdir.m4 \
missing.m4 \
sanity.m4 \
strip.m4
Index: m4/Makefile.in
===================================================================
RCS file: /cvs/autoconf/m4/Makefile.in,v
retrieving revision 1.21
diff -u -u -r1.21 Makefile.in
--- m4/Makefile.in 2001/09/13 06:54:36 1.21
+++ m4/Makefile.in 2001/09/28 11:56:17
@@ -70,6 +70,7 @@
init.m4 \
install-sh.m4 \
m4.m4 \
+lispdir.m4 \
missing.m4 \
sanity.m4 \
strip.m4
Index: m4/lispdir.m4
===================================================================
RCS file: lispdir.m4
diff -N lispdir.m4
--- /dev/null Sat Apr 14 20:46:23 2001
+++ m4/lispdir.m4 Fri Sep 28 07:56:17 2001
@@ -0,0 +1,49 @@
+## ------------------------
+## Emacs LISP file handling
+## From Ulrich Drepper
+## Almost entirely rewritten by Alexandre Oliva
+## ------------------------
+
+# Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+# This program 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.
+
+# This program 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 this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 3
+
+AC_DEFUN([AM_PATH_LISPDIR],
+ [AC_ARG_WITH(lispdir,
+ [ --with-lispdir Override the default lisp directory ],
+ [ lispdir="$withval"
+ AC_MSG_CHECKING([where .elc files should go])
+ AC_MSG_RESULT([$lispdir])],
+ [
+ # If set to t, that means we are running in a shell under Emacs.
+ # If you have an Emacs named "t", then use the full path.
+ test x"$EMACS" = xt && EMACS=
+ AC_CHECK_PROGS(EMACS, emacs xemacs, no)
+ if test $EMACS != "no"; then
+ if test x${lispdir+set} != xset; then
+ AC_CACHE_CHECK([where .elc files should go], [am_cv_lispdir], [dnl
+ am_cv_lispdir=`$EMACS -batch -q -eval '(while load-path (princ (concat
(car load-path) "\n")) (setq load-path (cdr load-path)))' | sed -n -e 's,/$,,'
-e '/.*\/lib\/\(x\?emacs\/site-lisp\)$/{s,,${libdir}/\1,;p;q;}' -e
'/.*\/share\/\(x\?emacs\/site-lisp\)$/{s,,${datadir}/\1,;p;q;}'`
+ if test -z "$am_cv_lispdir"; then
+ am_cv_lispdir='${datadir}/emacs/site-lisp'
+ fi
+ ])
+ lispdir="$am_cv_lispdir"
+ fi
+ fi
+ ])
+ AC_SUBST(lispdir)])
- FYI: Emacs modes,
Akim Demaille <=