File: slime-scheme.el

package info (click to toggle)
slime 1:20080223.dfsg-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 2,600 kB
  • ctags: 3,345
  • sloc: lisp: 30,707; sh: 163; makefile: 119; awk: 10
file content (38 lines) | stat: -rw-r--r-- 1,227 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
;;; slime-scheme.el --- Support Scheme programs running under Common Lisp
;;
;; Authors: Matthias Koeppe  <mkoeppe@mail.math.uni-magdeburg.de>
;; 
;; License: GNU GPL (same license as Emacs)
;;
;;; Installation:
;;
;; Add this to your .emacs: 
;;
;;   (add-to-list 'load-path "<directory-of-this-file>")
;;   (add-hook 'slime-load-hook (lambda () (require 'slime-scheme)))
;;

(defun slime-scheme-mode-hook ()
  (slime-mode 1))

(defun slime-scheme-indentation-update (symbol indent)
  ;; Does the symbol have an indentation value that we set?
  (when (equal (get symbol 'scheme-indent-function)
	       (get symbol 'slime-scheme-indent))
    (put symbol 'slime-scheme-indent indent)
    (put symbol 'scheme-indent-function indent)))


;;; Initialization

(defun slime-scheme-init ()
  (add-hook 'scheme-mode-hook 'slime-scheme-mode-hook)
  (add-hook 'slime-indentation-update-hooks 'slime-scheme-indentation-update)
  (add-to-list 'slime-lisp-modes 'scheme-mode))

(defun slime-scheme-unload ()
  (remove-hook 'scheme-mode-hook 'slime-scheme-mode-hook)
  (remove-hook 'slime-indentation-update-hooks 'slime-scheme-indentation-update)
  (setq slime-lisp-modes (remove 'scheme-mode slime-lisp-modes)))

(provide 'slime-scheme)