Mercurial > emacs
annotate lisp/progmodes/awk-mode.el @ 13628:6da84b713ae7
(msdos-color-aliases): Add more aliases.
(msdos-face-setup): Change colors for bold, bold-italic, underline.
(x-frob-font-slant): Define as no-op.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 22 Nov 1995 13:44:42 +0000 |
parents | 0fe6457bc953 |
children | 83f275dcd93a |
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 |
7300 | 3 ;; Copyright (C) 1988, 1994 Free Software Foundation, Inc. |
845 | 4 |
811
e694e0879463
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
662
diff
changeset
|
5 ;; Maintainer: FSF |
2247
2c7997f249eb
Add or correct keywords
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
845
diff
changeset
|
6 ;; Keywords: unix, languages |
811
e694e0879463
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
662
diff
changeset
|
7 |
257 | 8 ;; This file is part of GNU Emacs. |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
811
e694e0879463
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
662
diff
changeset
|
12 ;; the Free Software Foundation; either version 2, or (at your option) |
257 | 13 ;; any later version. |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
21 ;; along with GNU Emacs; see the file COPYING. If not, write to | |
22 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
23 | |
2307
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
24 ;;; Commentary: |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
25 |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
26 ;; Sets up C-mode with support for awk-style #-comments and a lightly |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
27 ;; hacked syntax table. |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
28 |
811
e694e0879463
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
662
diff
changeset
|
29 ;;; Code: |
257 | 30 |
31 (defvar awk-mode-syntax-table nil | |
32 "Syntax table in use in Awk-mode buffers.") | |
33 | |
34 (if awk-mode-syntax-table | |
35 () | |
36 (setq awk-mode-syntax-table (make-syntax-table)) | |
37 (modify-syntax-entry ?\\ "\\" awk-mode-syntax-table) | |
5329
af96725f9e00
(awk-mode-syntax-table): Was mistakenly changing
Richard M. Stallman <rms@gnu.org>
parents:
5266
diff
changeset
|
38 (modify-syntax-entry ?\n "> " awk-mode-syntax-table) |
af96725f9e00
(awk-mode-syntax-table): Was mistakenly changing
Richard M. Stallman <rms@gnu.org>
parents:
5266
diff
changeset
|
39 (modify-syntax-entry ?\f "> " awk-mode-syntax-table) |
af96725f9e00
(awk-mode-syntax-table): Was mistakenly changing
Richard M. Stallman <rms@gnu.org>
parents:
5266
diff
changeset
|
40 (modify-syntax-entry ?\# "< " awk-mode-syntax-table) |
257 | 41 (modify-syntax-entry ?/ "." awk-mode-syntax-table) |
42 (modify-syntax-entry ?* "." awk-mode-syntax-table) | |
43 (modify-syntax-entry ?+ "." awk-mode-syntax-table) | |
44 (modify-syntax-entry ?- "." awk-mode-syntax-table) | |
45 (modify-syntax-entry ?= "." awk-mode-syntax-table) | |
46 (modify-syntax-entry ?% "." awk-mode-syntax-table) | |
47 (modify-syntax-entry ?< "." awk-mode-syntax-table) | |
48 (modify-syntax-entry ?> "." awk-mode-syntax-table) | |
49 (modify-syntax-entry ?& "." awk-mode-syntax-table) | |
50 (modify-syntax-entry ?| "." awk-mode-syntax-table) | |
51 (modify-syntax-entry ?\' "\"" awk-mode-syntax-table)) | |
52 | |
53 (defvar awk-mode-abbrev-table nil | |
54 "Abbrev table in use in Awk-mode buffers.") | |
55 (define-abbrev-table 'awk-mode-abbrev-table ()) | |
56 | |
57 ;;;###autoload | |
58 (defun awk-mode () | |
59 "Major mode for editing AWK code. | |
60 This is much like C mode except for the syntax of comments. It uses | |
61 the same keymap as C mode and has the same variables for customizing | |
62 indentation. It has its own abbrev table and its own syntax table. | |
63 | |
64 Turning on AWK mode calls the value of the variable `awk-mode-hook' | |
65 with no args, if that value is non-nil." | |
66 (interactive) | |
67 (kill-all-local-variables) | |
13471
0fe6457bc953
(awk-mode): Require cc-mode.
Richard M. Stallman <rms@gnu.org>
parents:
10868
diff
changeset
|
68 (require 'cc-mode) |
257 | 69 (use-local-map c-mode-map) |
70 (setq major-mode 'awk-mode) | |
71 (setq mode-name "AWK") | |
72 (setq local-abbrev-table awk-mode-abbrev-table) | |
73 (set-syntax-table awk-mode-syntax-table) | |
74 (make-local-variable 'paragraph-start) | |
10868
276209d90df9
(awk-mode): Remove ^ from paragraph-start & paragraph-separate.
Boris Goldowsky <boris@gnu.org>
parents:
7300
diff
changeset
|
75 (setq paragraph-start (concat "$\\|" page-delimiter)) |
257 | 76 (make-local-variable 'paragraph-separate) |
77 (setq paragraph-separate paragraph-start) | |
78 (make-local-variable 'paragraph-ignore-fill-prefix) | |
79 (setq paragraph-ignore-fill-prefix t) | |
80 (make-local-variable 'indent-line-function) | |
5266
0581b0d428e9
(awk-mode): Use c-indent-line.
Richard M. Stallman <rms@gnu.org>
parents:
2307
diff
changeset
|
81 (setq indent-line-function 'c-indent-line) |
257 | 82 (make-local-variable 'require-final-newline) |
83 (setq require-final-newline t) | |
84 (make-local-variable 'comment-start) | |
85 (setq comment-start "# ") | |
86 (make-local-variable 'comment-end) | |
87 (setq comment-end "") | |
88 (make-local-variable 'comment-column) | |
89 (setq comment-column 32) | |
90 (make-local-variable 'comment-start-skip) | |
91 (setq comment-start-skip "#+ *") | |
2307
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
92 (make-local-variable 'comment-indent-function) |
10e417efb12a
Added or corrected Commentary sections
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
2247
diff
changeset
|
93 (setq comment-indent-function 'c-comment-indent) |
257 | 94 (run-hooks 'awk-mode-hook)) |
662
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
257
diff
changeset
|
95 |
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
257
diff
changeset
|
96 ;;; awk-mode.el ends here |