annotate lisp/modes/rexx-mode.el @ 187:b405438285a2 r20-3b20

Import from CVS: tag r20-3b20
author cvs
date Mon, 13 Aug 2007 09:56:28 +0200
parents 34a5b81f86ba
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; rexx-mode.el --- major mode for editing REXX program files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;; Keywords: languages
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; Copyright (C) 1993 by Anders Lindgren.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; You should have received a copy of the GNU General Public License
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
19 ;; along with XEmacs; see the file COPYING. If not, write to the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
20 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 0
diff changeset
21 ;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;;; Synched up with: Not in FSF.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;; AUTHOR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;; Anders Lindgren, d91ali@csd.uu.se
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;;
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
28 ;;; Abbreviation table due to:
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;; Johan Bergkvist, nv91-jbe@nada.kth.se
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;;; USAGE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;;; This file contains code for a GNU Emacs major mode for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;;; editing REXX program files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;;; Type C-h m in Emacs for information on how to configurate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;;; the rexx-mode, or see rexx-mode.doc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;;; Put the following lines into your .emacs and rexx-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;;; will be automatically loaded when editing a REXX program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;;; If rexx-mode shall be used for files with other extensions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ;;; you can create more (cons ...) lines with these extensions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;;; (autoload 'rexx-mode "rexx-mode" "REXX mode" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;;; (setq auto-mode-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;;; (append
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ;;; (list (cons "\\.rexx$" 'rexx-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ;;; (cons "\\.elx$" 'rexx-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ;;; (cons "\\.ncomm$" 'rexx-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ;;; (cons "\\.cpr$" 'rexx-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ;;; )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ;;; auto-mode-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ;;; HISTORY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ;;; 93-01-07 V0.1 ALi Works for the first time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ;;; 92-01-11 V0.2 ALi rexx-calc-indent totally rewritten.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ;;; 93-03-08 V0.3 JB rexx-indent-and-newline-and-indent added.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ;;; Abbrev-table containing 173 entries created.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 ;;; rexx-check-expansion added.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ;;; rexx-mode enables use of abbrev-table.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 ;;; 93-03-15 V0.4 ALi abbrev-mode removed, better to call
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ;;; (abbrev-mode 1) from the hook.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ;;; case-fold-search set to t to recognize capital
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ;;; letters in keywords.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ;;; Old (setq case-fold-search nil) removed which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 ;;; prevented the recognition of END.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ;;; rexx-indent-and-newline-and-indent renamed to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 ;;; rexx-indent-newline-indent.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ;;; rexx-i-n-i now only expands abbrevs when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ;;; buffer is in abbrev-mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ;;; New rexx-newline-and-indent added.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ;;; 93-03-20 ALi A serious bug in the routine for checking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ;;; strings and comments found and fixed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ;;; V1.0 Relesed!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (provide 'rexx-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
134
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
79 (defgroup rexx nil
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
80 "Major mode for editing REXX program files"
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
81 :group 'languages)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
82
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
134
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
84 (defcustom rexx-indent 8
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
85 "*This variable contains the indentation in rexx-mode."
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
86 :type 'integer
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
87 :group 'rexx)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
134
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
89 (defcustom rexx-end-indent 0
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
90 "*This variable indicates the relative position of the \"end\" in REXX mode."
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
91 :type 'integer
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
92 :group 'rexx)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93
134
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
94 (defcustom rexx-cont-indent 8
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
95 "*This variable indicates how far a continued line shall be intended."
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
96 :type 'integer
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
97 :group 'rexx)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
134
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
99 (defcustom rexx-comment-col 32
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
100 "*This variable gives the desired comment column
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
101 for comments to the right of text."
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
102 :type 'integer
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
103 :group 'rexx)
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
104
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
105 (defcustom rexx-tab-always-indent t
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 "*Non-nil means TAB in REXX mode should always reindent the current line,
134
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
107 regardless of where in the line point is when the TAB command is used."
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
108 :type 'boolean
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
109 :group 'rexx)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
134
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
111 (defcustom rexx-special-regexp
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 ".*\\(,\\|then\\|else\\)[ \t]*\\(/\\*.*\\*/\\)?[ \t]*$"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 "*Regular expression for parsing lines which shall be followed by
134
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
114 a extra indention"
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
115 :type 'regexp
34a5b81f86ba Import from CVS: tag r20-2b1
cvs
parents: 108
diff changeset
116 :group 'rexx)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (defconst rexx-font-lock-keywords
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (purecopy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (cons (concat "\\<\\("
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (mapconcat 'identity
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 '("address" "arg" "break" "call" "do" "drop" "echo" "else" "end"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 "exit" "if" "interpret" "iterate" "leave" "nop" "numeric"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 "options" "otherwise" "parse" "procedure" "pull" "push" "queue"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 "return" "say" "select" "shell" "signal" "then" "trace" "upper"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 "when" "value" "to" "by" "for" "forever" "while" "until" "form"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 "digits" "fuzz" "scientific" "engineering" "failat" "prompt"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 "results" "upper" "external" "source" "with" "command"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 "function" "var" "version" "expose" "on" "off")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 "\\|") "\\)\\>") 'font-lock-keyword-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 '("\\(\\sw+\\):" 1 font-lock-function-name-face)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 "Additional expressions to highlight in Rexx mode.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (put 'rexx-mode 'font-lock-defaults '(rexx-font-lock-keywords))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (defvar rexx-mode-map nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 "Keymap for rexx-mode.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (if rexx-mode-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (setq rexx-mode-map (make-sparse-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (define-key rexx-mode-map "\t" 'rexx-indent-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (define-key rexx-mode-map "\C-m" 'rexx-indent-and-newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (define-key rexx-mode-map 'backspace 'backward-delete-char-untabify)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (define-key rexx-mode-map "\C-c\C-p" 'rexx-find-matching-do)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (define-key rexx-mode-map "\C-c\C-c" 'rexx-debug)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (defvar rexx-mode-syntax-table nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 "Syntax table in use in REXX-mode buffers.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (if rexx-mode-syntax-table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (setq rexx-mode-syntax-table (make-syntax-table))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (modify-syntax-entry ?\\ "\\" rexx-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (modify-syntax-entry ?/ ". 14" rexx-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (modify-syntax-entry ?* ". 23" rexx-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (modify-syntax-entry ?+ "." rexx-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (modify-syntax-entry ?- "." rexx-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 (modify-syntax-entry ?= "." rexx-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (modify-syntax-entry ?% "." rexx-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (modify-syntax-entry ?< "." rexx-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (modify-syntax-entry ?> "." rexx-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (modify-syntax-entry ?& "." rexx-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (modify-syntax-entry ?| "." rexx-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (modify-syntax-entry ?. "_" rexx-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (modify-syntax-entry ?\' "\"" rexx-mode-syntax-table))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (defvar rexx-mode-abbrev-table nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 "*Abbrev table in use in rexx-mode buffers.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (if rexx-mode-abbrev-table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (define-abbrev-table 'rexx-mode-abbrev-table '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 ("address" "ADDRESS" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 ("arg" "ARG" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 ("break" "BREAK" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 ("call" "CALL" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 ("do" "DO" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 ("drop" "DROP" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 ("echo" "ECHO" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 ("else" "ELSE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 ("end" "END" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 ("exit" "EXIT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 ("if" "IF" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 ("interpret" "INTERPRET" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 ("iterate" "ITERATE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 ("leave" "LEAVE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 ("nop" "NOP" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ("numeric" "NUMERIC" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 ("options" "OPTIONS" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 ("otherwise" "OTHERWISE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 ("parse" "PARSE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 ("procedure" "PROCEDURE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 ("pull" "PULL" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 ("push" "PUSH" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 ("queue" "QUEUE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 ("return" "RETURN" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 ("say" "SAY" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 ("select" "SELECT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 ("shell" "SHELL" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 ("signal" "SIGNAL" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 ("then" "THEN" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 ("trace" "TRACE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 ("upper" "UPPER" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 ("when" "WHEN" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 ("value" "VALUE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 ("to" "TO" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 ("by" "BY" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 ("for" "FOR" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 ("forever" "FOREVER" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 ("while" "WHILE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 ("until" "UNTIL" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 ("form" "FORM" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 ("digits" "DIGITS" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 ("fuzz" "FUZZ" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 ("scientific" "SCIENTIFIC" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 ("engineering" "ENGINEERING" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 ("failat" "FAILAT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 ("prompt" "PROMPT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 ("results" "RESULTS" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 ("upper" "UPPER" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 ("external" "EXTERNAL" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 ("source" "SOURCE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 ("with" "WITH" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 ("command" "COMMAND" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 ("function" "FUNCTION" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 ("var" "VAR" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 ("version" "VERSION" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 ("expose" "EXPOSE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 ("on" "ON" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 ("off" "OFF" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 ("abbrev" "ABBREV" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 ("abs" "ABS" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 ("addlib" "ADDLIB" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 ("b2c" "B2C" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 ("bitand" "BITAND" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 ("bitchg" "BITCHG" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 ("bitclr" "BITCLR" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 ("bitcomp" "BITCOMP" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 ("bitor" "BITOR" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 ("bittst" "BITTST" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 ("bitset" "BITSET" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 ("c2b" "C2B" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 ("c2d" "C2D" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 ("c2x" "C2X" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 ("center" "CENTER" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 ("centre" "CENTRE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 ("close" "CLOSE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 ("compress" "COMPRESS" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 ("compare" "COMPARE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 ("copies" "COPIES" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 ("d2c" "D2C" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 ("datatype" "DATATYPE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 ("delstr" "DELSTR" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 ("delword" "DELWORD" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 ("eof" "EOF" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 ("errortext" "ERRORTEXT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 ("exists" "EXISTS" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 ("export" "EXPORT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 ("freespace" "FREESPACE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 ("getclip" "GETCLIP" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 ("getspace" "GETSPACE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 ("hash" "HASH" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 ("import" "IMPORT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 ("index" "INDEX" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 ("insert" "INSERT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 ("lastpos" "LASTPOS" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 ("left" "LEFT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 ("length" "LENGTH" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 ("max" "MAX" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 ("min" "MIN" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 ("open" "OPEN" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 ("overlay" "OVERLAY" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 ("pos" "POS" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 ("pragma" "PRAGMA" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 ("random" "RANDOM" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 ("randu" "RANDU" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 ("readch" "READCH" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 ("readln" "READLN" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 ("remlib" "REMLIB" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 ("reverse" "REVERSE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 ("right" "RIGHT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 ("seek" "SEEK" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 ("setclip" "SETCLIP" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 ("show" "SHOW" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 ("sign" "SIGN" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 ("space" "SPACE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 ("storage" "STORAGE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 ("strip" "STRIP" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 ("substr" "SUBSTR" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 ("subword" "SUBWORD" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 ("symbol" "SYMBOL" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 ("time" "TIME" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 ("trace" "TRACE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 ("translate" "TRANSLATE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 ("trim" "TRIM" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 ("verify" "VERIFY" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 ("word" "WORD" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 ("wordindex" "WORDINDEX" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 ("wordlength" "WORDLENGTH" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 ("words" "WORDS" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 ("writech" "WRITECH" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 ("writeln" "WRITELN" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 ("x2c" "X2C" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 ("xrange" "XRANGE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 ("allocmem" "ALLOCMEM" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 ("baddr" "BADDR" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 ("bitxor" "BITXOR" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 ("break_c" "BREAK_C" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 ("break_d" "BREAK_D" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 ("break_e" "BREAK_E" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 ("break_f" "BREAK_F" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 ("cache" "CACHE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 ("closeport" "CLOSEPORT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 ("d2x" "D2X" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 ("date" "DATA" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 ("delay" "DELAY" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 ("delete" "DELETE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 ("error" "ERROR" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 ("failure" "FAILURE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 ("find" "FIND" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 ("forbid" "FORBID" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 ("freemem" "FREEMEM" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 ("getarg" "GETARG" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 ("getpkt" "GETPKT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 ("halt" "HALT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 ("ioerr" "IOERR" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 ("lines" "LINES" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 ("makedir" "MAKEDIR" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 ("next" "NEXT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 ("novalue" "NOVALUE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 ("null" "NULL" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 ("offset" "OFFSET" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 ("openport" "OPENPORT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 ("permit" "PERMIT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 ("rename" "RENAME" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 ("reply" "REPLY" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 ("showdir" "SHOWDIR" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 ("showlist" "SHOWLIST" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 ("sourceline" "SOURCELINE" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 ("statef" "STATEF" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 ("syntax" "SYNTAX" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 ("trunc" "TRUNC" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 ("typepkt" "TYPEPKT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 ("waitpkt" "WAITPKT" rexx-check-expansion 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 ("x2d" "X2D" rexx-check-expansion 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 (defun rexx-mode ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 "Major mode for editing REXX code.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 \\{rexx-mode-map}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 Variables controlling indentation style:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 rexx-indent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 The basic indentation for do-blocks.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 rexx-end-indent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 The relative offset of the \"end\" statement. 0 places it in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 same column as the statements of the block. Setting it to the same
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 value as rexx-indent places the \"end\" under the do-line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 rexx-cont-indent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 The indention for lines following \"then\", \"else\" and \",\"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (continued) lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 rexx-tab-always-indent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 Non-nil means TAB in REXX mode should always reindent the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 line, regardless of where in the line the point is when the TAB
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 command is used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 If you have set rexx-end-indent to a nonzero value, you probably want to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 remap RETURN to rexx-indent-newline-indent. It makes sure that lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 indents correctly when you press RETURN.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
372 An extensive abbreviation table consisting of all the keywords of REXX are
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 supplied. Expanded keywords are converted into upper case making it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 easier to distinguish them. To use this feature the buffer must be in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 abbrev-mode. (See example below.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 Turning on REXX mode calls the value of the variable rexx-mode-hook with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 no args, if that value is non-nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 For example:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (setq rexx-mode-hook '(lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 (setq rexx-indent 4)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 (setq rexx-end-indent 4)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (setq rexx-cont-indent 4)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (local-set-key \"\\C-m\" 'rexx-indent-newline-indent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (abbrev-mode 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 will make the END aligned with the DO/SELECT. It will indent blocks and
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
390 IF-statements four steps and make sure that the END jumps into the
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 70
diff changeset
391 correct position when RETURN is pressed. Finally it will use the abbrev
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 table to convert all REXX keywords into upper case."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (kill-all-local-variables)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 (use-local-map rexx-mode-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (set-syntax-table rexx-mode-syntax-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (setq major-mode 'rexx-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (setq mode-name "REXX")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (setq local-abbrev-table rexx-mode-abbrev-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (make-local-variable 'case-fold-search)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (setq case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (make-local-variable 'paragraph-start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 (setq paragraph-start (concat "^$\\|" page-delimiter))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 (make-local-variable 'paragraph-separate)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (setq paragraph-separate paragraph-start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 (make-local-variable 'paragraph-ignore-fill-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (setq paragraph-ignore-fill-prefix t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 (make-local-variable 'indent-line-function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 (setq indent-line-function 'rexx-indent-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 (make-local-variable 'parse-sexp-ignore-comments)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 (setq parse-sexp-ignore-comments t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (make-local-variable 'comment-start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 (setq comment-start "/* ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 (make-local-variable 'comment-end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 (setq comment-end " */")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (make-local-variable 'comment-column)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 (setq comment-column 32)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (make-local-variable 'comment-start-skip)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 (setq comment-start-skip "/\\*+ *")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (make-local-variable 'comment-indent-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 (setq comment-indent-hook 'rexx-comment-indent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 (run-hooks 'rexx-mode-hook))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (defun rexx-indent-command (&optional whole-exp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 "Indent the current line as REXX code."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 (if whole-exp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 (let ((shift-amt (rexx-indent-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 beg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 (if rexx-tab-always-indent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 (beginning-of-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 (setq beg (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 (forward-sexp 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (setq end (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 (goto-char beg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 (setq beg (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 (if (> end beg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 (indent-code-rigidly beg end shift-amt)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 (if (and (not rexx-tab-always-indent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 (skip-chars-backward " \t")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 (not (bolp))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 (insert-tab)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 (rexx-indent-line))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 (defun rexx-indent-line ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 "Indent the current line as REXX code.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 Return the amount the indentation changed by."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (let ((indent (rexx-calc-indent))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 beg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 shift-amt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 (pos (- (point-max) (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (setq beg (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 (cond ((eq indent nil) (setq indent (current-indentation)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 ((eq indent t) (setq indent (rexx-calculate-indent-within-comment)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 ((looking-at "[ \t]*#") (setq indent 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 (t (skip-chars-forward " \t")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 (if (listp indent) (setq indent (car indent)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 ;; /* Sprekspecifik kod! */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (if (looking-at "end") (setq indent (- indent rexx-end-indent)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 (skip-chars-forward " \t")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (setq shift-amt (- indent (current-column)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 (if (zerop shift-amt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 (if (> (- (point-max) pos) (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 (goto-char (- (point-max) pos)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 (delete-region beg (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 (indent-to indent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 (if (> (- (point-max) pos) (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (goto-char (- (point-max) pos))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 shift-amt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 (defun rexx-calc-indent ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 "Return the appropriate indentation for this line as an int."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 (let ((block (rexx-find-environment))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 beg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 indent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 (save-excursion (setq state (rexx-inside-comment-or-string)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (cond ((or (nth 3 state) (nth 4 state))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 (nth 4 state)) ;; Inside a comment or string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 ;; Find line to indent current line after.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 (rexx-backup-to-noncomment 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 (setq beg (rexx-find-environment))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (while (> beg block)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 (goto-char beg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 (setq beg (rexx-find-environment)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 (if (> (point) block)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 ;; Check to see if we shall make a special indention
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 (if (looking-at rexx-special-regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 (+ (current-indentation) rexx-cont-indent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 ;; If not, find the basic indention by stepping
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 ;; by all special indented lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 (setq indent (current-indentation))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 (rexx-backup-to-noncomment 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 (while (looking-at rexx-special-regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 (setq indent (current-indentation))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 (rexx-backup-to-noncomment 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 (beginning-of-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 indent))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 (if (= 1 block)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 ;; Indent after the do-line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 (goto-char block)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 (+ (current-indentation) rexx-indent)))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 (defun rexx-backup-to-noncomment (lim)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 "Backup the point to the previous noncomment REXX line."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 (let (stop)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 (while (not stop)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 (skip-chars-backward " \t\n\f" lim)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 (if (and (>= (point) (+ 2 lim))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 (forward-char -2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 (looking-at "\\*/")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 (search-backward "/*" lim 'move)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 (setq stop t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 (>= (point) lim)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 (defun rexx-find-environment ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 "Return the position of the corresponding \"do\" or \"select\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 If none found, return the beginning of buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 (let ((do-level 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 (cont t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 state)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 (while (and cont (not (zerop do-level)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 (setq cont (re-search-backward "\\b\\(do\\|select\\|end\\)\\b" 1 t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 (save-excursion (setq state (rexx-inside-comment-or-string)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 (setq do-level (+ do-level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (cond ((or (nth 3 state) (nth 4 state)) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 ((looking-at "do") -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 ((looking-at "select") -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 ((looking-at "end") +1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 (t 0)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 (if cont (point) 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 (defun rexx-calculate-indent-within-comment ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 "Return the indentation amount for line, assuming that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 the current line is to be regarded as part of a block comment."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 (let (end star-start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (skip-chars-forward " \t")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (setq star-start (= (following-char) ?\*))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 (skip-chars-backward " \t\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (setq end (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (skip-chars-forward " \t")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 (and (re-search-forward "/\\*[ \t]*" end t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 star-start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 (goto-char (1+ (match-beginning 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 (current-column))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 (defun rexx-comment-indent ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 (if (looking-at "^/\\*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 0 ;Existing comment at bol stays there.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 (skip-chars-backward " \t")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 (max (1+ (current-column)) ;Else indent at comment column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 comment-column)))) ; except leave at least one space.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 (defun rexx-find-matching-do ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 "Set mark, look for the \"do\" or \"select\" for the present block."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 (set-mark-command nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 (goto-char (rexx-find-environment)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 (defun rexx-check-expansion ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 "If abbrev was made within a comment or a string, de-abbrev!"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 (let ((state (rexx-inside-comment-or-string)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 (if (or (nth 3 state) (nth 4 state))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 (unexpand-abbrev))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 (defun rexx-inside-comment-or-string ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 "Check if the point is inside a comment or a string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 It returns the state from parse-partial-sexp for the search that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 terminated on the points position"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 (let ((origpoint (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 state)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 (goto-char 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 (while (> origpoint (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 (setq state (parse-partial-sexp (point) origpoint 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 state))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 (defun rexx-indent-and-newline ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 "New newline-and-indent which expands abbrevs before running
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 a regular newline-and-indent."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 (if abbrev-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 (expand-abbrev))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 (newline-and-indent))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 (defun rexx-indent-newline-indent ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 "New newline-and-indent which expands abbrevs and indent the line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 before running a regular newline-and-indent."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 (rexx-indent-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 (if abbrev-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 (expand-abbrev))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 (newline-and-indent))