-
Notifications
You must be signed in to change notification settings - Fork 1
/
swiqlisp-slime-helper.el
59 lines (54 loc) · 2.32 KB
/
swiqlisp-slime-helper.el
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
;;; Copyright © 2011 Sebastian D. Tennant <[email protected]>
;;;
;;; This file is part of swiQlisp — site-wide Quicklisp.
;;;
;;; swiQlisp is free software: you can redistribute it and/or modify it under the
;;; terms of the GNU General Public License as published by the Free Software
;;; Foundation, either version 3 of the License, or (at your option) any later
;;; version.
;;;
;;; swiQlisp is distributed in the hope that it will be useful, but WITHOUT ANY
;;; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
;;; A PARTICULAR PURPOSE. See the GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License along with
;;; swiQlisp. If not, see <http://www.gnu.org/licenses/>
;;; Commentary:
;;;
;;; When loaded (by Emacs) this file (slime-helper.el) configures Emacs to use
;;; swiQlisp SLIME (the Superior Lisp Interaction Mode for Emacs).
;;;
;;; Simply add the following line:
;;;
;;; (load (expand-file-name "~swiqlisp/slime-helper.el"))
;;;
;;; to your ~/.emacs init file (and remove any existing Quicklisp SLIME
;;; configuration).
;;;
;;; SLIME is called 'swank' in Quicklisp so don't forget to:
;;;
;;; $ sudo swiqlisp install swank
;;;
;;; before restarting Emacs. Do not use swiQlisp to install the package
;;; 'quicklisp-slime-helper'. It assumes Quicklisp is installed under your
;;; home directory and will not work as expected.
(setq quicklisp-slime-helper-base (expand-file-name "~swiqlisp/quicklisp/"))
(defun quicklisp-slime-helper-file-contents (file)
(with-temp-buffer
(insert-file-contents file)
(buffer-string)))
(defun quicklisp-slime-helper-slime-directory ()
(let ((location-file
(concat quicklisp-slime-helper-base
"dists/quicklisp/installed/systems/swank.txt")))
(when (file-exists-p location-file)
(let ((relative (quicklisp-slime-helper-file-contents location-file)))
(file-name-directory
(concat quicklisp-slime-helper-base relative))))))
(let* ((quicklisp-slime-directory (quicklisp-slime-helper-slime-directory)))
(add-to-list 'load-path quicklisp-slime-directory)
(require 'slime-autoloads)
(setq slime-backend
(expand-file-name "swank-loader.lisp" quicklisp-slime-directory))
(setq slime-path quicklisp-slime-directory)
(slime-setup '(slime-fancy)))