(provide (quote scheme)) (defvar scheme-mode-syntax-table nil "\ ") (if (not scheme-mode-syntax-table) (let ((i 0)) (setq scheme-mode-syntax-table (make-syntax-table)) (set-syntax-table scheme-mode-syntax-table) (while (< i 256) (modify-syntax-entry i "_ ") (setq i (1+ i))) (setq i 48) (while (<= i 57) (modify-syntax-entry i "w ") (setq i (1+ i))) (setq i 65) (while (<= i 90) (modify-syntax-entry i "w ") (setq i (1+ i))) (setq i 97) (while (<= i 122) (modify-syntax-entry i "w ") (setq i (1+ i))) (modify-syntax-entry 9 " ") (modify-syntax-entry 10 "> ") (modify-syntax-entry 12 " ") (modify-syntax-entry 13 " ") (modify-syntax-entry 32 " ") (modify-syntax-entry 91 "(] ") (modify-syntax-entry 93 ")[ ") (modify-syntax-entry 123 "(} ") (modify-syntax-entry 125 "){ ") (modify-syntax-entry 124 " ") (modify-syntax-entry 40 "() ") (modify-syntax-entry 41 ")( ") (modify-syntax-entry 59 "< ") (modify-syntax-entry 34 "\" ") (modify-syntax-entry 39 "' ") (modify-syntax-entry 96 "' ") (modify-syntax-entry 44 "' ") (modify-syntax-entry 64 "' ") (m odify-syntax-entry 35 "' ") (modify-syntax-entry 92 "\\ "))) (defvar scheme-mode-abbrev-table nil "\ ") (define-abbrev-table (quote scheme-mode-abbrev-table) nil) (defun scheme-mode-variables nil (byte-code "I!^ %^IA!^D P%^IA!^ %^IA!^?^IE!^?^IE!^? ^IE!^? ^IE!^? ^II!^? ^? (defvar scheme-mode-line-process "") (defun scheme-mode-commands (map) (byte-code "AAA#^AAA#^AAC#+" [map define-key " " scheme-indent-line "" backward-delete-char-untabify "" scheme-indent-sexp] 6)) (defvar scheme-mode-map nil) (if (not scheme-mode-map) (progn (setq scheme-mode-map (make-sparse-keymap)) (scheme-mode-commands scheme-mode-map))) (defun scheme-mode nil "\ Major mode for editing Scheme code. Editing commands are similar to those of lisp-mode. In addition, if an inferior Scheme process is running, some additional commands will be defined, for evaluating expressions and controlling the interpreter, and the state of the process will be displayed in the modeline of all Scheme buffers. The names of commands that interact with the Scheme process start with \"xscheme-\". For more information see the documentation for xscheme-interaction-mode. Commands: Delete converts tabs to spaces as it moves back. Blank lines separate paragraphs. Semicolons start comments. \\{scheme-mode-map} Entry to this mode calls the value of scheme-mode-hook if that value is non-nil." (interactive) (byte-code "?A ^A ^A ^AA!+" [nil kill-all-local-variables scheme-mode-initialize scheme-mode-variables run-hooks scheme-mode-hook] 5)) (defun scheme-mode-initialize nil (byte-code "A!^?^?+" [scheme-mode-map major-mode mode-name use-local-map scheme-mode "Scheme"] 3)) (defvar scheme-mit-dialect t "\ If non-nil, scheme mode is specialized for MIT Scheme. Set this to nil if you normally use another dialect.") (defun scheme-comment-indent (&optional pos) (byte-code "S. (defvar scheme-indent-offset nil "\ ") (defvar scheme-indent-hook (quote scheme-indent-hook) "\ ") (defun scheme-indent-line (&optional whole-exp) "\ Indent current line as Scheme code. With argument, indent any additional lines of the same expression rigidly along with this one." (interactive "P") (byte-code "?C AAAd`ZE ^`%^EE!^EI!f$ `\"^j^d Z`V.R b^ID!^`%^ b^ND!^`%^ V)., #-+" [indent shift-amt beg end pos nil whole-exp calculate-scheme-indent beginning-of-line skip-chars-forward " " looking-at "[ ]*;;;" zerop delete-region forward-sexp 1 forward-line indent-code-rigidly] 13)) (defun calculate-scheme-indent (&optional parse-start) "\ Return appropriate indentation for current line as scheme code. In usual case returns an integer: the column to indent to. Can instead return a list, whose car is the column to indent to. This means that following lines at the same level of indentation should not necessarily be indented the same way. The second element of the list is the buffer position of the start of the containing expression." (byte-code "SI ^`EEEAEEE f\" NV.e (defun scheme-indent-hook (indent-point state) (byte-code "iS A@Tb^AA!^C` A@\".c !%^I !DN%^N !fA GOV.[ OOO*\".b (defvar scheme-body-indent 2 "\ ") (defun scheme-indent-specform (count state indent-point) (byte-code " A@ EEb^i%^ NU+^ (defun scheme-indent-defform (state indent-point) (byte-code "A@b^AA!^`AA@V. (defun would-be-symbol (string) (byte-code "AAAOA\"?+" [string string-equal 0 1 "("] 4)) (defun next-sexp-as-string nil (byte-code "AA!^`AA!^A`\")+" [the-end forward-sexp 1 backward-sexp buffer-substring] 5)) (defun scheme-let-indent (state indent-point) (byte-code "AA!^AA!f (put (quote begin) (quote scheme-indent-hook) 0) (put (quote case) (quote scheme-indent-hook) 1) (put (quote delay) (quote scheme-indent-hook) 0) (put (quote do) (quote scheme-indent-hook) 2) (put (quote lambda) (quote scheme-indent-hook) 1) (put (quote let) (quote scheme-indent-hook) (quote scheme-let-indent)) (put (quote let*) (quote scheme-indent-hook) 1) (put (quote letrec) (quote scheme-indent-hook) 1) (put (quote sequence) (quote scheme-indent-hook) 0) (put (quote call-with-input-file) (quote scheme-indent-hook) 1) (put (quote with-input-from-file) (quote scheme-indent-hook) 1) (put (quote with-input-from-port) (quote scheme-indent-hook) 1) (put (quote call-with-output-file) (quote scheme-indent-hook) 1) (put (quote with-output-to-file) (quote scheme-indent-hook) 1) (put (quote with-output-to-port) (quote scheme-indent-hook) 1) (if scheme-mit-dialect (progn (put (quote fluid-let) (quote scheme-indent-hook) 1) (put (quote in-package) (quote scheme-indent-hook) 1) (put (quote let-syntax) (quote scheme-indent-hook) 1) (put (quote local-declare) (quote scheme-indent-hook) 1) (put (quote macro) (quote scheme-indent-hook) 1) (put (quote make-environment) (quote scheme-indent-hook) 0) (put (quote named-lambda) (quote scheme-indent-hook) 1) (put (quote using-syntax) (quote scheme-indent-hook) 1) (put (quote with-input-from-string) (quote scheme-indent-hook) 1) (put (quote with-output-to-string) (quote scheme-indent-hook) 0) (put (quote with-values) (quote scheme-indent-hook) 1) (put (quote syntax-table-define) (quote scheme-indent-hook) 2) (put (quote list-transform-positive) (quote scheme-indent-hook) 1) (put (quote list-transform-negative) (quote scheme-indent-hook) 1) (put (quote list-search-positive) (quote scheme-indent-hook) 1) (put (quote list-search-negative) (quote scheme-indent-hook) 1) (put (quote access-components) (quote schem e-indent-hook) 1) (put (quote assignment-components) (quote scheme-indent-hook) 1) (put (quote combination-components) (quote scheme-indent-hook) 1) (put (quote comment-components) (quote scheme-indent-hook) 1) (put (quote conditional-components) (quote scheme-indent-hook) 1) (put (quote disjunction-components) (quote scheme-indent-hook) 1) (put (quote declaration-components) (quote scheme-indent-hook) 1) (put (quote definition-components) (quote scheme-indent-hook) 1) (put (quote delay-components) (quote scheme-indent-hook) 1) (put (quote in-package-components) (quote scheme-indent-hook) 1) (put (quote lambda-components) (quote scheme-indent-hook) 1) (put (quote lambda-components*) (quote scheme-indent-hook) 1) (put (quote lambda-components**) (quote scheme-indent-hook) 1) (put (quote open-block-components) (quote scheme-indent-hook) 1) (put (quote pathname-components) (quote scheme-indent-hook) 1) (put (quote procedure-components) (quote scheme-indent-hook) 1) (put (quote sequence-components) (quote scheme -indent-hook) 1) (put (quote unassigned\?-components) (quote scheme-indent-hook) 1) (put (quote unbound\?-components) (quote scheme-indent-hook) 1) (put (quote variable-components) (quote scheme-indent-hook) 1))) (defun scheme-indent-sexp nil "\ Indent each line of the list starting just after point." (interactive) (byte-code "?ACIAAAAASII!)^S?^ ?.. ? ^ ?.5 IX%f' V.| W.? ]" calculate-scheme-indent integerp /= delete-region] 24)) .