annotate lisp/modes/rexx-mode.el @ 0:376386a54a3c r19-14

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