(scheme-mode-syntax-table): Move the nesting bit from # to |.
[bpt/emacs.git] / lisp / progmodes / scheme.el
1 ;;; scheme.el --- Scheme (and DSSSL) editing mode
2
3 ;; Copyright (C) 1986, 1987, 1988, 1997, 1998, 2001, 2002, 2003, 2004, 2005
4 ;; Free Software Foundation, Inc.
5
6 ;; Author: Bill Rozas <jinx@martigny.ai.mit.edu>
7 ;; Adapted-by: Dave Love <d.love@dl.ac.uk>
8 ;; Keywords: languages, lisp
9
10 ;; This file is part of GNU Emacs.
11
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; any later version.
16
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
21
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 ;; Boston, MA 02110-1301, USA.
26
27 ;;; Commentary:
28
29 ;; The major mode for editing Scheme-type Lisp code, very similar to
30 ;; the Lisp mode documented in the Emacs manual. `dsssl-mode' is a
31 ;; variant of scheme-mode for editing DSSSL specifications for SGML
32 ;; documents. [As of Apr 1997, some pointers for DSSSL may be found,
33 ;; for instance, at <URL:http://www.sil.org/sgml/related.html#dsssl>.]
34 ;; All these Lisp-ish modes vary basically in details of the language
35 ;; syntax they highlight/indent/index, but dsssl-mode uses "^;;;" as
36 ;; the page-delimiter since ^L isn't normally a legal SGML character.
37 ;;
38 ;; For interacting with a Scheme interpreter See also `run-scheme' in
39 ;; the `cmuscheme' package and also the implementation-specific
40 ;; `xscheme' package.
41
42 ;; Here's a recipe to generate a TAGS file for DSSSL, by the way:
43 ;; etags --lang=scheme --regex='/[ \t]*(\(mode\|element\)[ \t
44 ;; ]+\([^ \t(
45 ;; ]+\)/\2/' --regex='/[ \t]*(element[ \t
46 ;; ]*([^)]+[ \t
47 ;; ]+\([^)]+\)[ \t
48 ;; ]*)/\1/' --regex='/(declare[^ \t
49 ;; ]*[ \t
50 ;; ]+\([^ \t
51 ;; ]+\)/\1/' "$@"
52
53 ;;; Code:
54 \f
55 (require 'lisp-mode)
56
57 (defvar scheme-mode-syntax-table
58 (let ((st (make-syntax-table))
59 (i 0))
60
61 ;; Default is atom-constituent.
62 (while (< i 256)
63 (modify-syntax-entry i "_ " st)
64 (setq i (1+ i)))
65
66 ;; Word components.
67 (setq i ?0)
68 (while (<= i ?9)
69 (modify-syntax-entry i "w " st)
70 (setq i (1+ i)))
71 (setq i ?A)
72 (while (<= i ?Z)
73 (modify-syntax-entry i "w " st)
74 (setq i (1+ i)))
75 (setq i ?a)
76 (while (<= i ?z)
77 (modify-syntax-entry i "w " st)
78 (setq i (1+ i)))
79
80 ;; Whitespace
81 (modify-syntax-entry ?\t " " st)
82 (modify-syntax-entry ?\n "> " st)
83 (modify-syntax-entry ?\f " " st)
84 (modify-syntax-entry ?\r " " st)
85 (modify-syntax-entry ?\s " " st)
86
87 ;; These characters are delimiters but otherwise undefined.
88 ;; Brackets and braces balance for editing convenience.
89 (modify-syntax-entry ?\[ "(] " st)
90 (modify-syntax-entry ?\] ")[ " st)
91 (modify-syntax-entry ?{ "(} " st)
92 (modify-syntax-entry ?} "){ " st)
93 (modify-syntax-entry ?\| "\" 23bn" st)
94 ;; Guile allows #! ... !# comments.
95 ;; But SRFI-22 defines the comment as #!...\n instead.
96 ;; Also Guile says that the !# should be on a line of its own.
97 ;; It's too difficult to get it right, for too little benefit.
98 ;; (modify-syntax-entry ?! "_ 2" st)
99
100 ;; Other atom delimiters
101 (modify-syntax-entry ?\( "() " st)
102 (modify-syntax-entry ?\) ")( " st)
103 (modify-syntax-entry ?\; "< " st)
104 (modify-syntax-entry ?\" "\" " st)
105 (modify-syntax-entry ?' "' " st)
106 (modify-syntax-entry ?` "' " st)
107
108 ;; Special characters
109 (modify-syntax-entry ?, "' " st)
110 (modify-syntax-entry ?@ "' " st)
111 (modify-syntax-entry ?# "' 14b" st)
112 (modify-syntax-entry ?\\ "\\ " st)
113 st))
114 \f
115 (defvar scheme-mode-abbrev-table nil)
116 (define-abbrev-table 'scheme-mode-abbrev-table ())
117
118 (defvar scheme-imenu-generic-expression
119 '((nil
120 "^(define\\(\\|-\\(generic\\(\\|-procedure\\)\\|method\\)\\)*\\s-+(?\\(\\sw+\\)" 4)
121 ("Types"
122 "^(define-class\\s-+(?\\(\\sw+\\)" 1)
123 ("Macros"
124 "^(\\(defmacro\\|define-macro\\|define-syntax\\)\\s-+(?\\(\\sw+\\)" 2))
125 "Imenu generic expression for Scheme mode. See `imenu-generic-expression'.")
126
127 (defun scheme-mode-variables ()
128 (set-syntax-table scheme-mode-syntax-table)
129 (setq local-abbrev-table scheme-mode-abbrev-table)
130 (make-local-variable 'paragraph-start)
131 (setq paragraph-start (concat "$\\|" page-delimiter))
132 (make-local-variable 'paragraph-separate)
133 (setq paragraph-separate paragraph-start)
134 (make-local-variable 'paragraph-ignore-fill-prefix)
135 (setq paragraph-ignore-fill-prefix t)
136 (make-local-variable 'fill-paragraph-function)
137 (setq fill-paragraph-function 'lisp-fill-paragraph)
138 ;; Adaptive fill mode gets in the way of auto-fill,
139 ;; and should make no difference for explicit fill
140 ;; because lisp-fill-paragraph should do the job.
141 (make-local-variable 'adaptive-fill-mode)
142 (setq adaptive-fill-mode nil)
143 (make-local-variable 'normal-auto-fill-function)
144 (setq normal-auto-fill-function 'lisp-mode-auto-fill)
145 (make-local-variable 'indent-line-function)
146 (setq indent-line-function 'lisp-indent-line)
147 (make-local-variable 'parse-sexp-ignore-comments)
148 (setq parse-sexp-ignore-comments t)
149 (make-local-variable 'outline-regexp)
150 (setq outline-regexp ";;; \\|(....")
151 (make-local-variable 'comment-start)
152 (setq comment-start ";")
153 (set (make-local-variable 'comment-add) 1)
154 (make-local-variable 'comment-start-skip)
155 ;; Look within the line for a ; following an even number of backslashes
156 ;; after either a non-backslash or the line beginning.
157 (setq comment-start-skip "\\(\\(^\\|[^\\\\\n]\\)\\(\\\\\\\\\\)*\\);+[ \t]*")
158 (make-local-variable 'comment-column)
159 (setq comment-column 40)
160 (make-local-variable 'comment-indent-function)
161 (setq comment-indent-function 'lisp-comment-indent)
162 (make-local-variable 'parse-sexp-ignore-comments)
163 (setq parse-sexp-ignore-comments t)
164 (make-local-variable 'lisp-indent-function)
165 (setq lisp-indent-function 'scheme-indent-function)
166 (setq mode-line-process '("" scheme-mode-line-process))
167 (set (make-local-variable 'imenu-case-fold-search) t)
168 (setq imenu-generic-expression scheme-imenu-generic-expression)
169 (set (make-local-variable 'imenu-syntax-alist)
170 '(("+-*/.<>=?!$%_&~^:" . "w")))
171 (make-local-variable 'font-lock-defaults)
172 (setq font-lock-defaults
173 '((scheme-font-lock-keywords
174 scheme-font-lock-keywords-1 scheme-font-lock-keywords-2)
175 nil t (("+-*/.<>=!?$%_&~^:" . "w") (?#. "w 14"))
176 beginning-of-defun
177 (font-lock-mark-block-function . mark-defun)
178 (font-lock-syntactic-face-function
179 . scheme-font-lock-syntactic-face-function))))
180
181 (defvar scheme-mode-line-process "")
182
183 (defvar scheme-mode-map
184 (let ((smap (make-sparse-keymap))
185 (map (make-sparse-keymap "Scheme")))
186 (set-keymap-parent smap lisp-mode-shared-map)
187 (define-key smap [menu-bar scheme] (cons "Scheme" map))
188 (define-key map [run-scheme] '("Run Inferior Scheme" . run-scheme))
189 (define-key map [uncomment-region]
190 '("Uncomment Out Region" . (lambda (beg end)
191 (interactive "r")
192 (comment-region beg end '(4)))))
193 (define-key map [comment-region] '("Comment Out Region" . comment-region))
194 (define-key map [indent-region] '("Indent Region" . indent-region))
195 (define-key map [indent-line] '("Indent Line" . lisp-indent-line))
196 (put 'comment-region 'menu-enable 'mark-active)
197 (put 'uncomment-region 'menu-enable 'mark-active)
198 (put 'indent-region 'menu-enable 'mark-active)
199 smap)
200 "Keymap for Scheme mode.
201 All commands in `lisp-mode-shared-map' are inherited by this map.")
202
203 ;; Used by cmuscheme
204 (defun scheme-mode-commands (map)
205 ;;(define-key map "\t" 'indent-for-tab-command) ; default
206 (define-key map "\177" 'backward-delete-char-untabify)
207 (define-key map "\e\C-q" 'indent-sexp))
208 \f
209 ;;;###autoload
210 (defun scheme-mode ()
211 "Major mode for editing Scheme code.
212 Editing commands are similar to those of `lisp-mode'.
213
214 In addition, if an inferior Scheme process is running, some additional
215 commands will be defined, for evaluating expressions and controlling
216 the interpreter, and the state of the process will be displayed in the
217 modeline of all Scheme buffers. The names of commands that interact
218 with the Scheme process start with \"xscheme-\" if you use the MIT
219 Scheme-specific `xscheme' package; for more information see the
220 documentation for `xscheme-interaction-mode'. Use \\[run-scheme] to
221 start an inferior Scheme using the more general `cmuscheme' package.
222
223 Commands:
224 Delete converts tabs to spaces as it moves back.
225 Blank lines separate paragraphs. Semicolons start comments.
226 \\{scheme-mode-map}
227 Entry to this mode calls the value of `scheme-mode-hook'
228 if that value is non-nil."
229 (interactive)
230 (kill-all-local-variables)
231 (use-local-map scheme-mode-map)
232 (setq major-mode 'scheme-mode)
233 (setq mode-name "Scheme")
234 (scheme-mode-variables)
235 (run-mode-hooks 'scheme-mode-hook))
236
237 (defgroup scheme nil
238 "Editing Scheme code."
239 :group 'lisp)
240
241 (defcustom scheme-mit-dialect t
242 "If non-nil, scheme mode is specialized for MIT Scheme.
243 Set this to nil if you normally use another dialect."
244 :type 'boolean
245 :group 'scheme)
246
247 (defcustom dsssl-sgml-declaration
248 "<!DOCTYPE style-sheet PUBLIC \"-//James Clark//DTD DSSSL Style Sheet//EN\">
249 "
250 "*An SGML declaration for the DSSSL file.
251 If it is defined as a string this will be inserted into an empty buffer
252 which is in `dsssl-mode'. It is typically James Clark's style-sheet
253 doctype, as required for Jade."
254 :type '(choice (string :tag "Specified string")
255 (const :tag "None" :value nil))
256 :group 'scheme)
257
258 (defcustom scheme-mode-hook nil
259 "Normal hook run when entering `scheme-mode'.
260 See `run-hooks'."
261 :type 'hook
262 :group 'scheme)
263
264 (defcustom dsssl-mode-hook nil
265 "Normal hook run when entering `dsssl-mode'.
266 See `run-hooks'."
267 :type 'hook
268 :group 'scheme)
269
270 ;; This is shared by cmuscheme and xscheme.
271 (defcustom scheme-program-name "scheme"
272 "*Program invoked by the `run-scheme' command."
273 :type 'string
274 :group 'scheme)
275
276 (defvar dsssl-imenu-generic-expression
277 ;; Perhaps this should also look for the style-sheet DTD tags. I'm
278 ;; not sure it's the best way to organize it; perhaps one type
279 ;; should be at the first level, though you don't see this anyhow if
280 ;; it gets split up.
281 '(("Defines"
282 "^(define\\s-+(?\\(\\sw+\\)" 1)
283 ("Modes"
284 "^\\s-*(mode\\s-+\\(\\(\\sw\\|\\s-\\)+\\)" 1)
285 ("Elements"
286 ;; (element foo ...) or (element (foo bar ...) ...)
287 ;; Fixme: Perhaps it should do `root'.
288 "^\\s-*(element\\s-+(?\\(\\(\\sw\\|\\s-\\)+\\))?" 1)
289 ("Declarations"
290 "^(declare\\(-\\sw+\\)+\\>\\s-+\\(\\sw+\\)" 2))
291 "Imenu generic expression for DSSSL mode. See `imenu-generic-expression'.")
292
293 (defconst scheme-font-lock-keywords-1
294 (eval-when-compile
295 (list
296 ;;
297 ;; Declarations. Hannes Haug <hannes.haug@student.uni-tuebingen.de> says
298 ;; this works for SOS, STklos, SCOOPS, Meroon and Tiny CLOS.
299 (list (concat "(\\(define\\*?\\("
300 ;; Function names.
301 "\\(\\|-public\\|-method\\|-generic\\(-procedure\\)?\\)\\|"
302 ;; Macro names, as variable names. A bit dubious, this.
303 "\\(-syntax\\|-macro\\)\\|"
304 ;; Class names.
305 "-class"
306 ;; Guile modules.
307 "\\|-module"
308 "\\)\\)\\>"
309 ;; Any whitespace and declared object.
310 "[ \t]*(?"
311 "\\(\\sw+\\)?")
312 '(1 font-lock-keyword-face)
313 '(6 (cond ((match-beginning 3) font-lock-function-name-face)
314 ((match-beginning 5) font-lock-variable-name-face)
315 (t font-lock-type-face))
316 nil t))
317 ))
318 "Subdued expressions to highlight in Scheme modes.")
319
320 (defconst scheme-font-lock-keywords-2
321 (append scheme-font-lock-keywords-1
322 (eval-when-compile
323 (list
324 ;;
325 ;; Control structures.
326 (cons
327 (concat
328 "(" (regexp-opt
329 '("begin" "call-with-current-continuation" "call/cc"
330 "call-with-input-file" "call-with-output-file" "case" "cond"
331 "do" "else" "for-each" "if" "lambda"
332 "let" "let*" "let-syntax" "letrec" "letrec-syntax"
333 ;; Hannes Haug <hannes.haug@student.uni-tuebingen.de> wants:
334 "and" "or" "delay" "force"
335 ;; Stefan Monnier <stefan.monnier@epfl.ch> says don't bother:
336 ;;"quasiquote" "quote" "unquote" "unquote-splicing"
337 "map" "syntax" "syntax-rules") t)
338 "\\>") 1)
339 ;;
340 ;; It wouldn't be Scheme w/o named-let.
341 '("(let\\s-+\\(\\sw+\\)"
342 (1 font-lock-function-name-face))
343 ;;
344 ;; David Fox <fox@graphics.cs.nyu.edu> for SOS/STklos class specifiers.
345 '("\\<<\\sw+>\\>" . font-lock-type-face)
346 ;;
347 ;; Scheme `:' and `#:' keywords as builtins.
348 '("\\<#?:\\sw+\\>" . font-lock-builtin-face)
349 )))
350 "Gaudy expressions to highlight in Scheme modes.")
351
352 (defvar scheme-font-lock-keywords scheme-font-lock-keywords-1
353 "Default expressions to highlight in Scheme modes.")
354
355 (defun scheme-font-lock-syntactic-face-function (state)
356 (if (nth 3 state)
357 ;; In a string.
358 (if (eq (char-after (nth 8 state)) ?|)
359 ;; This is not a string, but a |...| symbol.
360 nil
361 font-lock-string-face)
362 ;; In a comment.
363 font-lock-comment-face))
364
365 ;;;###autoload
366 (define-derived-mode dsssl-mode scheme-mode "DSSSL"
367 "Major mode for editing DSSSL code.
368 Editing commands are similar to those of `lisp-mode'.
369
370 Commands:
371 Delete converts tabs to spaces as it moves back.
372 Blank lines separate paragraphs. Semicolons start comments.
373 \\{scheme-mode-map}
374 Entering this mode runs the hooks `scheme-mode-hook' and then
375 `dsssl-mode-hook' and inserts the value of `dsssl-sgml-declaration' if
376 that variable's value is a string."
377 (make-local-variable 'page-delimiter)
378 (setq page-delimiter "^;;;" ; ^L not valid SGML char
379 major-mode 'dsssl-mode
380 mode-name "DSSSL")
381 ;; Insert a suitable SGML declaration into an empty buffer.
382 ;; FIXME: This should use `auto-insert-alist' instead.
383 (and (zerop (buffer-size))
384 (stringp dsssl-sgml-declaration)
385 (not buffer-read-only)
386 (insert dsssl-sgml-declaration))
387 (setq font-lock-defaults '(dsssl-font-lock-keywords
388 nil t (("+-*/.<>=?$%_&~^:" . "w"))
389 beginning-of-defun
390 (font-lock-mark-block-function . mark-defun)))
391 (set (make-local-variable 'imenu-case-fold-search) nil)
392 (setq imenu-generic-expression dsssl-imenu-generic-expression)
393 (set (make-local-variable 'imenu-syntax-alist)
394 '(("+-*/.<>=?$%_&~^:" . "w"))))
395
396 ;; Extra syntax for DSSSL. This isn't separated from Scheme, but
397 ;; shouldn't cause much trouble in scheme-mode.
398 (put 'element 'scheme-indent-function 1)
399 (put 'mode 'scheme-indent-function 1)
400 (put 'with-mode 'scheme-indent-function 1)
401 (put 'make 'scheme-indent-function 1)
402 (put 'style 'scheme-indent-function 1)
403 (put 'root 'scheme-indent-function 1)
404
405 (defvar dsssl-font-lock-keywords
406 (eval-when-compile
407 (list
408 ;; Similar to Scheme
409 (list "(\\(define\\(-\\w+\\)?\\)\\>[ ]*\\\((?\\)\\(\\sw+\\)\\>"
410 '(1 font-lock-keyword-face)
411 '(4 font-lock-function-name-face))
412 (cons
413 (concat "(\\("
414 ;; (make-regexp '("case" "cond" "else" "if" "lambda"
415 ;; "let" "let*" "letrec" "and" "or" "map" "with-mode"))
416 "and\\|c\\(ase\\|ond\\)\\|else\\|if\\|"
417 "l\\(ambda\\|et\\(\\|*\\|rec\\)\\)\\|map\\|or\\|with-mode"
418 "\\)\\>")
419 1)
420 ;; DSSSL syntax
421 '("(\\(element\\|mode\\|declare-\\w+\\)\\>[ ]*\\(\\sw+\\)"
422 (1 font-lock-keyword-face)
423 (2 font-lock-type-face))
424 '("(\\(element\\)\\>[ ]*(\\(\\S)+\\))"
425 (1 font-lock-keyword-face)
426 (2 font-lock-type-face))
427 '("\\<\\sw+:\\>" . font-lock-constant-face) ; trailing `:' c.f. scheme
428 ;; SGML markup (from sgml-mode) :
429 '("<\\([!?][-a-z0-9]+\\)" 1 font-lock-keyword-face)
430 '("<\\(/?[-a-z0-9]+\\)" 1 font-lock-function-name-face)))
431 "Default expressions to highlight in DSSSL mode.")
432
433 \f
434 (defvar calculate-lisp-indent-last-sexp)
435
436 ;; Copied from lisp-indent-function, but with gets of
437 ;; scheme-indent-{function,hook}.
438 (defun scheme-indent-function (indent-point state)
439 (let ((normal-indent (current-column)))
440 (goto-char (1+ (elt state 1)))
441 (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)
442 (if (and (elt state 2)
443 (not (looking-at "\\sw\\|\\s_")))
444 ;; car of form doesn't seem to be a symbol
445 (progn
446 (if (not (> (save-excursion (forward-line 1) (point))
447 calculate-lisp-indent-last-sexp))
448 (progn (goto-char calculate-lisp-indent-last-sexp)
449 (beginning-of-line)
450 (parse-partial-sexp (point)
451 calculate-lisp-indent-last-sexp 0 t)))
452 ;; Indent under the list or under the first sexp on the same
453 ;; line as calculate-lisp-indent-last-sexp. Note that first
454 ;; thing on that line has to be complete sexp since we are
455 ;; inside the innermost containing sexp.
456 (backward-prefix-chars)
457 (current-column))
458 (let ((function (buffer-substring (point)
459 (progn (forward-sexp 1) (point))))
460 method)
461 (setq method (or (get (intern-soft function) 'scheme-indent-function)
462 (get (intern-soft function) 'scheme-indent-hook)))
463 (cond ((or (eq method 'defun)
464 (and (null method)
465 (> (length function) 3)
466 (string-match "\\`def" function)))
467 (lisp-indent-defform state indent-point))
468 ((integerp method)
469 (lisp-indent-specform method state
470 indent-point normal-indent))
471 (method
472 (funcall method state indent-point normal-indent)))))))
473
474 \f
475 ;;; Let is different in Scheme
476
477 (defun would-be-symbol (string)
478 (not (string-equal (substring string 0 1) "(")))
479
480 (defun next-sexp-as-string ()
481 ;; Assumes that it is protected by a save-excursion
482 (forward-sexp 1)
483 (let ((the-end (point)))
484 (backward-sexp 1)
485 (buffer-substring (point) the-end)))
486
487 ;; This is correct but too slow.
488 ;; The one below works almost always.
489 ;;(defun scheme-let-indent (state indent-point)
490 ;; (if (would-be-symbol (next-sexp-as-string))
491 ;; (scheme-indent-specform 2 state indent-point)
492 ;; (scheme-indent-specform 1 state indent-point)))
493
494 (defun scheme-let-indent (state indent-point normal-indent)
495 (skip-chars-forward " \t")
496 (if (looking-at "[-a-zA-Z0-9+*/?!@$%^&_:~]")
497 (lisp-indent-specform 2 state indent-point normal-indent)
498 (lisp-indent-specform 1 state indent-point normal-indent)))
499
500 ;; (put 'begin 'scheme-indent-function 0), say, causes begin to be indented
501 ;; like defun if the first form is placed on the next line, otherwise
502 ;; it is indented like any other form (i.e. forms line up under first).
503
504 (put 'begin 'scheme-indent-function 0)
505 (put 'case 'scheme-indent-function 1)
506 (put 'delay 'scheme-indent-function 0)
507 (put 'do 'scheme-indent-function 2)
508 (put 'lambda 'scheme-indent-function 1)
509 (put 'let 'scheme-indent-function 'scheme-let-indent)
510 (put 'let* 'scheme-indent-function 1)
511 (put 'letrec 'scheme-indent-function 1)
512 (put 'sequence 'scheme-indent-function 0) ; SICP, not r4rs
513 (put 'let-syntax 'scheme-indent-function 1)
514 (put 'letrec-syntax 'scheme-indent-function 1)
515 (put 'syntax-rules 'scheme-indent-function 1)
516 (put 'syntax-case 'scheme-indent-function 2) ; not r5rs
517
518 (put 'call-with-input-file 'scheme-indent-function 1)
519 (put 'with-input-from-file 'scheme-indent-function 1)
520 (put 'with-input-from-port 'scheme-indent-function 1)
521 (put 'call-with-output-file 'scheme-indent-function 1)
522 (put 'with-output-to-file 'scheme-indent-function 1)
523 (put 'with-output-to-port 'scheme-indent-function 1)
524 (put 'call-with-values 'scheme-indent-function 1) ; r5rs?
525 (put 'dynamic-wind 'scheme-indent-function 3) ; r5rs?
526 \f
527 ;;;; MIT Scheme specific indentation.
528
529 (if scheme-mit-dialect
530 (progn
531 (put 'fluid-let 'scheme-indent-function 1)
532 (put 'in-package 'scheme-indent-function 1)
533 (put 'local-declare 'scheme-indent-function 1)
534 (put 'macro 'scheme-indent-function 1)
535 (put 'make-environment 'scheme-indent-function 0)
536 (put 'named-lambda 'scheme-indent-function 1)
537 (put 'using-syntax 'scheme-indent-function 1)
538
539 (put 'with-input-from-string 'scheme-indent-function 1)
540 (put 'with-output-to-string 'scheme-indent-function 0)
541 (put 'with-values 'scheme-indent-function 1)
542
543 (put 'syntax-table-define 'scheme-indent-function 2)
544 (put 'list-transform-positive 'scheme-indent-function 1)
545 (put 'list-transform-negative 'scheme-indent-function 1)
546 (put 'list-search-positive 'scheme-indent-function 1)
547 (put 'list-search-negative 'scheme-indent-function 1)
548
549 (put 'access-components 'scheme-indent-function 1)
550 (put 'assignment-components 'scheme-indent-function 1)
551 (put 'combination-components 'scheme-indent-function 1)
552 (put 'comment-components 'scheme-indent-function 1)
553 (put 'conditional-components 'scheme-indent-function 1)
554 (put 'disjunction-components 'scheme-indent-function 1)
555 (put 'declaration-components 'scheme-indent-function 1)
556 (put 'definition-components 'scheme-indent-function 1)
557 (put 'delay-components 'scheme-indent-function 1)
558 (put 'in-package-components 'scheme-indent-function 1)
559 (put 'lambda-components 'scheme-indent-function 1)
560 (put 'lambda-components* 'scheme-indent-function 1)
561 (put 'lambda-components** 'scheme-indent-function 1)
562 (put 'open-block-components 'scheme-indent-function 1)
563 (put 'pathname-components 'scheme-indent-function 1)
564 (put 'procedure-components 'scheme-indent-function 1)
565 (put 'sequence-components 'scheme-indent-function 1)
566 (put 'unassigned\?-components 'scheme-indent-function 1)
567 (put 'unbound\?-components 'scheme-indent-function 1)
568 (put 'variable-components 'scheme-indent-function 1)))
569
570 (provide 'scheme)
571
572 ;; arch-tag: a8f06bc1-ad11-42d2-9e36-ce651df37a90
573 ;;; scheme.el ends here