Clean up slime settings
This commit is contained in:
parent
127e6569e2
commit
efcfc9ba30
1 changed files with 34 additions and 53 deletions
83
init.el
83
init.el
|
@ -840,47 +840,49 @@ Uses `mk/hyperspec-dir-locations' to find the directory."
|
|||
(setq common-lisp-hyperspec-root (mk/hyperspec-dir))
|
||||
|
||||
(use-package slime
|
||||
:defer t
|
||||
:init
|
||||
(setq inferior-lisp-program "sbcl")
|
||||
:custom
|
||||
(slime-autodoc-use-multiline-p 1)
|
||||
(slime-autodoc-use-multiline-p t)
|
||||
(slime-complete-symbol-function 'slime-fuzzy-complete-symbol)
|
||||
(slime-net-coding-system 'utf-8-unix)
|
||||
:config
|
||||
(define-key slime-mode-map (kbd "C-c C-q") 'slime-close-all-parens-in-sexp)
|
||||
(slime-setup '(slime-autodoc
|
||||
slime-tramp
|
||||
slime-fancy
|
||||
(slime-setup '(slime-fancy
|
||||
slime-autodoc
|
||||
slime-asdf
|
||||
slime-indentation
|
||||
slime-editing-commands
|
||||
slime-sbcl-exts
|
||||
slime-company))
|
||||
|
||||
;; To create a slime specific sbcl image:
|
||||
;; shell$ sbcl
|
||||
;; * (mapc 'require '(sb-bsd-sockets sb-posix sb-introspect sb-cltl2 asdf))
|
||||
;; * (save-lisp-and-die "sbcl.core-for-slime")
|
||||
;; REPL syntax highlighting
|
||||
(defvar slime-repl-font-lock-keywords lisp-font-lock-keywords-2)
|
||||
(defun slime-repl-font-lock-setup ()
|
||||
(setq font-lock-defaults
|
||||
'(slime-repl-font-lock-keywords
|
||||
nil nil (("+-*/.<>=!?$%_&~^:@" . "w")) nil
|
||||
(font-lock-syntactic-face-function . lisp-font-lock-syntactic-face-function))))
|
||||
(add-hook 'slime-repl-mode-hook 'slime-repl-font-lock-setup)
|
||||
|
||||
;; Stop SLIME's REPL from grabbing DEL,
|
||||
;; which is annoying when backspacing over a '('
|
||||
;; Custom REPL prompt
|
||||
(defadvice slime-repl-insert-prompt (after font-lock-face activate)
|
||||
(let ((inhibit-read-only t))
|
||||
(add-text-properties
|
||||
slime-repl-prompt-start-mark (point)
|
||||
'(font-lock-face
|
||||
slime-repl-prompt-face
|
||||
rear-nonsticky
|
||||
(slime-repl-prompt read-only font-lock-face intangible)))))
|
||||
|
||||
;; (defun override-slime-repl-bindings-with-paredit ()
|
||||
;; (define-key slime-repl-mode-map
|
||||
;; (read-kbd-macro paredit-backward-delete-key) nil))
|
||||
|
||||
;; (add-hook 'slime-repl-mode-hook 'override-slime-repl-bindings-with-paredit)
|
||||
|
||||
(setq common-lisp-hyperspec-symbol-table
|
||||
(concat common-lisp-hyperspec-root "Data/Map_Sym.txt"))
|
||||
|
||||
(setq common-lisp-hyperspec-issuex-table
|
||||
(concat common-lisp-hyperspec-root "Data/Map_IssX.txt"))
|
||||
|
||||
(let ((image-path (expand-file-name "~/sbcl.core-for-slime")))
|
||||
(if (file-exists-p image-path)
|
||||
;; Load custom core file if it exists
|
||||
(let ((core-path (expand-file-name "~/sbcl.core-for-slime")))
|
||||
(when (file-exists-p core-path)
|
||||
(setq slime-lisp-implementations
|
||||
`((sbcl ("sbcl" "--noinform" "--core" ,image-path) :coding-system utf-8-unix)))
|
||||
(setq slime-lisp-implementations
|
||||
`((sbcl ("sbcl" "--noinform") :coding-system utf-8-unix)))))
|
||||
`((sbcl ("sbcl" "--noinform" "--core" ,core-path) :coding-system utf-8-unix)))))
|
||||
|
||||
(defvar mk/slime-remote-instances
|
||||
;; Remote instance configuration
|
||||
(setq mk/slime-remote-instances
|
||||
'((:machine-instance "code-metalisp"
|
||||
:remote-host "code.metalisp.dev"
|
||||
:username "cl")
|
||||
|
@ -894,28 +896,7 @@ Uses `mk/hyperspec-dir-locations' to find the directory."
|
|||
:remote-host (plist-get instance :remote-host)
|
||||
:username (plist-get instance :username))
|
||||
slime-filename-translations))
|
||||
mk/slime-remote-instances)
|
||||
|
||||
;; syntax highlighting
|
||||
(defvar slime-repl-font-lock-keywords lisp-font-lock-keywords-2)
|
||||
|
||||
(defun slime-repl-font-lock-setup ()
|
||||
(setq font-lock-defaults
|
||||
'(slime-repl-font-lock-keywords
|
||||
;; From lisp-mode.el
|
||||
nil nil (("+-*/.<>=!?$%_&~^:@" . "w")) nil
|
||||
(font-lock-syntactic-face-function . lisp-font-lock-syntactic-face-function))))
|
||||
|
||||
(add-hook 'slime-repl-mode-hook 'slime-repl-font-lock-setup)
|
||||
|
||||
(defadvice slime-repl-insert-prompt (after font-lock-face activate)
|
||||
(let ((inhibit-read-only t))
|
||||
(add-text-properties
|
||||
slime-repl-prompt-start-mark (point)
|
||||
'(font-lock-face
|
||||
slime-repl-prompt-face
|
||||
rear-nonsticky
|
||||
(slime-repl-prompt read-only font-lock-face intangible))))))
|
||||
mk/slime-remote-instances))
|
||||
|
||||
(use-package slime-company
|
||||
:after (slime company)
|
||||
|
|
Loading…
Add table
Reference in a new issue