Mercurial > emacs
annotate lisp/progmodes/awk-mode.el @ 678:8cff3b3bd089
*** empty log message ***
author | Roland McGrath <roland@gnu.org> |
---|---|
date | Wed, 03 Jun 1992 06:44:38 +0000 |
parents | 8a533acedb77 |
children | e694e0879463 |
rev | line source |
---|---|
662
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
257
diff
changeset
|
1 ;;; awk-mode.el --- AWK code editing commands for Emacs |
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
257
diff
changeset
|
2 |
257 | 3 ;; Copyright (C) 1988 Free Software Foundation, Inc. |
4 | |
5 ;; This file is part of GNU Emacs. | |
6 | |
7 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
8 ;; it under the terms of the GNU General Public License as published by | |
9 ;; the Free Software Foundation; either version 1, or (at your option) | |
10 ;; any later version. | |
11 | |
12 ;; GNU Emacs is distributed in the hope that it will be useful, | |
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 ;; GNU General Public License for more details. | |
16 | |
17 ;; You should have received a copy of the GNU General Public License | |
18 ;; along with GNU Emacs; see the file COPYING. If not, write to | |
19 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
20 | |
21 | |
22 (defvar awk-mode-syntax-table nil | |
23 "Syntax table in use in Awk-mode buffers.") | |
24 | |
25 (if awk-mode-syntax-table | |
26 () | |
27 (setq awk-mode-syntax-table (make-syntax-table)) | |
28 (modify-syntax-entry ?\\ "\\" awk-mode-syntax-table) | |
29 (modify-syntax-entry ?\n "> " emacs-lisp-mode-syntax-table) | |
30 (modify-syntax-entry ?\f "> " emacs-lisp-mode-syntax-table) | |
31 (modify-syntax-entry ?\# "< " emacs-lisp-mode-syntax-table) | |
32 (modify-syntax-entry ?/ "." awk-mode-syntax-table) | |
33 (modify-syntax-entry ?* "." awk-mode-syntax-table) | |
34 (modify-syntax-entry ?+ "." awk-mode-syntax-table) | |
35 (modify-syntax-entry ?- "." awk-mode-syntax-table) | |
36 (modify-syntax-entry ?= "." awk-mode-syntax-table) | |
37 (modify-syntax-entry ?% "." awk-mode-syntax-table) | |
38 (modify-syntax-entry ?< "." awk-mode-syntax-table) | |
39 (modify-syntax-entry ?> "." awk-mode-syntax-table) | |
40 (modify-syntax-entry ?& "." awk-mode-syntax-table) | |
41 (modify-syntax-entry ?| "." awk-mode-syntax-table) | |
42 (modify-syntax-entry ?\' "\"" awk-mode-syntax-table)) | |
43 | |
44 (defvar awk-mode-abbrev-table nil | |
45 "Abbrev table in use in Awk-mode buffers.") | |
46 (define-abbrev-table 'awk-mode-abbrev-table ()) | |
47 | |
48 ;;;###autoload | |
49 (defun awk-mode () | |
50 "Major mode for editing AWK code. | |
51 This is much like C mode except for the syntax of comments. It uses | |
52 the same keymap as C mode and has the same variables for customizing | |
53 indentation. It has its own abbrev table and its own syntax table. | |
54 | |
55 Turning on AWK mode calls the value of the variable `awk-mode-hook' | |
56 with no args, if that value is non-nil." | |
57 (interactive) | |
58 (kill-all-local-variables) | |
59 (use-local-map c-mode-map) | |
60 (setq major-mode 'awk-mode) | |
61 (setq mode-name "AWK") | |
62 (setq local-abbrev-table awk-mode-abbrev-table) | |
63 (set-syntax-table awk-mode-syntax-table) | |
64 (make-local-variable 'paragraph-start) | |
65 (setq paragraph-start (concat "^$\\|" page-delimiter)) | |
66 (make-local-variable 'paragraph-separate) | |
67 (setq paragraph-separate paragraph-start) | |
68 (make-local-variable 'paragraph-ignore-fill-prefix) | |
69 (setq paragraph-ignore-fill-prefix t) | |
70 (make-local-variable 'indent-line-function) | |
71 (setq indent-line-function 'awk-indent-line) | |
72 (make-local-variable 'require-final-newline) | |
73 (setq require-final-newline t) | |
74 (make-local-variable 'comment-start) | |
75 (setq comment-start "# ") | |
76 (make-local-variable 'comment-end) | |
77 (setq comment-end "") | |
78 (make-local-variable 'comment-column) | |
79 (setq comment-column 32) | |
80 (make-local-variable 'comment-start-skip) | |
81 (setq comment-start-skip "#+ *") | |
82 (make-local-variable 'comment-indent-hook) | |
83 (setq comment-indent-hook 'c-comment-indent) | |
84 (run-hooks 'awk-mode-hook)) | |
662
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
257
diff
changeset
|
85 |
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
257
diff
changeset
|
86 ;;; awk-mode.el ends here |