4.4BSD/usr/src/contrib/emacs-18.57/lisp/scheme.elc


(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 "'   ") (modify-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 "!
!P!!lj!щ!҉	!Ӊ
!ԉ!Չ։
" [scheme-mode-syntax-table local-abbrev-table scheme-mode-abbrev-table paragraph-start page-delimiter paragraph-separate paragraph-ignore-fill-prefix t indent-line-function comment-start comment-start-skip comment-column comment-indent-hook mode-line-process set-syntax-table make-local-variable "^$\\|" scheme-indent-line ";" ";+[ 	]*" 40 scheme-comment-indent ("" scheme-mode-line-process)] 11))

(defvar scheme-mode-line-process "")

(defun scheme-mode-commands (map) (byte-code "###" [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 "   !" [nil kill-all-local-variables scheme-mode-initialize scheme-mode-variables run-hooks scheme-mode-hook] 5))

(defun scheme-mode-initialize nil (byte-code "!ĉʼn" [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 "b!i:!* 	<%	@&	):!n6ʂ8iT])" [pos tem t comment-column looking-at ";;;" ";;" calculate-scheme-indent skip-chars-backward " 	" 0] 6))

(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 "ň d`Z `!!$ł<-@iZ	!>łE
`\"jdZ`VRdZb	!?
b!`
b!`
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 " `	\"	b$ `W6`#%E	@E
Vʉ	8	A@Tbh`V#A@)?Tb?i`$!!`)V`$`\"!`$ b `$ 7i	\"@	b!iE!\"bi\\E>!>
>?>
	#?Ei.)" [indent-point state paren-depth desired-indent retry t last-sexp containing-sexp first-sexp-list-p parse-start nil peek scheme-indent-offset scheme-indent-hook beginning-of-line beginning-of-defun parse-partial-sexp 0 2 looking-at "\\s(" forward-line 1 /= forward-sexp backward-prefix-chars nthcdr 3 skip-chars-forward " 	" integerp boundp funcall] 23))

(defun scheme-indent-hook (indent-point state) (byte-code "i	A@Tb!`	A@\"c!`!`\"
!
!N!A	#bM	#b
GV[
O\"b	\"*))" [normal-indent state function method indent-point re-search-forward "\\sw\\|\\s_" /= buffer-substring forward-char -1 forward-sexp 1 nil downcase intern-soft scheme-indent-hook integerp scheme-indent-specform funcall 3 string-equal 0 "def" scheme-indent-defform] 14))

(defvar scheme-body-indent 2 "\
")

(defun scheme-indent-specform (count state indent-point) (byte-code "	A@bi
\\!!`$`W3Џ;ʈ(VN
\"\\DgU^
U^	Xeg	," [containing-form-start state i count body-indent containing-form-column scheme-body-indent indent-point t normal-indent nil forward-char 1 forward-sexp parse-partial-sexp (byte-code "S!`	$" [count indent-point t forward-sexp 1 parse-partial-sexp] 6) ((error (byte-code "" [nil] 1))) 0 * 2] 7))

(defun scheme-indent-defform (state indent-point) (byte-code "A@b!`AA@VA@b	i\\" [state scheme-body-indent forward-line 1] 3))

(defun would-be-symbol (string) (byte-code "O\"?" [string string-equal 0 1 "("] 4))

(defun next-sexp-as-string nil (byte-code "!`!`\")" [the-end forward-sexp 1 backward-sexp buffer-substring] 5))

(defun scheme-let-indent (state indent-point) (byte-code "!!	#	#" [state indent-point skip-chars-forward " 	" looking-at "[a-zA-Z0-9+-*/?!@$%^&_:~]" scheme-indent-specform 2 1] 7))

(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 scheme-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 "C!)?.
		?5m?` `%@\"@d  \"\"\"@}!\"\"ʉ	+
X*
VAS
WBT!`!m!*@@Y@@@[!!	\"A@[\"@)i\"*`\"j)." [indent-stack nil next-depth bol outer-loop-done inner-loop-done state this-indent last-depth innerloop-done t val 0 forward-sexp 1 parse-partial-sexp end-of-line nthcdr 4 indent-for-comment setcar 3 forward-line 5 skip-chars-forward " 	" looking-at "[;
]" calculate-scheme-indent integerp /= delete-region] 24))