首页 最近更新 网站讯息 页面索引 这是什么?

SlimeConfiguration

使用cvs slime,配置参照Common Lisp on Mac OS X

  (add-to-list 'load-path "~/elisp/3rd-party-lib/slime/")
  (add-to-list 'load-path "~/elisp/3rd-party-lib/slime/contrib/")
  
  (require 'slime)
  
  (slime-setup
   '(inferior-slime
     slime-asdf
     slime-autodoc
     slime-banner
     slime-c-p-c
     slime-editing-commands
     slime-fancy-inspector
     slime-fancy
     slime-fuzzy
     slime-highlight-edits
     slime-parse
  ;;    slime-presentation-streams
     slime-presentations
     slime-references
     slime-scratch
     slime-tramp
  ;;    slime-typeout-frame
     slime-xref-browser))	      ; fixed per suggestion from tcr on #lisp
  
  (setq slime-net-coding-system 'utf-8-unix)
  
  (setq slime-lisp-implementations
        '((sbcl ("sbcl" "--core"
                 "/home/liang/lib/cl/sbcl.core-with-slime")
                :init (lambda (port-file _)
                        (format
  		       "(swank:start-server %S :coding-system \"utf-8-unix\")\n"
  		       port-file))
                :coding-system utf-8-unix)
          (cmucl ("lisp"))
          (ecl ("ecl"))
          (allegro ("/usr/local/stow/AllegroCL/alisp"))
          (clisp ("clisp") :coding-system utf-8-unix)
          (lispworks (""))
          (openmcl ("dx86cl64"))))
  
  (setq slime-default-lisp 'sbcl)
  
  (defun start-slime ()
    (interactive)
    (unless (slime-connected-p)
      (save-excursion (slime))))
  
  (add-hook 'slime-mode-hook 'start-slime)
  
  (add-hook 'slime-load-hook
            #'(lambda () (require 'slime-fancy)))
  
  (add-hook 'inferior-lisp-mode-hook
            #'(lambda () (inferior-slime-mode t)))
  (eval-after-load "hyperspec"
    '(progn
       (setq common-lisp-hyperspec-root
             "/home/liang/lib/cl/HyperSpec/")))
  
  (defun indent-or-complete (&optional arg)
    (interactive "p")
    (if (or (looking-back "^\\s-*") (bolp))
        (call-interactively 'lisp-indent-line)
      (call-interactively 'slime-indent-and-complete-symbol)))
  
  (eval-after-load "lisp-mode"
    '(progn
       (define-key lisp-mode-map [tab] 'indent-or-complete)
       (define-key lisp-mode-map [(meta ?q)] 'slime-reindent-defun)))
  
  (eval-after-load "slime"
    '(progn
       (define-key slime-mode-map [return] 'paredit-newline)
       (define-key slime-repl-mode-map [tab] 'indent-or-complete)
       (define-key inferior-slime-mode-map [(control ?c) (control ?p)]
                   'slime-repl-previous-prompt)))
  
  (autoload 'turn-on-cldoc-mode "cldoc" nil t)
  
  (dolist (hook '(lisp-mode-hook
                  slime-repl-mode-hook))
    (add-hook hook 'turn-on-cldoc-mode))
  
  (autoload 'paredit-mode "paredit"
    "Minor mode for pseudo-structurally editing Lisp code." t)
  
  (dolist (hook '(emacs-lisp-mode-hook
                  lisp-mode-hook
                  slime-repl-mode-hook))
    (add-hook hook #'(lambda nil (paredit-mode 1))))
  
  (eval-after-load "paredit"
    '(progn
       (define-key paredit-mode-map [?\)] 'paredit-close-parenthesis)
       (define-key paredit-mode-map [(meta ?\))]
                   'paredit-close-parenthesis-and-newline)))