annotate lisp/modes/rexx-mode.el @ 70:131b0175ea99 r20-0b30

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