annotate lisp/modes/autoconf-mode.el @ 183:e121b013d1f0 r20-3b18

Import from CVS: tag r20-3b18
author cvs
date Mon, 13 Aug 2007 09:54:23 +0200
parents 59463afc5666
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
1 ;;; autoconf-mode.el --- autoconf code editing commands for Emacs
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
2
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
3 ;; Author: Martin Buchholz (mrb@eng.sun.com)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
4 ;; Maintainer: Martin Buchholz
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
5 ;; Keywords: languages, faces, m4, configure
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
6
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
7 ;; This file is part of XEmacs
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
8
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
9 ;; XEmacs is free software; you can redistribute it and/or modify it
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
10 ;; under the terms of the GNU General Public License as published by
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
11 ;; the Free Software Foundation; either version 2, or (at your option)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
12 ;; any later version.
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
13
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
14 ;; XEmacs is distributed in the hope that it will be useful, but
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
15 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
17 ;; General Public License for more details.
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
18
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
20 ;; along with XEmacs; see the file COPYING. If not, write to the Free
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
21 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
22 ;; 02111-1307, USA.
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
23
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
24 ;;; Synched up with: not in FSF.
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
25
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
26 ;;; Commentary:
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
27
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
28 ;; A major mode for editing autoconf input (like configure.in).
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
29 ;; Derived from m4-mode.el by Andrew Csillag (drew@staff.prodigy.com)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
30
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
31 ;;; Code:
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
32
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
33 ;;thank god for make-regexp.el!
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
34 (defvar autoconf-font-lock-keywords
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
35 `(("\\bdnl \\(.*\\)" 1 font-lock-comment-face t)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
36 ("\\$[0-9*#@]" . font-lock-variable-name-face)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
37 ("\\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)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
38 "default font-lock-keywords")
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
39 )
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
40
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
41 (defvar autoconf-mode-syntax-table nil
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
42 "syntax table used in autoconf mode")
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
43 (setq autoconf-mode-syntax-table (make-syntax-table))
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
44 (modify-syntax-entry ?\" "\"" autoconf-mode-syntax-table)
151
59463afc5666 Import from CVS: tag r20-3b2
cvs
parents: 149
diff changeset
45 ;;(modify-syntax-entry ?\' "\"" autoconf-mode-syntax-table)
149
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
46 (modify-syntax-entry ?# "<\n" autoconf-mode-syntax-table)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
47 (modify-syntax-entry ?\n ">#" autoconf-mode-syntax-table)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
48 (modify-syntax-entry ?\( "." autoconf-mode-syntax-table)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
49 (modify-syntax-entry ?\) "." autoconf-mode-syntax-table)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
50 (modify-syntax-entry ?\[ "(]" autoconf-mode-syntax-table)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
51 (modify-syntax-entry ?\] ")[" autoconf-mode-syntax-table)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
52 (modify-syntax-entry ?* "." autoconf-mode-syntax-table)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
53 (modify-syntax-entry ?_ "_" autoconf-mode-syntax-table)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
54
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
55 (defvar autoconf-mode-map
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
56 (let ((map (make-sparse-keymap)))
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
57 (define-key map "\C-c\C-c" 'comment-region)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
58 map))
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
59
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
60 ;;;###autoload
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
61 (defun autoconf-mode ()
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
62 "A major-mode to edit autoconf input files like configure.in
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
63 \\{autoconf-mode-map}
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
64 "
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
65 (interactive)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
66 (kill-all-local-variables)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
67 (use-local-map autoconf-mode-map)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
68
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
69 (make-local-variable 'comment-start)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
70 (setq comment-start "dnl")
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
71 (make-local-variable 'parse-sexp-ignore-comments)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
72 (setq parse-sexp-ignore-comments t)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
73
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
74 (make-local-variable 'font-lock-defaults)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
75 (setq major-mode 'autoconf-mode)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
76 (setq mode-name "Autoconf")
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
77 (setq font-lock-defaults `(autoconf-font-lock-keywords nil))
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
78 (set-syntax-table autoconf-mode-syntax-table)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
79 (run-hooks 'autoconf-mode-hook))
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
80
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
81 (provide 'autoconf-mode)
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
82
538048ae2ab8 Import from CVS: tag r20-3b1
cvs
parents:
diff changeset
83 ;;; autoconf-mode.el ends here